[SOLVED] HOW TO: stare event


sorry for disturbing again, but how do i code so that my enemy stares at the player (flip to the direction where the player is.)

any help is appreciated.


1 Like

Something similar has been explained in the tank shooter tutorial.

1 Like

I know that @piyushpalawat99 but it’s not that case I am working on a side-scrolling platformer
And I cannot implement that it’s for top-down games…

But I have found a way how this can be implemented. And I will share the screenshot of my code tomorrow.

Thank you.

1 Like


here is the working event.

here is what it does…

  1. It compares the X positions of the two sprites.
  2. then it decides where the enemy should look.

@4ian can i put it on the wiki??

This will only work for one golem. You must either use For Each or the condition to check X position of Golem.
Not simple things like that, that could go in a “how to” page or tutorial but only if it’s part of a bigger article (+ it has to be bug free :))


OK, thanks for your advice. i was wondering how to do that with multiple golems.