Reputation: 21
I'm developing for oculus go, and I'm making a sky dive like game where the player controls the hovering of the character with the head. I created an empty game object and placed the ovr camera rig inside to move it, then i use camera.main.transform.rotation
to get the oculus rotation, and to move the character to the direction the player is looking at. For example, i print the camera.main.transform.rotation
and get 4 values from -1 going to 0 and finally 1, what i did to get the tracking was
if(camera.main.transform.rotation.x>0)
{
//move the player up
}
Imagine if the oculus go prints values from 0 to 1 when I look up with camera.main.transform.rotation.x
When I get the apk it's fine and all but sometimes the axis are inverted and I have to restart the oculus go to fix this. Does anyone know why this happends, and what I'm doing wrong?
Upvotes: 2
Views: 1104
Reputation: 11
I had a similar problem with the z-axis controls. I'm doing a racing game for the Oculus go and wanted to control the direction of the car with the LocalControllerRotation.
In fact, the inversion happens when you rotate the oculus more than 180 °
in global space
(0° = LocalControllerRotation.w = 1f, 180° = LocalControllerRotation.w = -1f)
The problem was that the global value of Oculus did not change even after the view was reset. The Oculus scripts reoriented all controllers and cameras, but the values did not. And because my script worked by accessing the values, the result was reversed.
My solution was to check the LocalControllerRotation.w
value (should also work for the camera orientation) and then change the input
Upvotes: 1