How to set bool to true when object is rotated

How do I make bool set to true when object is rotated 90 degrees ? And when it is rotated 45, 30 etc… degrees make it false ?

Answer from previous replier won’t work as the wayunity does eulerAngle rotation will almost never hit a true integer. It will go from 89.999394 to 99.001123 or even larger differences depending on your rotation intervals. Note that even with the method I supply, you COULD run into problems, if your rotation distances are too large (meaning you rotate by more than 1f)

setting bool as soon as angle overshoots a certain threshold:

if(transform.rotation.eulerAngles.y > 90f)
    b = true;
else
    b = false;

setting bool only at specific angle:

if(Mathf.RoundToInt(transform.rotation.eulerAngles.y) == 90)
    b = true;
else
    b = false;

eulerAngles.y has to be your rotation axis. Also i answered this exact question like half an hour ago, why did you delete and repost it?