cancel
Showing results for 
Search instead for 
Did you mean: 

How do you enable Jump in OVRCharacterController?

VRfriend2016X
Protege
I noticed the class OVRInput.cs has a Jump() method and it says in comments that you must enable it. Where do i enable it?

But also in INput settings JUMP it's set to joystick 3...what exactly is joystick 3 in the xbox one controller?  seems from pictures i saw that is the Y button. but different pictures say different things.
33 REPLIES 33

VRfriend2016X
Protege
Ohhh cooool.

VRfriend2016X
Protege
Hey vrdaveb THANKS ALOT> Finally workeD!!!!!!  now it jumps. The jumps are fast and not very high but i can figure out how to change by changing the up force. if i want. Thanks alot!

VRfriend2016X
Protege
I did multiply JumpForce* 4 to make it at least reach a default cube's top.  But i'm noticing the jump is just quickup quick down. like it doesn't follow gravity rules. Anyway to make it a more realistic jump?

VRfriend2016X
Protege
Actually Jumpforce * 4 worked well. i reached the defautl cubes. But the jump is kind of unrealistic. Now i set Gravity modifier to 0.5 instead of default 1 and it's much better but   the movement UP is faster, then the falling down. that's kind of nonrealistic

vrdaveb
Oculus Staff
The way OVRPlayerController implements jumping is optimized for comfort. In reality, you would be continually accelerating -9.8m/s ^2 on the Y axis, but that would make the user nauseous, so it tries to maintain a constant velocity as much as possible.

VRfriend2016X
Protege
Oh I seee......................Ok thanks very much for the info. I just have one little question. How do you jump forwards while moving forwards i can't seem to get it . the jump method is this but i don't know how to modify it so that i can jump forwards too(if i first press and hold forwards, then press the jump key)









public bool Jump()

    {

        if (!Controller.isGrounded)

            return false;



        MoveThrottle += new Vector3(0, transform.lossyScale.y * JumpForce , 0 );



        return true;

    }




It seems when you push forwards and then keep pressing forwards and jump. it stops and does a straight up jumpinstead of a forward jump


vrdaveb
Oculus Staff
If you always want the jump to be forward, you could swap the Y and Z components of the Vector3 there. Or you could just scale the existing MoveThrottle by JumpForce. Then you would have to tweak JumpForce to get the right value.

VRfriend2016X
Protege

vrdaveb said:

If you always want the jump to be forward, you could swap the Y and Z components of the Vector3 there. Or you could just scale the existing MoveThrottle by JumpForce. Then you would have to tweak JumpForce to get the right value.


No i don't want to always jump forward, only when the user moves forward

VRfriend2016X
Protege

vrdaveb said:

If you always want the jump to be forward, you could swap the Y and Z components of the Vector3 there. Or you could just scale the existing MoveThrottle by JumpForce. Then you would have to tweak JumpForce to get the right value.



Hey i wonder how , what variable is the speed the player is going at a given movment. Cause i could use it
in MoveThrottle += new Vector3(0, transform.lossyScale.y * JumpForce , 0 );
and maybe add or multiply something to the Z value instead of letting it jut be zero

vrdaveb
Oculus Staff
what variable is the speed the player is going at a given movment.
That's MoveThrottle. You could use something like the following:
MoveThrottle = Vector3.Scale(MoveThrottle, 1f + JumpForce);

Disclaimer: I haven't tested this.