UE4 – Ladder (Half-Life style)

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:

Screenshot_0

Variables you need to set:

Screenshot_1

LadderSpeed is set to “Z 0.5”

Screenshot_2

Lets start by adding Branch between “moveforward” and “add movement input”:

This is where it detects if character is on ladder or not.

Screenshot_3

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.

Screenshot_4

Then we SET character was stopped boolean to true and pull exec spaghetti into “Add movement Input”.

Screenshot_5

How you can get SET:

Screenshot_6

And this one:

Screenshot_7

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.

Screenshot_8

Ladder Blueprint

In my ladder blueprint, there is two components:

  • Ladder mesh as instanced mesh
  • Collision box

Screenshot_9

Box collision:

Screenshot_10

Only one instanced mesh:

Screenshot_11

Variables you need:

Ignore SetCharacterFlying and SetCharacterWalking, didn’t remember to clean up from my previous experiment.

Screenshot_12

In construction script it’s just a loop (click for bigger pic):

Screenshot_13

In event graph you use “on component begin/end overlap events”, then you cast it to thirdperson or firstperson character:

Screenshot_14

From “as third person character” you pull out “character movement”:

Screenshot_15

How to get “SET is on ladder”:

Screenshot_16

Remember to add “Character was stopped” in ladder blueprint:

Screenshot_17

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

Leave a comment