cancel
Showing results for 
Search instead for 
Did you mean: 

How to achieve movement like "flying" in VR

zombiepixel
Honored Guest

Hi everyone,

I have a question about the "continuous move" from the latest XR Interaction toolkit. I would like to use it in zero gravity and it works fine, but i can only move on the horizontal axis. Is there a way to add vertical movement as well? I basically want to achieve "flying", where the direction of flight is where the eyes of the headset are pointing.

 

Or is there maybe a better way to achieve this without the XR interaction toolkit?

3 REPLIES 3

Myelin_sheath
Explorer

Main thing is control transform and rotation of the main body. I think you should control "XR rig" or "camera offset" object,
by physically moving the object to the direction you want to

narciscsm
Honored Guest

Hi Zombiepixel.

 

Did you ever find out an answer to this question? If so, could you possibly point me in the right direction?

Thanks!

laurisD
Protege

Hi, The better way for fly is just to take the direction your camera is looking, then store this information in a Vector3 and when you trigger a button you call a FixedUpdate and move the player in the Vector3 direction. And oh course disable gravity or add +9.81y to your Vector3