Disable Jumping on Ladders now that Ladder Speed is in the game

Hi everyone,
I’m trying to find a simple way to disable jumping while on a ladder, as otherwise ladder speed has no effect since the player can jump and climb the ladder super fast.
The code I tried is

The effect is that the zombie can’t jump on the ladder like I wanted (but it can jump off the top??) however if I move the zombie next to the ladder, then move it away again, I can’t jump at all (no matter how far away it goes).

There is a video here to show the behavior:
https://youtu.be/0LcZJiyen2c

I looked at the previous solution posted where we disable default controls and simulate, but this has lots of code implications, especially for using animations for different actions.

I’m hoping that someone can explain WHY the behaviour is doing what it is doing, and maybe suggest a workaround that doesn’t involve disabling default controls.

On your jump event, just add a condition of “Is on ladder (Inverted)”. That way they can’t jump at all when on the ladder?

Hi, thanks but not sure if this is what you mean?

The result was the same as the first idea - won’t jump on the ladder but also won’t jump afterwards either.

Can’t find an action that would match the two conditions other than disabling jump key or setting the jump speed to 0 (effectively stopping jumping).

1 Like

Try this:

  • Zombine is on ladder
    • set = Zombine jumping speed to 0
  • Zombine is not on ladder
    • Zombine distance between ladder is not below 200 pixels
      • set = Zombine jumping speed to 600

Another tip: If 200 is the width of zombine then instead of hard coding it, just write this expression there: zombine.Width()

Thanks but no dice! Still made no difference. Once the zombie gets to the ladder, it successfully sets the jump speed to 0, but it stays this way even when the zombie is not on the ladder, unless it lands more than 50 pixels away from the ladder. Exactly as in the video from the first post! I’m beginning to think there is a bug in the game system as it doesn’t seem to be re-checking the value of On Ladder/Not on Ladder correctly.

I’ve checked with a text label - the variable is changing and the on ladder / not on ladder is working, it is just not jumping!!!

Thanks to some contributions on another thread, I have come up with a workaround: It looks like this:

LadderSolution

Using the “exclusion zone” around the ladder and without the text label code, it looks like this:

This is much tidier than the previous solutions from another thread that required we disable default controls, a solution that has massive flow-on effects for my younger or less computer savvy students!

Thanks to everyone who contributed.