Forum Discussion
V4DER_INH4LE
11 years agoExplorer
Enabling Jump!
Hello all,
My novice programming skills have come by to ask how to enable Jumping for the OVRPlayerController
Plz halp!
Thank you,
Alex
My novice programming skills have come by to ask how to enable Jumping for the OVRPlayerController
/// <summary>
/// Jump! Must be enabled manually.
/// </summary>
public bool Jump()
{
if (!Controller.isGrounded)
return false;
MoveThrottle += new Vector3(0, JumpForce, 0);
return true;
}
Plz halp!
Thank you,
Alex
2 Replies
- cyberealityGrand ChampionYou just call the jump function from your code somewhere.
For example, you can add this to the bottom of Update() in OVRPlayerController.cs:if (Input.GetKeyUp (KeyCode.Space)) {
Jump();
}
You probably also want to disable the "OVR Debug Info" component in the inspector (so you don't get the UI when pressing space) and you can also adjust the gravity and jump parameters as well.
However, just keep in mind that the jumping does not work that great and you'll have to make serious modifications if you want to use it in a game. - V4DER_INH4LEExplorerThank you Cyber, you are a great help.
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
- 8 months ago