I'm trying to develop a script that detects if an object's angles are tilting too much.
I am new to Unity, and I am sure this is not the best way to test an object's angles, but I am trying to learn C# so I'd rather figure that out myself.
All I want to know is how to check whether a value is between -101 and 101.
I have tried this so many different ways, and even though it is working fine for positive integers, the if statement is not applying the moment that my z angle becomes negative.
Here is what I have tried so far:
(maxangle = 101, minangle = -101)
if(Player.transform.rotation.eulerAngles.z > Mathf.Sign(-101) &&
Player.transform.rotation.eulerAngles.z < maxangle),
if(Player.transform.rotation.eulerAngles.z > minangle &&
Player.transform.rotation.eulerAngles.z < maxangle)