Prevent character to jump a wall twice when in air

Hi there.

As you know in side scroller template you can change character position in air. So when wall jumping it’s a fact that you can reach back the same wall as you are still in air and press jump again and it’s a wired situation. I want to save if I jumped off from this wall before and prevent the character to jump again. Anyone know a good way for this?

Thanks

is it that hard?

The first thing that comes into my head: each wall is a different actor, right? Can you maybe store the last wall the character jumped from in a variable, and before the character jumps again, check if the current wall is the same as the previous one; if it is, don’t jump.

Hi @Tuerer, Yes it seems to work but I created a custom event which is triggered when actor hit ground and used that event to reset the LastJumpActor variable value.
Thanks

I think it’s a must because when you fail to reach the second wall you can’t changed your last jump actor so you can’t try again on the same wall.

Oh, I thought you wanted your character to be able to jump off two or more walls wall in a row. If you only want the character to jump off a wall only once per jump, so yeah, ground hit is nice.