cancel
Showing results for 
Search instead for 
Did you mean: 

How to achieve movement like "flying" in VR

zombiepixel
Level 2

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
Level 3

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
Level 2

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
Level 4

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