# Confused by eulerAngles

I’m really confused by these eulerAngles.

For example, if you tilt the X one wa by 10 degrees, the tilt is 10 degrees. If you tilt it the other way by 10 degrees, it is 350 degrees. I get that it’s 360-10, but then this code confuses me.
if(tiltInX < standingThreshold && tiltInZ < standingThreshold)
{
return true;
}
if tiltInX is less than standing threshold, then it is standing up.
So if threshold is 20, and you tilt X forward by 10, then this code wont run, and the pin is standing up. And if you do tilt a pin forwards by 10 degrees and run the game, gravity will pull it back to 0, because it isn’t tilted far enough to fall over.
Now, if you tilt X backwards, it is now 350 degrees, which is greater than standing threshold, so it should return false, however, the pin is still standing, because it won’t fall over with only a 10 degree tilt.
The same applies for Z. A 10 degree tilt in either or both directions won’t knock the pin down, but this code will say the pin is no longer standing if the tilt for x and z go to 350.

Hi Stephen,
In the Bowlmaster code, you should be taking the absolute value of x and y, using Mathf.Abs().
The absolute value is the magnitude of the number, so ignores the sign.

With you’re X/Z rotation at 0 (not 360), you get 0+10=10 and 0-10 = -10. However, since you’re just looking at the magnitude of the number, the answer is 10 in both cases.

This is why the code work, even though you’re only checking it against a single value for the standing threshold.

I hope that clarifies it for you.