Skip to main content
HiroProtag0nist
Honored Contributor
May 9, 2019

Age Old Question - How To Jump

OK, can't believe i can't find this online - i'm using 2018.3.  What script to i have to add to OVRPlayerController.cs to enable jumping with the A button, which i think has the ID 0?  Unfortunately i just  don't know how to program/script.

/// <summary>
/// Jump! Must be enabled manually.
/// </summary>
public bool Jump()
{
if (!Controller.isGrounded)
return false;

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

return true;

Many thanks.
    This topic has been closed for replies.

    11 replies

    HiroProtag0nist
    Honored Contributor
    May 14, 2019
     :( 
    Big PC, all the headsets, now using Quest 3
    Participant
    May 15, 2019
    Just put this somewhere in the Update method of OVRPlayerController
    if (OVRInput.GetDown(OVRInput.Button.One))
    Jump();
    HiroProtag0nist
    Honored Contributor
    May 15, 2019
    Wonderful!  Now, I don't want to push my luck but the player now just drops from the jump - i've poked around Gravity in the OVRPlayerController script but can't find what to alter to make it a more curved return to the ground.
    Big PC, all the headsets, now using Quest 3
    Participant
    May 23, 2019
    Adjust the Gravity Modifier in the OVRPlayerController in the inspector (so not the script itself)
    I have mine set to 0.25, but depending on how floaty you want your jump to be you can set it even lower
    New Participant
    May 24, 2019
    Now, I don't want to push my luck but the player now just drops from the jump - i've poked around Gravity in the OVRPlayerController script but can't find what to alter to make it a more curved return to the ground.krogerfeedback
    HiroProtag0nist
    Honored Contributor
    May 24, 2019

    James4793 said:

    Now, I don't want to push my luck but the player now just drops from the jump - i've poked around Gravity in the OVRPlayerController script but can't find what to alter to make it a more curved return to the ground.krogerfeedback



    Is this spam?
    Big PC, all the headsets, now using Quest 3
    New Participant
    September 3, 2019
    Can i just say yall on here are amazing. It took me 2 seconds to find my answer. I just wanted to give a shout out!
    New Participant
    October 1, 2019
    Just put this somewhere in the Update method of OVRPlayerController
    Online
    New Participant
    January 7, 2020
    In the Kroger Feedback Fuel Points Survey Program, you will have to share your experience with Kroger. The Kroger Feedback Customer Satisfaction Survey is easy to fill out and it checks your satisfaction level with the most recent visit.
    Inspiring
    January 11, 2020
    Is the OVRPlayerController really worth it? I mean why don't you do your game mechanics separate from any platform dependent stuff, and then just move the camera with your character (OVRCameraRig prefab for Oculus)? Doing it with OVRPlayerController means you will have to reproduce that functionality when you decide to do a SteamVR version for example... or am I wrong here?