I already visited many links with some possible answers but I still didn't figure out how to implement this.
I have an object inside a pivot point( actually it is a door), and I want to rotate the door by like 90 degrees and stop there, at the moment my door rotates and never stops.
I just did this:
using UnityEngine;
using System.Collections;
public class moveLastDoor : MonoBehaviour {
private bool rotating = true;
public void Update()
{
if(transform.rotation.y < 90f)
transform.Rotate(0f,10f*Time.deltaTime,0f);
}
}
How can I stop the rotation in a specific desired point?