So I have an enemy that I want to face the player.
It's a 2D platformer.
The player can jump over the enemy and I want the enemy to face the player from both sides.
I use the program code below to do this.
player | X < enemy.X | enemy | Set Mirrored
player | X > enemy.X | enemy | Set Not Mirrored
Now this works perfectly for ONE of the enemies, but not duplicates of the same type of enemy.
How do I make all the enemies of the same type face the player?
Develop games in your browser. Powerful, performant & highly capable.
what event triggers this code?
you most likely need to go through all the enemies on the screen. Use a For Each loop (which will run completely in 1 tick). You should put all your enemies in a Family as well.
That's because with the order you used you're picking the player, and not the enemies.
enemy | X < player.X | enemy | Set Mirrored
enemy | X > player.X | enemy | Set Not Mirrored
What an easy fix!