What my code is doing is it is having the enemy match the players rotation…so whatever direction I look so does he. What I want is that he rotates to look at me -. I was simply using “transform.LookAt(Player);” but it was too fast so trying to figure out how to combine the LookAt(player) with the Slerp script below but can’t seem to merge the two.
Transform Player;
Transform enemy;
public float speed;
NavMeshAgent agent;
void Start () {
enemy =GameObject.Find("NAZI_SOLDIER").transform;
Player=GameObject.FindGameObjectWithTag("Player").transform;
agent = GetComponent<NavMeshAgent>();
}
// Update is called once per frame
void Update () {
//transform.LookAt(Player);
transform.rotation = Quaternion.Slerp (enemy.rotation, Player.rotation, Time.deltaTime * speed);
agent.enabled = false;
}
}