I have some trouble with flipping player object correctly.
The idea is to flip the player every time it touches the ExplodingBlock, no matter if the player is already flipped or not.
Currently, the player is being flipped if it touches the ExplodingBlock and it isn’t flipped. However, if the player touches the ExplodingBlock while player is flipped, it doesn’t flip back.
I’m not sure if some of the conditions are in conflict.
when flipping its like true or false
the action flip doesn’t flip I mean it flips it and if you want to return to normal you have to use don’t flip horizontally
Hi, thank you for the reply.
I’ve tried this, but this doesn’t flip player at all when in collision with ExplodingBlock.
because after line 3 runs line 4 becomes true and unflips the player
Oh, thats right I see it now.
Should I add some other condition?
yes, you can make a toggle variable
I’ve tried with booleans, but couldn’t get it to work. I’m not sure what condition should I check in order to toggle between states.
use a boolean, set it as true before triggering any of the events and then set it to false if line 3/4 was run, and add a condition for line 3/4 to check if the boolean is true
It flips only when the player is already flipped.
add the condition for the second one as well (line 5)
Managed to get it working. Thank you very much!