Skip to main content
Inspiring
July 3, 2016
Solved

How do you enable Jump in OVRCharacterController?

  • July 3, 2016
  • 33 replies
  • 8777 views
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.
This topic has been closed for replies.
Best answer by vrdaveb
You mean OVRPlayerController? Try adding code like the following to OVRPlayerController.Update():
if (Input.GetKeyDown(KeyCode.Space)
    Jump();

33 replies

vrdavebAnswer
Inspiring
July 3, 2016
You mean OVRPlayerController? Try adding code like the following to OVRPlayerController.Update():
if (Input.GetKeyDown(KeyCode.Space)
    Jump();
Inspiring
July 3, 2016
Thank you so much. I'll do do that. And so  jooystick 3 will be the                  y Buttong?
ok anwywas, thanks so much. i'm on my way to discovering more for more game
Inspiring
July 3, 2016

vrdaveb said:

You mean OVRPlayerController? Try adding code like the following to OVRPlayerController.Update():
if (Input.GetKeyDown(KeyCode.Space)
    Jump();


Oh yes i just noticed that Jump() method is in OVRPlayerController.   How do you        translate that code to xbox controller "Y BUTTON" for jumping?
Inspiring
July 3, 2016
You could use Button.Three or RawButton.Y. See the OVRInput documentation for more detail.
Inspiring
July 3, 2016
Thanks so much. So you would do if( Input.getButtonDown(Button.three)  Jump();?

Thanks alot
Inspiring
July 3, 2016

=================
Ok none of that worked. But i found the easiest that doesn't give me errors yet it doesn't work because it's not set up right in the Input settings








//JUMP Implementation

        if (Input.GetButtonDown("Jump" ))

            Debug.Log("I jumped ");




My Input settings for Jump, there's one for the keyboard, which is space. but there's another version Jump which is empty. I would if i knew how input "Y" into the POsitive value so that Y is the jump button but anything i type in there, gets erased when i move to another field or exit.



Inspiring
July 3, 2016
Use OVRInput, not Input. Also, Button.Three is X. Use Button.Four. Here is exactly the code I just added to OVRPlayerController.Update to confirm it works:


if (OVRInput.GetDown (OVRInput.Button.Four)) {
Debug.Log ("Jump!");
Jump ();
}


Inspiring
July 3, 2016
Here are my Jump settings i have no clue what to put in it and what joystick options to choose etc. Assuming i want the XBOX One's   Y key to be jump

vrdaveb said:

Use OVRInput, not Input. Also, Button.Three is X. Use Button.Four. Here is exactly the code I just added to OVRPlayerController.Update to confirm it works:


if (OVRInput.GetDown (OVRInput.Button.Four)) {
Debug.Log ("Jump!");
Jump ();
}




How do you have your Input Manager for Jump set up? As you can see mine is totally unfilled. i don't know what to put in it. ANd also you include JUMP()  but i saw jump() in the .cs class and it's a boolean return method....doesn't really have any code to actually do a jump. when i tried to script it it in it gave me an error the last time. I'll try again though
Inspiring
July 3, 2016
OVRInput does not use InputManager.asset. When you call OVRPlayerController.Jump(), it queues up a jump for the next Update.
Inspiring
July 3, 2016
Ohhh cooool.