In my scene I have two cubes one has a tag "Respawn" and another one has the following script attached:
using UnityEngine;
using System.Collections;
public class NewBehaviourScript : MonoBehaviour {
void Update () {
transform.rotation = Quaternion.LookRotation (
GameObject.FindGameObjectWithTag("Respawn").transform.position
);
}
}
When I run it and move around my second cube with "Respawn" tag the first cube doesn't always looks at it, at certain point it just starts rotating the opposite side as if it has bounds to it's rotation. What am I doing wrong?