Question by
SquigglyPig · Dec 05, 2015 at 06:07 PM ·
c#rotationdoor
Checking rotation of door
I have a tutorial scene set up, and at the end I have a resized cube with a door texture on it. I have set up the code to check for collisions and rotate it's pivot, but after the collision, the door rotates forever. Inside my void OnCollisionEnter()
, I have an if statement:
if (pivot.transform.rotation.eulerAngles.y == 83)
{
pivot.GetComponent<Rigidbody>().freezeRotation = true;
}
but it doesn't seem to work. Could anybody enlighten me on this? As I can't seem to find the answer.
Comment