cancel
Showing results for 
Search instead for 
Did you mean: 

How to solve Jump Problem?

Sourav.Sutradhar
Honored Guest

I want my player to jump. In OVRPlayerController.cs, I commented out the following code.

 

if (!Controller.isGrounded)
MoveScale = MoveScaleFloatValue;

 

After that I set my Gravity Modifier to 0.1, and I called the jump function from a different script using 


if (OVRInput.GetDown(OVRInput.Button.One))
{
gameObject.GetComponent<OVRPlayerController>().Jump();
}

 

Now my player jumps, but it is not smooth. The player falls down too fast. And If I try to move while jumping, my player moves too fast. Maybe 10 times faster than when I am walking. How to solve these two problem. Mostly the second problem. Can anyone help me? I am stuck in this problem for nearly 4 days.

Thank You.

2 REPLIES 2

MrArmyVeteran
Honored Guest

So I assume you found a fix? If you did do you mind sharing it?

SimonDarksideJ
Protege

I'll be truly honest, you really shouldn't try to force the camera to "jump" while a user is in VR.  Sure they can jump IRL and the headset will be tracked.  Otherwise you should use some sort of teleporting/movement.

My guess if you still want to try this, is that the OVRCameraManager, or the "TrackedPoseDriver" in Unity will likely still be interfering based of inputs from the headset.

The thing to remember is that you should be trying to move the environment and NOT the headset for these types of scenarios, because the player's physical position is not changing, so you actually want the world around the player to jump and not the player themselves.
Hope that helps.