How to make enemy look at player in 2D TOP DOWN game?

Hello,

I am making a simple 2D top-down shooter game. I need to enemy to look at the player and follow the player wherever he is. I know this has been asked before, but I CANNOT seem to figure this out. Since this is 2D, the only axis that should be rotated is the Z axis. I cannot seem to figure this out, please help!

You’ll want to use Mathf.Atan2 for that. The documentation has a great example, though they’re rotating around the Y instead of the Z, but you should be able to change that.

LookAt() rotates on the y, if you consider a flat plane. Therefore, why not make your flat plane xz?