Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

SteamVR CameraRig rotation, problem throwing objs

Discussion in 'VR' started by gomi91, Aug 10, 2019.

  1. gomi91

    gomi91

    Joined:
    Aug 26, 2017
    Posts:
    2
    I'm creating a VR application in Unity using SteamVR. I have implemented a Snap Rotation Script, so, the user can turn himself in-game without doing it phisicaly.

    My hierachy is: [CameraRig] -> (Controller left, Controller right, camera)

    Now the problem is: when I'm holding an object and i want to throw it, if i rotated the CameraRig earlier, the object throwed behave strangely. Its direction is out of phase, based on the cumulative rotation of the CameraRig. If I never rotate the CameraRig, the throwed object behave normally

    I'm using FixedJoint component to attach the object to the hand.

    How can I fix this?

    My code: https://pastebin.com/gJxPGVte