Forum Discussion
VRfriend2016X
9 years agoProtege
How do you enable Jump in OVRCharacterController?
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.
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.
- You mean OVRPlayerController? Try adding code like the following to OVRPlayerController.Update():
if (Input.GetKeyDown(KeyCode.Space)
Jump();
33 Replies
Replies have been turned off for this discussion
- vrdavebOculus StaffYou mean OVRPlayerController? Try adding code like the following to OVRPlayerController.Update():
if (Input.GetKeyDown(KeyCode.Space)
Jump(); - VRfriend2016XProtegeThank 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 - VRfriend2016XProtege
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? - vrdavebOculus StaffYou could use Button.Three or RawButton.Y. See the OVRInput documentation for more detail.
- VRfriend2016XProtegeThanks so much. So you would do if( Input.getButtonDown(Button.three) Jump();?
Thanks alot - VRfriend2016XProtege
=================
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. - vrdavebOculus StaffUse 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 ();
} - VRfriend2016XProtegeHere 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 - vrdavebOculus StaffOVRInput does not use InputManager.asset. When you call OVRPlayerController.Jump(), it queues up a jump for the next Update.
- VRfriend2016XProtegeOhhh cooool.
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 9 months ago
- 3 years ago