I came upon pretty stupid solutions on my google journey… making working ladder shouldn’t be that hard, so i decided to make a tutorial about it. Hopefully you can save some time.
Click to see video:
I’m using thirdperson character blueprint. So if we go to event graph you should see this section in there:
Variables you need to set:
LadderSpeed is set to “Z 0.5”
Lets start by adding Branch between “moveforward” and “add movement input”:
This is where it detects if character is on ladder or not.
Then we need another Branch, this stops character from moving annoyingly when there’s no input.
And if you fall on ladder with speed it does same annoying thing. End result is that player gets thrown off the ladder.
That’s why we need another Branch (upper).
Both goes to “Stop movement immediately” node.
Then we SET character was stopped boolean to true and pull exec spaghetti into “Add movement Input”.
How you can get SET:
And this one:
And that’s it for character blueprint, i forgot to add SET character was stopped (false) in here but it actually should be set in Ladder blueprint, when character doesn’t use ladder anymore. So if character falls off back to ladder it doesn’t bounce or slide off.
Ladder Blueprint
In my ladder blueprint, there is two components:
- Ladder mesh as instanced mesh
- Collision box
Box collision:
Only one instanced mesh:
Variables you need:
Ignore SetCharacterFlying and SetCharacterWalking, didn’t remember to clean up from my previous experiment.
In construction script it’s just a loop (click for bigger pic):
In event graph you use “on component begin/end overlap events”, then you cast it to thirdperson or firstperson character:
From “as third person character” you pull out “character movement”:
How to get “SET is on ladder”:
Remember to add “Character was stopped” in ladder blueprint:
In character blueprint Input “Axis MoveRight” event is where it moves sideways A and S keys, it kinda struggles with that and if you use controller it gets easily thrown off of the ladder when you pull Left stick down. It’s not so bad and player can probably deal with it but if you wan’t you can communicate with Ladder blueprint and add restriction, just simply cut sideway input off from the direction character was going, might be bad if exit is on side though. Another idea would be to play with Scale value, longer player holds it smaller the value goes but that needs Event tick. Also you could lock character on depth axis which is probably the best idea.
Anyway, if you find solution for that drop it in comments section or email me -> ctrl + f -> about.
Cheers 😉
Full quality pictures: https://imgur.com/a/avK28X4