Forum Discussion

🚨 This forum is archived and read-only. To submit a forum post, please visit our new Developer Forum. 🚨
yoyoguyss1's avatar
yoyoguyss1
Explorer
7 years ago

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?

1 Reply

Replies have been turned off for this discussion
  • vwing's avatar
    vwing
    Honored Guest
    Very 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)