I try to make a platformer where enemy always goes in the direction of a player, but I can't find a way for detecting on which side of player enemy is.
I would add LOS and platform behaviour (with controls disabled) to the enemy. Then if player is in line of sight, then move enemy towards direction of player.
Develop games in your browser. Powerful, performant & highly capable.
No, the enemy has to always know on which side player is, no matter if he sees him.
If the enemies X position is > the players X position, he's on the right. If it's less, he's on the left.
Thank you, so simple and yet I could not find it (actually I used it once myself, but forgot about it, silly me)