How can I make my character move up a ladder?

Hello everyone,

I am making a simple 2D platformer and want to implement ladders to allow my character to reach places that are too high to jump to. But it seems impossible to make my character move anywhere along the z-axis unless it’s jumping. I’ve made sure the character is not constrained to a plane.

I’m trying to use a SetActorLocation node to make the character’s z-location change by 5.0 when the player holds down the climb button. But nothing happens when the button is pressed. To test it, I tried adding 2.0 to the x-axis, and that worked, but the character still wouldn’t move up. I also tried setting the gravity to 0, but that didn’t work either (character floated, but still wouldn’t move up).

So far, the only possibility I’ve managed to find is to switch the character’s movement mode to flying. That makes it possible to move up, but then switching back to regular movement becomes an issue. Because my climb functionality is coming of the up input axis event, I could switch it to either flying or walking based on whether or not the character is next to a ladder. But when the character goes back to walking, they are stuck forever walking, so they can no longer jump or fall.

I’ve attached a screenshot to show you what I mean. How can I make my character move up and down? Any help would be greatly appreciated.

Try setting gravity scale to zero while climbing instead of changing the walking mode.

Hi alperenkuz,

Setting gravity to 0 is actually one of the things I’d already tried. My character still wouldn’t move up regardless of the value of gravity. Do you have any other ideas?

You have to do a few things to get something like this to work. First, set your characters movement mode to flying while using the ladder, then add to the positive z value while in contact. Once you stop using the ladder reset the movement mode to walking/falling based on what is most appropriate for your setup.

This is the setup I use when I overlap my ladder actor to set movement.

EDIT: I just reread through your post and saw that you are already doing this. As far as I’m aware this is the best possible method to accomplish this task at present. Try setting it to falling instead of walking to get them to drop back down to the platform before moving.