Forum Discussion
yoyoguyss1
7 years agoExplorer
Getting Touch Controller Velocity
Hello,
I have been trying to implement everything from the character controller and grabbing objects using touch controllers from scratch.
I have set up my player object such that when I want to rotate I rotate a parent object and not the camera itself since I have no access to it thanks to the way VR is implemented in Unity.
Now I am getting my Velocity for my Controller like this OVRInput.GetLocalControllerVelocity(RightOrLeftController) and this works fine.
But when I rotate camera and toss an object the physics works the opposite direction because I am guessing the controller velocity is relative (local) to parent object.
How do I get Controller Velocity with respect to the world and not local to an object?
I have been trying to implement everything from the character controller and grabbing objects using touch controllers from scratch.
I have set up my player object such that when I want to rotate I rotate a parent object and not the camera itself since I have no access to it thanks to the way VR is implemented in Unity.
Now I am getting my Velocity for my Controller like this OVRInput.GetLocalControllerVelocity(RightOrLeftController) and this works fine.
But when I rotate camera and toss an object the physics works the opposite direction because I am guessing the controller velocity is relative (local) to parent object.
How do I get Controller Velocity with respect to the world and not local to an object?
1 Reply
Replies have been turned off for this discussion
- vwingHonored GuestVery late reply, but this post showed up in my google search soo...
You need a reference to the tracking space (the parent of the hands) then just do trackingSpace.transform.TransformVector(OVRInput.GetLocalControllerVelocity(RightOrLeftController)
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
- 2 years ago