Enemy is not facing the camera

I’m following the lecture for the Zombie runner and from what i’m seeing the script looks exactly as it’s shown in the lecture, even when compared to the changes that were made, but it just will not look at the player when chasing after it.

Any suggestions on where to look?

Hi Kalmana,

Have you already tried to add Debug.Logs to your code to see what is going on during runtime? And which object is referenced by the “look at” field? Maybe it is not the player.

I’ll have to take a look. I do not recall seeing any reference to a looking at field in the lecture.

From what i’m seeing it looks like it should be looking at the correct target. It’s just not rotating to face it.

Ah. I figured it out. I had an idle animation that was playing that was changing the rotation of the enemy model which was overriding the rotation for the navmesh agent. Fully removing the animation allowed the enemy to start to rotate to face me.

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms