As the title says, I need to find the current x rotation of a Vive controller.
I’m currently able to get accurate Y and Z rotation values, but not X, the values will be going down, get to maybe 270 and then go up again to 360 and then go down again until it loops around to 270 at which point it’ll go up again until going down once it again get’s to 360.
The end result being that the controller rotation is 360 at two points in a full rotation. At opposite ends of the rotation too and the rest of the rotation appears accurate, meaning that when it is facing down the value will be on the lower side of 180 and when it is facing up it will be above that. But 180 is never actually seen because it is 360 at that point for some reason.
I’m not sure if it’s possible to understand exactly what I mean from the above statement, but the point is that the X rotation Euler angles are inaccurate.
To elaborate on what I need, a good analogy would be, if the controller was the headset and it was strapped to the users head, I would need values to represent how far left or right the user is looking and how far up and down the user is looking. Right now the left and right value is accurate, but what I’m assuming must be the up and down value doesn’t work properly.
The code I’m using right now is
public Vector3 Angle { get { return controller.transform.rot.eulerAngles; } }
And then a simple Debug.Log(Angle) to print that out at every update, which is how I checked what the values were in response to my rotation. Making sure that when testing any specific axis I was only turning the controller in that one axis instead of two at once which would give weird results.
Thanks in advance!