How to Make a Simple Climbing System in Unreal Engine 5

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
what's up guys welcome to new Unreal Engine factorial and today I'm going to show you how to make a very simple climbing system it's going to be a very easy beautiful so let's get started but first check out the link in the description to get our some unreal ending courses on winbox alright so the first thing that we're going to do is go ahead and open our character blueprint so in my case I'm gonna be using one that I just created basically I just duplicated the normal third person mannequin I just added my own skeleton so they can be compatible with my climbing animations so basically the next step will be to basically get some climbing animations now I will be leaving them in the description just in case you want to grab them they're basically from Maximo so we're going to be using this ones today okay so let's start by actually making the interaction with the wall or whatever the things that we want to climb okay so I'm gonna just start by creating a basic Cube over here in the scene so we can just have something to basically go ahead and climb so I'm just gonna put it over here and make it much taller there you go something like that just something to have to climb so I'll go in here and then press the key and I will be climbing okay so let's go into our climbing character I'm gonna go into the bank graph so what we're going to do is create a new function this is going to be our claiming lines Trace so this will basically create a line Trace that will basically give us the position where we want to be able to grab and climb so what we're going to do is a line Trace by Channel and basically our starting point is going to be our get actor location as it's just gonna start where we are right now and then it will end with our get rotation with actual rotation turn rotation so we want to get our current rotation and we want to get the forward Vector so we can know where we are looking with the character and then what we want to do is basically multiply this value I'm going to go ahead and right click convert this into flow so basically this is going to be the distance that we're going to be able to um climb into objects so for example let's say 100 just for now we can change it later so now I'm going to go ahead and add two vectors we're going to have hold Ctrl and drop this down and put the location over there and then this is going to be our endpoint so now we'll be able to create a line trace and basically just a hang on to things so I'm gonna say that the the book type is going to be for duration so we can just preview how it will look I'm gonna go quick into the van graph and go up here and add an event tick so I'm gonna call the climbing line Trace so we can use preview what we have done so now I press play you will see that we have a red line in front of the player so we'll do that if you go into the wall and the red line is impacting with the wall we'll be able to go ahead and climb the wall so the next step will be I'm gonna yeah delete this I'm gonna go back into climbing line trace and what we're going to do is go ahead and make a branch over here so we only continue if we have actually collided with something and then we want to do is make an output so we'll go ahead and select the function and then add an output and this will be basically the um the out hit here the outhead and then what we want to do is make this on the true and then this will not be a Boolean this will actually be in well an outfit so we won't start hit result there we go and then we'll go and just plug this one in here and I'm gonna make it a bit more prettier we just double click and put in this lines over here it says a bit better okay great so now we have our line Trace to be able to climb into things okay so now we're going to do is be able to actually climb into things if we actually grab it so all I'm going to do is go into a Zone over here for example up I'll say that I want to cl to grab with the E key so let me get the E key over here let's go down here this and we're going to do is that when we press it but we're gonna go the climbing line Trace that we have just done and we're going to do is basically get the out hit so um the thing is that the our head will give us if we actually um like all the parameters of the object that we have hidden but I want to actually make a change and it's delete this branch and then actually iterate it into the return node so just drag it in and it will also output the um has hit so basically we'll know if we have hit it um outside of the uh function which it will be just at the dirt so I'm going to continue with the branch and then we want to do is basically break this hit result so now we have all the parameters I'm going to take this bit up um of the hit result so if we actually have collided with something we're going to just create a new variable is as that it is climbing okay so basically it's climbing will be set to true and then we're going to do is continue and what we're going to do is basically set the movement mode of the player into B flying and you'll be like questioning well why um we are setting this into B flame well basically it will just disable the uh gravity and things like that automatically for us so it'll be just easier we just use flying now I think that they're going to change is go into class defaults and search for flying and then if you go down into brick sorry breaking up deceleration this will be into zero so this clock does uh cut this up into around a thousand so it's just because there will be a a smooth transition if not like an inertia I guess when you move around and if you just increase the braking deceleration of line it would just look a bit better so make sure to just put this into high volume and now we can continue with our um blueprint over here so the thing is that we're gonna make the um Orient orientation to movement and disabled so basically if we start going for example into the left our character will not start facing the left as it is in the direction which is moving so it just stay focused looking at the ball and now one of the last things that we want to do is basically just set the actor rotation to be a new rotation so we're going to go ahead right click and split it so we have all the different axis values and we want to do is basically get our normal and then and get a rotation rotation from X so we're going to right click and split it and this will just return us the rotation on the normal angle one basically the Z axis of it so then we can use uh add 180 into this axis and then what we can do is just plug it directly into the new rotation offset so basically this will be forcing the character to always be facing the wall and the next thing I'm going to do is get the actor rotation rotation so basically the current one and you set the x and the Y to basically you skip in what it's doing we're gonna go ahead command this is going to be a claim claim being interaction at this is when we are uh hitting e basically so right now it will really not do anything uh I mean we can try it out but we will not be able to proper climb uh you can see um now we have some things going on but yeah we still really cannot do anything it's still like kind of broken so we're going to do now is go into the advantage so we're gonna add this this will trigger each on each frame so as you know the ventic so we want to do is basically make sure that we Are Climbing so sorry here we go if we are climbing uh we're gonna continue so we're going to do is basically just repeat basically all these steps that we have done here but because we're gonna also have a um not claiming but like and declining I guess we could call it when you just um stop climbing I guess yeah better named uh we will just make the reverse of all this but a thing that we want to create in every frame is the set actor location so I'm just gonna cut this get this get this and get this so I'm gonna copy and then paste it over here so the reason why we uh why we are doing this is that we want to set and overwrite the rotation of the character on each frame because if not it will only do it once at the start and then if the if this wasn't a wall or whatever or this was basically kind of tilted and the rotation will not change it currently but if we do it every frame it will because it will be updated if it makes it but we'll once again uh once again I need to call the climbing line trace and just in the uh true statement and then we're just gonna go ahead and make the branch again on here to just make sure um but then it will be much cleaner because we only need to get this and then you can just get the normal and just plug it in over here so now it's a bit more organized and I guess we could call this the claiming Loop because I guess this will be just repeated once a month so now we have pretty much a lot of the climbing logic aren't prepared but now we need some more things we actually need uh need to be able to move up down left and right um accordingly to the wall so we want to do is go back into the movement input so basically this is just the normal Unreal Engine by default control using the new enhancing but of course but of course if you're using another Unreal Engine version other one like 5.03 using normal input it will also work but basically we're gonna make some more space over here so we're gonna basically turn this down and then pull this up over here and what we want to do is in the forward and backwards what we'll want to do is just set get up vector so we would just want to get the the up Vector instead of the forwards Vector so we want to move up and down so just copy this paste this here and then we want to do is get this and make a branch so if this is false it will go here but this is true it will go over here so what are we going to make well we're gonna check if we are climbing so if we are not climbing it will be normal but if we're climbing it will be moving up or down and then we need to plug in the scale value back here so now we can just get this and then the rotation we can just get the pawn rotation paste it over here and then right click split it and then you spawn the Z over there and then what we want to do is also for the left and right just making sure that it's just looking um forward to wall each time so what we can do is say um get a vector right get right vector and then we can copy this paste this over here and then again make a branch this is looking a bit messy because of the comments but you can tune it in later to make it a feature it's just making it fast to show you how it works and then again this will be if it's climbing and then this will put down here and then uh there we go so now we should be able to properly climb the ball the wall sorry so if I go here um and go in here press e you will see that I can okay so I'm moving into a certain direction each time so I didn't plug this K value I just realized so let's go ahead and plug that okay I just made the dumbest thing in the world we have to connect this into here basically that was the error uh because if not it were not in Branch it will not continue so now we go we can hit e and then we can go up down right left okay so we can go in all directions and it's looking pretty cool now we need to make it so that it will stop climbing when we are now longer basically interacting with something so what we can do is go into here and the false we will go ahead and call a custom event which will be stop climbing and here we'll go ahead and call it stop claiming okay so we're gonna do some things over here we're gonna firstly set disclaiming so I can set it set to false and then the next thing that we're going to do is go in here and set the character movement mode to be back to uh so we should do into walking but the thing is that it will be nice to say if falling if we are on on a different altitude because as soon as we touch the ground it will go back to walking so the most convenient thing will be to set it into falling and then another thing we'll get is the um Orient orientation to movement I'm gonna get this and just paste this over here and then turn it back to true go ahead and press C for comment and then stop uh claiming okay so now we should be able to stop climbing if we go outside of the bounce there we go we go back into um into walking and another thing I want to do is basically if we hit any key um for example hit e again we may want to stop climbing so we can do just a flip flop and say okay in case a will go here and in case b will go there but because it may vary if we are climbing a knot and basically in a time this will the sink well what we're going to just say if we are climbing or not so if Branch let's say here so if we are not glue in so we'll be a bit cleaner if we are not climbing so this is true not climbing it will start to climb and then if this is basically false it will say stop climbing basically so now we can just go here press play start claiming and then when I hit e again it will just fall into the ground okay so we have pretty much all the uh climate system done so the last thing that we have to do is set up our animations so let's go into our animations um and go into browser I'm going to go ahead and right click go into animation and it's going to be a blank space so we're gonna go ahead and select our skeleton and then this is gonna be the climbing playing space so we're gonna go ahead and open this up all right so here we'll be able to transition between all the different animations very smoothly depending on um basically a value so we'll go firstly into the uh axis settings I'm going to set up some things over here so the horizontal axis is going to be the move left and right so this will be the animations for moving left and right and the vertical axis will be the moving uh moving up and down okay so then the minimum access value for for move left and right will be minus 100 and then the maximum will be 100 and the same for moving up and down so we go between minus 100 and 100. so now we want to set up our animations in this grid over here so let's search for the climbing Edo and this will basically go into the center snap to grid over here so now it will be easier to change it and then we just snap exactly what we want so basically our Ito animation will be zero zero zero on our Center and then uh the climbing up and down so uh winning Tech uh climbing up and down animations right now I only have the up animation but what I can do is just get this rename it into just so you will have probably the same animations if you you don't want it from my description it would you just be climbing up and then I can just duplicate this one and say climbing down and open this one and then the rate scale which is basically the animation speed can be minus once now it will be backwards like it was going down very cool clever trick and then in here uh we can just let it on left again and then duplicate it then this will be um right and then we can open this up and then the red skill will be -1 so you can see if you go into here open this up we can get the climbing up animation to be over here and climbing down animation to be on here so now if I hold Ctrl you will see the transition as the value increases it will go from going down into idle and then into climbing up uh so it's really cool so we're gonna get the climbing left in here and climbing right on here so now it will basically be transitioning and you can see that uh if I get into a corner it will actually kind of smoothly um interplayed in between the two so we don't need an extra animation for going in between the best place would do it automatically for us so this is really cool okay so this is set up we can close it and now we can go into our animation blueprint that you hopefully have um if you're using the mannequin you will have it of course you have your own character well probably you will have it um if not I can make an uh tutorial on how to make a proper animation uh blueprint but anyway we're gonna go into our same machine I'm gonna add a new state over here this will be the climbing and then it will just interpolate between our Locomotion and our claim so we want to just drag it into an arrow and then drag it down over here so we can change this depending on some value so I want to create a new variable which is is claiming so we're going to go into the uh from Locomotion to climbing I'm going to double click in the circle and then we can just drag this in so if it's climbing it will go I'm gonna go back and then in the from climbing to Locomotion and double click get it's climbing I say not booing so basically if it's not climbing anymore it will basically go back now we want to double click on climbing and we want to get our climbing's blend space and just plug it in over here and we'll basically play the climbing land space and then we have to create these two variables which will be the values that I set before on the uh on here sorry this one not uh this was the one there we go here basically the value to interplay between the two okay so it will be from range of minus 100 to 100. so what we want to do is right click promote to variables so this will be the move left and right and right click from Parable and this will be the moving up and down so go ahead and move this okay so now we can go power and Save so we're gonna go into our Advanced graph and then uh if you don't have this you can just quickly copy it basically just on the try uh get pound honor and you can just cast into your character blueprint and then well I was getting the velocity for my blank space but yeah basically we had to get some values and no and which direction we're going up or down so we're gonna go back into our uh character blueprint I'm going to go down I'm going to create two more variables because it's going to be moved um up and down axis axis no axis sorry and then this is going to be a float so change this into float and I'm gonna make a new one it's gonna be moved um left and right Axis so now what we can do is just plug this over here so the move up and down axis will go into this one so it will this one so it's plug it set it and then right after the two well I actually just the one of climbing of course makes to understand we can just drag this and just plug it in the icon here and then on the one of moving uh left and right you just set it and then we can just go after this plug it in and then go back into here of course and then this will be uh the x value over here so now we can go back into climbing and we can just get our um up and down axis and then what I want to do is basically times them by a hundred and the reason we've been doing that is because um these values range from zero to one and the values on the Blank Space values uh from minus 100 to 100. when this could pull back here and then set the moving up and down set it and then with the value that we have over here and then in the left and right set it and then get from here get uh left sorry left and right and then again we can just copy this and times it by a hundred and then plug it into here so we need the last thing which is basically setting if uh is climbing so we can just get set is climbing and then on here we can just get is climbing and basically just plug it in over here so now we can go ahead and test this out so if I press play go with e you can see that I am on my Edo animation go up and well okay I got too much up up you can see the animation down left and right and you can see that there's some uh things happening over here basically first of all the changes between animations are used very very very uh like hard and we want to smoothly change between them and then the things that the animations are kind of bugging a lot so I think I'm going to do is go into the animation blueprint and basically we want to get our velocity if you don't know how you can just see this nose get the character component the boss theme the term value and then what we want to do is check if this is basically equal to zero so if it is it means that we are not moving so we're going to make a branch and if this is true we're gonna set the um move left through and then up and down also to zero now we're gonna go back into the climbing blend space and to basically set this value should not be uh so much of uh um different I'm gonna go back into a sample smoothing I'm going to increase this into a very high number I'm gonna say for example 200 right now which is basically a lot so now that we have set up the white speed tool a high number like 200 we want to go into the uh smoothing time over here in the both axis and put something around one and one for example so you will see that now we actually will get a much smoother there we go response into it as you can see over here maybe it's too much you can put like 0.4 and yeah or something like that you can play with these values to make it look a bit better of course but in full screen um but yeah basically it's your decision but we're already getting a very cool result a simple climbing system now it doesn't look exactly good because of the animation that I got but you can go ahead and play with them I also play with the values so yeah there's a whole bunch of things that you can do in order to make it uh look better or for example point one even to make it much much smaller and then maybe turn the white speed into 50 something like that now we will have a more relaxed transition as you can see uh you can play around with the values but yeah basically now we have a simple climbing speed uh you can see that so now we're going to scope back in here go into our climbing line trace and set this into none so we don't have the messy red lines and there we go we have a sample climbing system so if you guys enjoyed the tutorial and found helpful I really appreciate you got a video subscribe to my channel I have lots of Unreal Engine pack tutorials to this one so if you want to check it out go ahead and now yes with all I said bye bye [Music] thank you
Info
Channel: Gorka Games
Views: 25,853
Rating: undefined out of 5
Keywords: games, videojuegos, unreal engine, unreal engine 5, ue5, climbing system, tutorial, quixel, megascans, unreal engine climbing system, climbing unreal engine 5, ue5 climbing system, ue5 climbing tutorial, ue5 how to make a climbing system, unreal engine 5 zelda breath of the wild climbing system, unreal engine 5 botw climbing, unreal engine 5 climb wall, unreal engine 5 how to climb any actor, unreal engine 5 climbing on any surface tutorial, ue5 simple climb tutorial, climbing in ue5
Id: wKafQYX8fz4
Channel Id: undefined
Length: 25min 43sec (1543 seconds)
Published: Fri Dec 16 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.