- Home /
Oculus Rift controller gravity off?
Hi,
I have Oculus Rift and have no problems adding the standard OVRPlayerController and then being able to walk around my project. However for some projects i need to be able to fly around instead of walk. I tried changing the OVRPlayer Controller script Gravity modifier to 0 and that seemed to disable movement (apart from head tracking). I also tried changing the gravity settings in project settings to 0 and this also seemed to disable movement. Any ideas?
Answer by stubbsie · Mar 25, 2015 at 05:24 PM
Hi to remove gravity just go into the OVRPlayerController.cs and look around line 220, you should find the following:
// No positional movement if we are in the air
if (!Controller.isGrounded)
MoveScale = 0.0f;
Just comment this block out and set your gravity modifier to 0 and your player will no longer be effected by gravity that's being controlled by this class.
Your answer
![](https://koobas.hobune.stream/wayback/20220613172432im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Charactercontroller won't go down, only goes up 1 Answer
How do I set an updraft in my glider simulation? 1 Answer
Fix flying control 1 Answer
Problems making a glider 3 Answers
Third person controller in Flight 1 Answer