Is there a way to make OVR tracking space follow player rotation?
I have a playerController script that enables my player to move around and rotate on the y axis while still facing the camera sensors. I also have a grabObject and throwObject scripts that let me pick up a rigidbody and throw it using the touch controller velocity and angular velocity. The problem I'm having is when I rotate my player 180 degree and throw an object.
player rotation function:
private void vrRotateMovement()
{
if (OVRInput.GetDown(OVRInput.Button.SecondaryThumbstickRight))
{
transform.Rotate(0, 90, 0);
}
if (OVRInput.GetDown(OVRInput.Button.SecondaryThumbstickLeft))
{
transform.Rotate(0, -90, 0);
}
}
Whenever I throw an object along the x axis, the object goes the opposite direction my controller is throwing. I believe this is because I'm not rotating the sensors along with the player relative to the world. I can turn my actual body around 180 degrees and the throwing direction of the object is correct, but not when I rotate the player and still facing towards the sensors.
How do I rotate my player and my sensors orientation so I can throw objects in the correct direction while still facing towards the sensors? Any help is greatly appreciated!
Answer by patrick-holder · May 26, 2018 at 03:19 PM
I'm having the same problem and can't seem to find any solutions online. Did you manage to solve this in the end?
Did you try using Rigidbody.$$anonymous$$oveRotation
? make sure the player you are rotating has a rigidbody.
I didn't really go very far with OVR sdk, and I solved the problem initially by using VRT$$anonymous$$.
Your answer
Follow this Question
Related Questions
how to change the color of cube using vr gaze 0 Answers
SteamVR menu button stops coroutines when pressed. 2 Answers
Photon Networking: Moving all players vr 0 Answers
Tetxure swap using HTC controllers 0 Answers
Autowalk in VR (Cardboard) in Unity 2018.2,Autowalk in VR (Cardboard) in 2018.2 0 Answers