Forum Discussion
CrispyCritter86
7 years agoHonored Guest
OVRPlayerController dash implementation not working
I've been attempting to implement a dash into my game, but have not had any luck. It looks like pre-made code on the OVRPlayerController keeps my script from working, but I can't figure out what's going on. Here is what I have attempted to take the rigid body I threw on the player and force it forward when the left thumbstick is clicked in....
//dashing variables
public Rigidbody rb;
float speed = 5f;
void Start()
{
//grabs rigidbody for dashing
rb = GetComponent<Rigidbody>();
}
void FixedUpdate()
{
if (OVRInput.GetDown(OVRInput.Button.PrimaryThumbstick))
{
//Player dash forward script
rb.MovePosition(rb.position + Vector3.forward * speed * 2 * Time.deltaTime);
}
1 Reply
Replies have been turned off for this discussion
- escrowdisHonored GuestHi Oculus staffs,
I used a prefab 'OVRPlayerController' to understand how Oculus Rift and Touch work, but I got the same problem here and it really depressed me. No matter which button or axis I added in script is not working. I've checked the OVRInput.GetActiveController() and OVRInput.GetConnectedControllers() both return 'Touch' which I guess the controllers are connected, meanwhile the OVRInput.GetLocalControllerAcceleration() works fine. Not pretty sure if there's any part that I didn't notice or did wrong.
My environment shown in Unity is Unity v2018.3.12f1, Oculus Utilities v1.32.0, OVRPlugin v1.32.0, SDK v1.36.0.
[Update May 2 2019]
The buttons are functional in exe mode, but why it can't also workable in Unity Editor?
Please help. Thanks!
Code snippet in OVRPlayerController.csUpdateMovement()
{
// ...
if (OVRInput.Get(OVRInput.Button.Start))
{
Debug.Log("Start trigger");
}
if (OVRInput.Get(OVRInput.RawButton.Start))
{
Debug.Log("Raw Start trigger");
}
// ...
}
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
- 4 years ago
- 6 years ago
- 2 years ago