Can't get sprite to flip when key pressed

Yes, I searched. Didn’t find it.

I watched the platformer tutorial (Platform(er) - In Depth Tutorial - GDevelop - YouTube) and everything is going well. However, I can’t get the sprite to flip. It seems to do so at random.

It is supposed to face right when Right Arrow is pressed, and left when Left Arrow is pressed. I tried to use the trigger once procedure as well to see if that could be the issue. I also tried messing around with the “activate flipping” switch, using the Yes and No options on both conditions, and that did not work.

Thank you for any help.

I also just want to say that this engine is quite confusing. As someone coming from about ~3 and a half years of actual coding experience I really don’t understand a lot of stuff and had to watch so many tutorials on the most basic things. But, this is advertised as a no coding engine so maybe that is to be expected.

You wrote both conditions and actions in the same event.

1 Like

Hi,
Here is the problem in your enent for flip:
The problem is there is only one event.
GDevelop works event after event: all conditions of one event has to be true for the actions of this event to be made.
In your case you have only one event… so it doesn’t makes sense in gdevelop. What you wrote would mean "if both left and right button are pressed, then don’t flip horizontaly, and then flip horizontaly…

Just separate them in 2 distinct events.

One for left, one for right.

1 Like

I’m staring at the code and wondering how I didn’t realize, thank you.

3 Likes