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.
1 ACCEPTED SOLUTION

Accepted Solutions

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

View solution in original post

33 REPLIES 33

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

VRfriend2016X
Protege
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

VRfriend2016X
Protege

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?

vrdaveb
Oculus Staff
You could use Button.Three or RawButton.Y. See the OVRInput documentation for more detail.

VRfriend2016X
Protege
Thanks so much. So you would do if( Input.getButtonDown(Button.three)  Jump();?

Thanks alot

VRfriend2016X
Protege

=================
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.



vrdaveb
Oculus Staff
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 ();
}


VRfriend2016X
Protege
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 jumpjdjdggbs3uio.jpg

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

vrdaveb
Oculus Staff
OVRInput does not use InputManager.asset. When you call OVRPlayerController.Jump(), it queues up a jump for the next Update.