Forum Discussion

🚨 This forum is archived and read-only. To submit a forum post, please visit our new Developer Forum. 🚨
khos85's avatar
khos85
Explorer
11 years ago

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.

2 Replies

Replies have been turned off for this discussion
  • 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.
  • "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.