How to make enemy face the direction it is heading

How do I make the enemy flip to face the direction it is moving in?
I currently have it set to move towards the player within a set area (it can move back and forth).

2 Likes

Could you maybe send a screenshot of your code? The solution depends on how the movement is set up.

1 Like

look at an example here

1 Like

You can use extract, if the x velocity is greater than zero, back, if the x velocity is less than zero, flip.

1 Like


I am unsure what those switches are for, a more effective and cleaner method would just be 2 filters.
Typically the messier something looks the more likely it is ineffective. (Make sure you keep a balance with cleanness and flexibility)

1 Like

oh yeah, I was trying to make it so that is won’t continue flipping it forever, only once until the other side is activated. I guess that doesn’t matter