Multiple conditions

Hello guys , i wanted to ask you if i made a mistake in this code ,because “isAlligned” always stays false.I putted it in a function which is called on Update().

if((spinningPartObj.transform.rotation.z >= 88 && spinningPartObj.transform.rotation.z <= 92) || (spinningPartObj.transform.rotation.z >= 178 && spinningPartObj.transform.rotation.z <= 182) || (spinningPartObj.transform.rotation.z >= 268 && spinningPartObj.transform.rotation.z <= 272) || (spinningPartObj.transform.rotation.z >= 358 && spinningPartObj.transform.rotation.z <= 2)) { Debug.Log("Is alligned!"); isAlligned = true; } else { Debug.Log("Is not alligned!"); isAlligned = false; }

Yes. Your mistake is in thinking that transform.rotation.z represents a rotation about the z axis, measured in degrees. It doesn’t. transform.rotation.z is the third element of a quaternion.
I suggest you look up eulerAngles: Unity - Scripting API: Transform.eulerAngles

Thank you for your response , i fixed it.Now i faced another problem.One UI image is rotating to Vector3.back and another UI Image is rotating to Vector3.forward , and i want to check when theirs rotation is the same but of course one element should be as Quaternion.Inverse , but i just dont know how to use it. This line : if(spinningPartObj.transform.eulerAngles.z == Quaternion.Inverse(spinningPartBackObj.transform.eulerAngles.z)) gives me error , any other ways to check inversed rotation?