Forum Discussion

🚨 This forum is archived and read-only. To submit a forum post, please visit our new Developer Forum. 🚨
zombiepixel's avatar
zombiepixel
Honored Guest
5 years ago

How to achieve movement like "flying" in VR

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

Replies have been turned off for this discussion
  • 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

  • Hi Zombiepixel.

     

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

    Thanks!

  • 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