how to make an enemy face the player

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By ImANoobAtCoding

so im currently making a script for my enemy, this is for a topdown game.
idk how to make it so that if the player is at the right, the enemy also faces the right and same goes to up, down, and left

:bust_in_silhouette: Reply From: exuin

It really depends on how you want the enemy to face the player. If you just want the enemy to rotate, how about using look_at with the player’s global_position?

thanks but i meant for animation, like it plays the left animation when the player is at the left of the enemy

ImANoobAtCoding | 2020-10-02 09:47

Also i already found a solution

ImANoobAtCoding | 2020-10-02 09:47

Oh, alright :slight_smile:

exuin | 2020-10-02 17:31

What was the solution?

TiTan0s | 2021-02-12 02:22