x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

How to make a ladder with Blueprint?

I read in another thread that UE4 doesn't have ladder volumes: https://answers.unrealengine.com/questions/7838/ladder-volume.html

I'm guessing I can make a ladder with Blueprint? I started by creating a volume with a mesh that when the player overlaps their location is modified so they're basically teleported upward. That's the first iteration.

The next step would be to instead change the player controller to one that made forward = up and backward = down perhaps? And probably turn off gravity while in that volume? And maybe change the player state to "climbing".

How much of this can I do with Blueprint and what parts would definitely require C++? Any clues on which classes or functions to look at, either in the code or via Blueprint, would be appreciated!

Product Version: Not Selected
Tags:
more ▼

asked Mar 23 '14 at 12:41 AM in Blueprint Scripting

avatar image

Youdaman
21 3 5 10

avatar image ParralexLLC Mar 23 '14 at 12:46 AM

This is totally possible using only Blueprint, and you won't have to touch C++ at all. Sadly that is all the assistance that I can provide at the moment. If your question is still unanswered after a while, then I'll try to create a sample Blueprint for you.

avatar image brunogruber Apr 11 '14 at 11:25 PM

Hi, I'm sorry for hijacking this answer, but I'm also looking for a ladder blueprint example to be used with the platformer template. Can you please provide the sample blueprint? I would be very grateful. Thank you!

avatar image ParralexLLC Apr 15 '14 at 03:12 AM

I've uploaded a quick Blueprint. I hope it helps!

avatar image SoraJr Jul 23 '16 at 05:16 AM

Has anyone figured out how to play the climbing up or down animation while going or down the ladder?

avatar image Umaya Oct 03 '17 at 01:17 PM

For this you would just need to check the player's velocity on the vertical axis. Greater than 0 would be moving up, less than 0 would be moving down and exactly 0 would be not moving.

(comments are locked)
10|2000 characters needed characters left

4 answers: sort voted first

I apologize for the late reply! Here is a quick demo blueprint that can function as a ladder.

Ladder Blueprint

I'll explain it step-by-step.

This is running within the player Blueprint. Upon each "Event Tick" (meaning that it runs every frame), a line trace (also known as a raycast) is cast from the player's position to wherever the player is looking. You can see this as "Get Actor Location" is connected to the trace's "Start" input. To make a line cast in the direction that the player is looking, I first grab a reference to the camera that is attached to the player (I'm using the First Person Blueprint Template by the way). Next, I remove the Pitch and Roll information from the Rotator so that the line is cast parallel to the ground (Yaw deals with the X and Y axes, Pitch deals with the Z axis, and Roll is the rotation around the forward vector; if you want to include the Pitch, then the "Break Rot" is unnecessary, although the "Start" input will need to be changed to the Camera's location instead of the Pawn's). "Rotate Vector" effectively converts the Rotator into a Vector, which is then multiplied by 1000, which acts as the length of the raycast. By adding the player's location to the trace, it localizes the "End" to be relative to the player. "Make Array" is there to check for WorldStatic objects, which I assume your ladder will be (moving ladders would be a bit more complicated).

In my scene, I placed a Blueprint Actor that I made that consisted of a StaticMesh that represented the Ladder. In that Blueprint, I set the StaticMesh to be Static (not Stationary or Movable) and in the Defaults tab, I added "Ladder" as a Tag Element (without the quotations).

Back in the player Blueprint, I have a Branch that checks for 1) whether anything was hit, 2) whether the actor that was hit has the "Ladder" Tag (which effectively verifies that the ladder is being looked at, and also allows any object that has a "Ladder" tag to be used as a ladder), and 3) that the player is in a "Falling" state. This prevents the ladder from being activated by simply being close, and requires the player to 'jump' onto the ladder. When all three of these conditions are met, then we move on to the next part, else we reset the gravity back to normal (it hasn't changed yet, but it will during climbing). Next, we check how far from the ladder we are, so that it is only activated when we are close enough. To do this, we grab the "Impact Point" and subtract the player's position from it. The length of the resulting vector is then checked to see if the length is small enough (I have it set at 100 in the Blueprint, but you can set it to any value you want, just remember not to set it too small, else it won't make it past the character's bounds). If it is, then we move on to the next step, else we reset the gravity.

Next, we check to see whether the player is trying to move the player forward, back, or at all. If they're trying to move forward, we convert this movement into positive movement along the Z axis (which moves the player up; I have it set to 500, but you can increase or decrease the speed as you see fit, or make it variable depending on how close to 1 the "Return Value" of MoveForward is). If the player is not trying to move forward, then we check if they're trying to move backward. If so, we set the movement as negative along the Z axis. If the player is doing neither, then we nullify all movement, so that the player stays at their current position. After these steps, we set the gravity to zero, so that the player does not continuously fall when not moving.

This being a quick blueprint that I made, there are quite a few inefficiencies from an optimization standpoint, such as setting the gravity to zero during every frame that the player is on the ladder, and resetting the gravity whenever the player is not on the ladder (which will most likely be the majority of the time). In addition, this blueprint does not handle what to do once the player has reached the top of the ladder. Currently, they will bounce up and down, as once they go over the StaticMesh, gravity will take hold, which will cause them to fall, and reattach to the ladder. An easy way to "pull up from the ladder" would be to have a trigger volume near the top of the ladder that activates when the player enters it, and a timeline that plays that moves the player to the top of the ladder.

I hope I explained everything clearly! I apologize if my grammar is messy in a few places. I'll be happy to answer any further questions that you may have!

ladderclimb.png (473.3 kB)
more ▼

answered Apr 15 '14 at 03:10 AM

avatar image

ParralexLLC
314 5 12 21

avatar image nopunintendo Apr 15 '14 at 03:42 AM

Thanks for taking the time to make/upload this and write up an explanation.

avatar image ParralexLLC Apr 15 '14 at 05:46 PM

You're welcome! I hope it has helped!

avatar image Youdaman Apr 16 '14 at 01:31 AM

Thanks for taking the time Parralex!

Turns out the answer had been accepted by an admin before I could even check it out, but I've managed to give it my own tick off approval now, thanks again :)

avatar image ParralexLLC Apr 16 '14 at 03:58 AM

You're welcome! Let me know if you need help with anything else!

avatar image florentine3d Oct 04 '14 at 06:47 PM

Parralex may you publish sample scene with you blueprint sample?

(comments are locked)
10|2000 characters needed characters left

I may be over-simplifying this somewhat, but thought I would post my solution for ladders here just in case anyone finds it useful. It is extremely simple and quick to set up, and produces exactly the behavior that I wanted. (Though others may want more for their games)

First I created a simple ladder blueprint and in the components tab made the ladder out of meshes in the example content: alt text

Note: make sure that the ladder volume (box component) extends far enough above the ladder mesh to allow the player to step off once reaching the top.

Next create this graph in the ladder blueprint graph tab. It simply sets the players movement mode to flying when entering the volume, and walking when exiting it. (Walking works better than falling as it ensures that the transition at the top looks natural) alt text

Final step in next post since it only allows 2 attachments per response.

more ▼

answered Jul 23 '14 at 08:23 PM

avatar image

Darkworth
31 1 92 11

avatar image Darkworth Jul 23 '14 at 08:24 PM

Finally, in the player blueprint, I check if the players movement mode is swimming or flying, and if it is either I add the pitch value into the movement calculations so that up and down movement work, otherwise i use the default "yaw only" calculation from the 3rd person sample. alt text

This produces a ladder volume that you can climb up and down and even move sideways on but as soon as you exit the volume you immediately transition to walking (which works well at the top and turns into falling if you are jumping off of the ladder midway.

I will of course be adding in custom animations for it as well as some special input handling for actually jumping off of the ladder midway.

avatar image Adam Davis STAFF Jul 23 '14 at 09:39 PM

Hi Darkworth,

Your layout is very similar to mine! I think the only difference is I have it set up to add movement to the z axis based on a key press (f for mine) instead of based on pitch. Amazing work!

avatar image arthursgqg Feb 09 '16 at 02:04 AM

Please help. what is the node where the flying and the swimming are in the last image posted from Darkworth?

avatar image DuhCent Jan 03 '15 at 03:55 AM

,Howdy Darkworth!

I am working on a project that involves ladders/wall walking, and, while I am sure your method above works (im sure it does), the screenshot of your "mycharacter" BP is not high-rez enough for me to see what is going on =( By chance, can you break up your screenshot into 2 or 3 parts, or, make your BP available for download?

Again, your the man for answering this question! Just having trouble following your BP screenshot...

Duhcent

avatar image eXi Jan 03 '15 at 11:44 AM

Just reorganized this a bit.

If you want, i can try to recreate the middle Part of his screenshot for you. I can see everything clear (:

avatar image eXi Jan 03 '15 at 11:55 AM

Here you go, i hope i didn't miss something:

FirstPicture

SecondPicture

http://puu.sh/e0KTN/f806717b3e.jpg

http://puu.sh/e0KVx/d712e4996c.jpg

avatar image arthursgqg Feb 09 '16 at 02:07 AM

Please help. what is the node where the flying and the swimming are in the last image posted from Darkworth? After the first node of Character Movement, there is a node recieving a Target and sending Movement Mode, and after that, we have a node set with swimming. I wanna know the name of those. Only thing, missing to finish the bp.

avatar image DuhCent Jan 03 '15 at 11:54 PM

Thank you eXi! I was able to combine the two screenshots into one image, and, from what I can tell, my character is walking up ladders/walls now =D Thanks again!

Duhcent

PS. For anyone who needs the combined image, please see attached. alt text

wallclimb.jpg (526.8 kB)
avatar image Deathscyp Dec 01 '15 at 10:05 PM

Hey guys tanks for the hd transcript,

Only one thing missing for those of you who tumbled on this remake and wonder why its not working properly.

You need a GET FORWARD VECTOR for your move forward INPUT and a GET RIGHT VECTOR for the right input ( swimming and flying) . I was grinding my head on this for a little while till i checked the actual not hd post to figure it out. now works like a charm. THANK you all who worked to make this possible!:D

CHEERS

(comments are locked)
10|2000 characters needed characters left
more ▼

answered Aug 13 '15 at 08:50 PM

avatar image

smokeBONES
11 1 1

avatar image KevLee Oct 02 '15 at 11:20 PM

Hi smokeBONES, could you post the PDF file to a dropbox or could I get a copy of the pdf file. Thanks

avatar image 彼之信仰 Jan 20 '16 at 09:19 AM

Sorry,I can't download the PDF,Please email me,OK? My address is ‘ytgg30545930@163.com’, Thanks!

avatar image Dardangelos Mar 07 '16 at 05:07 AM

Any chance I could get that PDF? I've followed the pictures, but all I ended up with was a ladder either broken controls or a ladder that doesnt work. I want to know where I went wrong.

avatar image magfund Oct 14 '16 at 08:03 PM

Could you send it to my email? Mariogtzf@tts.design

Thank you!

(comments are locked)
10|2000 characters needed characters left

looking over this i cant see any info for animations or to show the difference between the start and end of the ladder so i'm not sure how to use for third person, is this something i could build of this example using a state machine or would going a different route other (than changing the movement mode to flying) be better for my situation? (i have no other use for flying in my project so either way should be ok)

i'de like the jump button to trigger climbing ladders when close enough so i was thinking of making a "is ladder proximity" variable that triggers the start animation although this would likely cause the start animation to play when leaving the ladder. how would i define to start and finish properly in this situation ?

more ▼

answered Sep 16 '16 at 12:15 PM

avatar image

xeondeco
6 2 5 6

(comments are locked)
10|2000 characters needed characters left
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question