Can't rotate an GameObject...


i want to make a GameObject flying around passing some waypoints. On its way it should face the waypoint it its heading to.

This worked fine with this script:

    void FixedUpdate()
      	transform.position = Vector3.MoveTowards(transform.position, WP[actPoint].transform.position, speed * 10);
			speed = UnityEngine.Random.Range(minSpeed, maxSpeed); 
			if(actPoint >= WP.Length)
				actPoint = 0;

But suddenly it stopped rotating. I even cant rotate it with for example transform.rotate(0,90,0) - what happened? “WP” is an Array of empty GameObjects which act as waypoints.

Can you help me out?


Check so the object is not static. Static objects cannot move/rotate

check so you havent lockt any of the xyz axes

If you have an animator with Apply Root Motion unchecked, it will disable changes to rotation so make you sure you check it.