When I turn my players pan to the left, his pan is positive, (0 -> 360) if I turn to the right, his pan becomes negative (0 -> -360)

This is problem-some because I'd like to use the players pan as a trigger for particular moments, but if the player turns right a few times, his pan can become negative and thus wouldn't activate something like this

if(player.pan > 45 || player.pan < 270)...

How can I keep the players pan from going into the negatives?

I've tried player.pan %= 360;
player.pan = clamp(player.pan, 0, 360);// this only allows for left panning

Im not to sure what to do to overcome this. can someone please help me?


A8 Pro 8.45.4
YouTube: Create Games For Free
Free Resources: www.CGForFree.com