Flipping the graphic of a horizontal moving enemy when using the 'RetangleMovement' behaviour

Hi all! First game so please go easy :slight_smile:

I have a moving enemy that goes back and forth (horizontally only) and I’ve applied the ‘RectangleMovment’ behaviour to it - but - no matter I what I do it only faces one way. When its moving left I want it to face left, and if it’s moving right I want it to face right.

I’ve tried using events - but it doesn’t seem to work (events screenshot below). Am I over complicating this and going about it the right way?

Any tips? You’d really be helping me out! THanks in advance. Jayson.

I’m not familiar with the behavior but in your screenshot, everything is in 1 event. You need to add another event and move the matching 2nd condition and action to it.

Right now it’s checking if both conditions are true which unless you only have more than 1 object will never be true. A single object can’t more in both directions.

The actions also needs to have one set to yes and one set to no. So, if going in one direction it’s in the flipped state and going the other direction it’s in the not flipped state.

You can also add a trigger once to each event. So, it only triggers the actions once per change in direction.

1 Like

Hi Keith - that worked perfectly! Thanks for your help - really appreciated. I’m back and and running now :slight_smile:

Now I’ve just got to figure out how to show a different animation frame when it ‘turns around’ so it isn’t such a binary ‘flip’ between moving left and right.