# How can I track the number of rotations of my users head?

As explained in the title I’m trying to track how many times my user makes a full rotation with their head. The problem I’m having is distinguishing between when they turn left and then go back right (so their recorded angles might go from 358 to 1 but they haven’t really gone all the way around they’ve just shook their head back and forth. I was also thinking of trying to add up all movements to the right and then increment my counter when that number had reached 360, but if they turn their head left and then turn it right again then that distance will be counted twice and will not give the results that I want.

Any ideas on how to solve this problem? I’ve searched around a bit but haven’t found any solutions that worked for me.

Well, you can not achieve your desired behaviour with Euler angles, you need to track heads quaternion values, which is pretty hard if you are not a mathematician, but you can try

Something like this but refined will work
the first limit value you can set it in the inspector the other one will add when the rotation in “y” is 90

``````    public Vector3 LimitValue1;
public Vector3 LimitValue2 = new Vector3 (0.0f , 90.0f , 0.0f);

int = number;

if(transform.LocalEulerAngles < LimitValue1)
{
number = number + 1 ;
}

if(transform.LocalEulerAngles < LimitValue2)
{
number = number + 1 ;
}
``````