Skip to main content
Up and Coming
July 14, 2015

OVRPlayerController - Jump with Spacebar?

Hi,

I have a question,
I'm using Unity v5.1.1f1, Oculus Utilities v0.1.0, OVRPlugin v0.5.0 , in the OVRPlayerController - how can I make the character controller jump with Spacebar? The script on OVRPlayerController refers to Jump but how to use it? If spacebar is pressed then the Oculus rift overlay shows... Can I just remove a script to get rid of the overlay?

Thanks for any help/advise on this.
    This topic has been closed for replies.

    2 replies

    Inspiring
    July 14, 2015
    First, you can disable the debug info menu by deselecting "OVR Debug Info" on the OVRPlayerController inspector.

    To actually make the player jump, you just call the "Jump();" function.

    For example, at the end of Update() in OVRPlayerController.cs (around line 213) add:

    if (Input.GetKeyUp (KeyCode.Space)) {
    Jump();
    }


    In the inspector, I'd also adjust Jump Force to 0.8 and Gravity Modifier to 0.4.

    However, the jump functionality is rather bare-bones at the moment, and you will have to modify it significantly to get something usable in a real game.
    AMD Ryzen 7 1800X | MSI X370 Titanium | G.Skill 16GB DDR4 3200 | EVGA SuperNOVA 1000 | Corsair Hydro H110i Gigabyte RX Vega 64 x2 | Samsung 960 Evo M.2 500GB | Seagate FireCuda SSHD 2TB | Phanteks ENTHOO EVOLV
    khos85Author
    Up and Coming
    July 14, 2015
    "cybereality" wrote:
    First, you can disable the debug info menu by deselecting "OVR Debug Info" on the OVRPlayerController inspector.

    To actually make the player jump, you just call the "Jump();" function.

    For example, at the end of Update() in OVRPlayerController.cs (around line 213) add:

    if (Input.GetKeyUp (KeyCode.Space)) {
    Jump();
    }


    In the inspector, I'd also adjust Jump Force to 0.8 and Gravity Modifier to 0.4.

    However, the jump functionality is rather bare-bones at the moment, and you will have to modify it significantly to get something usable in a real game.


    Oh wow, thanks again cybereality! Much appreciated.