- Home /
Rotation Constrain
Hello, as many here I'm facing a certain difficulty
public float objectRotation = 0.2f;
void Start () {
}
void Update ()
{
gameObject.transform.Rotate(objectRotation, 0.0f, 0.0f);
}
What I want to do is constrain the movement so that once it hits 60 degrees, it stops moving.
Thank you for your help.
Comment
use a if else statement to check if gameObject's rotation is 60?