Vaulting & Climbing (Parkour) Part 1 - Unreal Engine 4 Tutorial

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey guys welcome back to another religion full tutorial today I'm going to be showing you how to implement vaulting and climbing up so jumping so kind of like parkour into your game this is quite more of an advanced tutorial so this will be over two part series so today I'm gonna be doing the vaulting and then probably tomorrow I'll upload the climbing up and jumping aspect of it as well and so I'll also have the animations linked in the description down below as well so without further ado let's get straight into it so what we're gonna want to do first is just open up our character blueprint so mine is the third person BP will you Prince and a third person character but this can be whichever one you're using so the first person or whatever you've just named it and then we're going to use a key press to actually jump so instead of just getting a key like so I'm going to actually implement a hotkey for it so you can either change it we can have more than one if you want so go to edit project settings input and then action mappings add a new one I'm going to call it bolting like so you can call whoever you want like parkour jump maybe not jump to you or that one there but anything you like and I'm gonna set it to the V key like so then close that and go back to the character blueprint so now if we right-click and search for that what we did for the action mapping we just made so I called it vaulting like that there we go get that and then off of pressed we're just gonna drag out and get a line trace for objects like that there we go and then down here we're going to want to get the actor location like that then also get the actor forward vector and then we're going to drag off the act location and get a vector - a vector like that and then off of the forget support vector we're gonna get a multiply vector multiplied by a float node like so and then for the values for these we're gonna set it so it for the top one it subtracts 44 from the Z and on the bottom one it multiplies by 70 and then we're gonna put these two into an ADD node like so so vector plus and vector and just put that one the top that one in the bottom and then move this over just a little bit and then plug this this pot here so from the subtract plug that into the start and then from the addition there plug that into the end and if the object types we're gonna just want to drag out and make array like so and we're gonna want to make this work static so it should be that by default I'm also going to want to trace complex and for draw debug type we want it to be a forger ation like that and then off of here then I want to drag out and get a branch like so and then also off the out hit will just drag out and then break hit result like that and then just expand it there and also if the return value will just plug into the branch there like so and then we're gonna make some variables so we'll right click on the location and promote to variable and we'll call this wall location plug that into the true off of the branch and then right click on the normal promotes variable and call this wall normal and obviously you can change these names for how if you like but these are just most simple basic straightforward names they get the job done so we do that and then we'll just copy and paste the line tracing here so line trace for objects make array and break hit result copy and paste that here and just plug that in to the set wall normal like that and then down here we're going to right click and get forward vector again like that and then also make rot from X like so plug the return value fat into the in row of the get forward vector and then get the wall normal and plug it into the AK to the X of that there so we just drag that up a bit like so and then for return value you get forward factor we're gonna get a vector multiplied by a float and set the floats to minus ten like so this bit more space and then we'll get the wall location so type it in and get or girl and get a addition nodes so vector plus a vector and then plug multiplication into there like so and then we'll move this back just a tiny bit more and then drag off of this so they're talking bubble for the addition and that's going to go into another addition so another vector plus vector like that and then return value of that goes into a subtraction so vector a minus vector and then offer the return value again after the addition goes into the start or a time value if this subtraction goes into the end like so and for the addition we want to just simply add 200 to the z axis and then minus 200 off of the z axis for the bottom one like so so then out of the line trace again when I want to get another branch like that telling by the you goes into the condition again like so and then now we want to set the wall height so for the location of this one we're going to right-click promote to variable and call this one wall height like so and then plug that into the true like that and then off of this we're gonna get a sequence because we're doing more because we want to do more than one thing after this and then off of then 0 so the first thing it's gonna do is get a branch like this now it doesn't really matter what order they're in unless you have delays but we don't this is fine it should do them all at the same time sent up here we're gonna just simply drag in the wall Heights and get war location and get and then just do a subtract so vector minus vector but a wall high in there and the wall location in there and then we drag off this and break the vector like so and then after they said we get a float is greater than a float and then set the bottom that value to sixty like so and then just plug the return value back into the condition of the branch like so then we need to make another another new variable so we'll just hit the plus variable there we'll call this should player climb or should climb anything you like to something along those lines make sure it's a boolean like so and then off of the branch here we're just gonna drag off and set so then off of true we'll set it and then we'll duplicate that and set off of false as well and for true we're gonna set it to true and then off of forcible set it to false so tick the top one like that and then off of then one which is going to simply drag out and get another line trace for objects so we can just move this up and then just duplicate this again copy and paste this sorry I don't need the breakout result so just copy and paste that like there plug that into then one like that and then down here we're going to right click and get forward vector and down here we're just gonna simply copy and paste this again because we're just reusing this so just copy and paste that down here and you plug into the same places so they talk one goes into start addition start subtraction into end and then down here we just want to change the the multiplication from minus 10 to minus 50 like that and up here we're going to change it from adding 250 to the said sorry adding 200 to 0 to 250 to the Zed so then subtracting 202 subtracting 300 from the Zed then we're just going to drag out off the return value and get another branch like that click that in there and then we'll make another new variable and call this is war thick or anything along those lines again just something like that and then off of the folks we're gonna set that so set it to false or false there we go and then off the out hit again which is going to simply break hit resort and expand that like so and offer the location off of here we're going to right-click promote to variable again I'm going to call this wall height to or over wall height or anything like that something along those lines and we're going to plug this into the true off of the branch like so and then off of that we're going to drag out and get another sequence like that and then off of then zero we're just going to again get another branch like so and we'll get the wall height so drag and drop get and then we'll height to drag and drop get which do another subtraction so drive off of wall height effector minus vector wall height two in the bottom like so and then drag off of the return value for the subtraction and break the vector and then I'll just move this up there off of this set I'm gonna get another float is greater than float and we want to set this to 30 and plug that return value into the condition of the branch that we've just made like that and then we're gonna set the ears wall thick so we'll put the inter true and false like that and off of true we're going to set it to false and off for folks we're setting it's true so take the bottom one like that and then off of then one we're going to drag out get another branch like this and it's a condition we're gonna go it should play a climb like that then also offer the is wall thick here that we set before the sequence I'm going to drag off this and get a reroute node just plug that into there so off of then one well then go into that as well and that goes into the branch there or you can just plug it straight in to the branch as well but this just keeps it a bit neater like that so this just then joins it so this is real thick false and goes into here as well so now we're going to import our animations and create the montages for these so if you go back to the content browser I'm going to make a new folder call it parkour open that up and then I'll import all of the animations which again we linked in the description down below so you should simply drag and drop them all in like this the skeleton you use the character you're using for me I'm using the usual mannequin and this should all be good so import all like that and then with them all still selected we're going to right click create and create an in montage like that and then we have an animation montage for all of them like so and we're going to go into our animation blueprint so if you already have one created for your character that's fine and I have made of a tutorial on that as well if you want to check that out but for this tutorial purposes I'm just going to be using the animation blueprint made with unreal for the default mannequin like that load that up and then we're going to go back to the default and then actually like just adding graph like so track default out and then drag off of that we're gonna get a new slot slot default slot and just plug that back into the result and then we'll go back to our third person character and offer false so if the player shouldn't climb it's going to volt so true should play climb it will climb a false it's going to fold so if we come down to the folks and we'll set the collision so for the character so if we drag and drop the captial component from the top left down here and then just drag off that and set collision enabled and obviously plug into the false like that gets hold a bit of space there we go and we'll leave it as no collision and then we're also going to get the character movement so drunk drop that in as well and then we're going to drag off of this and set the movement mode like that I'm going to set this to flying and we'll plug that back into there as well like that and the reason we're setting the movement we're applying is through it so that we can then use the brew motion later on properly and it doesn't glitch out or anything like that so then off of this we're going to get a branch like that and as a condition it's going to be is walk thick or whatever you called it like so and then off of the true or we're going to do to play an animation montage play an Amana Taj though and do it off of folks as well so it just copy and paste that down to folks like so and for the top one so offer true we want the animation one Taj to be the getting up montage and then they bottom one set off a false we want it to be volt montage and we'll leave all the other variables on there the same and then off of the return value for these we're just going to drag out and get a delay so it waits until the animation has finished playing like that so do that for both of them offered with both true and false and off of this we're going to set the collision and movement mode back to what they should be so what they were by default so we can just copy and paste the two we've modified earlier paste them there plug the completed for both of these delays into that so they both go into it and then select collision enabled it's gonna be collision enabled query in physics so it should be the bottom one and the movement mode is going to be obviously walking like so and then off of this what we're going to do is drag out and set the actor rotation like so and then we'll go down here a bit to give it a bit more space and we're going to get the wall normal variable so drag in and get then we'll drag off for this and make rot from X like we did earlier and then drag off the return value and break rotator like that and then off of the Z so you're we're going to drag out and get an addition so a float plus a float and we're going to be adding 180 to it like so and we'll drag off the return value for that and make the rotator again like so and make sure that that is plugged into the is that not the X or Y and you can just left-click to break the node like that to break the link so then to do the X and white we're going to right click up here and get the actor rotation like so then we'll right click on the return value and split structure pin and then we'll just plug the X and the y into there accordingly so now I'll just organize this a little bit get myself a bit more space like so and I'll just set this drag it up and move it up here like that and then I'll plug it return body of this into the new rotation of the setactive rotation like so and actually we also want to go back over here to just before the play animation montage it so select all that move over it just a little bit and then between the true and the play on a montage we're going to juggle for true and set the actor location like this so make sure that it'll clogged in there and then we're going to come down here into some space I'm gonna get the wall normal so get and then we'll make rot from X like that off the return value we're gonna get the forward vector like so the return value for that we're going to we're going to multiply the vector by a float and the float will be 50 and then they return value for that will go into in addition so vector plus vector and then we're going to add the get actor location onto that there so then just plug that in like that so again I'll just organize this make a look a bit neater like so and we'll plug this the return value from the addition into the new location of the set actor location like so and we're going to do that for both them as well so if we just copy and paste the set AXA location plug that into the false and plug that into this play animation montage as well move this down a bit and also plug this into the new location here as well so it's in both of them like that there we go that's no fix that issue and make sure everything's still plugged in how it should be then what we're gonna do is set the location again so we'll just drag this out a bit more and over here we'll set actor location once again and down here again what we're going to do this time is get the wall height so get wall height drag off of this and break vector and off of the Z drag off and get a subtraction so we float - a float that's going to be 20 like so return value for this and drag off and make the vector and again make sure this is plugged into the Zed like so and the X&Y once again we're going to get X a location right click on the return value split structure pin plug the accent and the Y into there like that and then the return value off of the make vector it's going to go into the new location on the second set back to the location we've just made now this seems to be quite it looks like there's quite a lot of unnecessary steps in here but trust me you need to do all of these steps for it to work properly otherwise it won't work at all or it just be glitchy and on smooth and all that maybe in future versions of the engine they might fix this or improve it but for now this is how it's done so this should now be the vaulting and getting up on two blocks done so if we just select with this and comment it so select all and press C I'll call this volton and/or thing up like so that seems good so like I say this should now be the voting done so in the next episode I'll do the get the actual jumping and climbing part so we test this we can minimize this I've already made a little kind of course so we can vote through windows and onto different objects and stuff so I hit play so if you have an issue where if you try to fall over it does something like that or it just teleports you back to the starting position that's because we need to enable root motion in the animations themselves so we just select all our animations and open them up like this and then we search for root animation and just enable that like so hit save close that and do it again for all of these this should now fix our problem so I've gone through and done it for all the animations I've used so now if I just close this and hit play go over and test this again I press B to fall over you can now see it works perfectly so we're now voting over and through objects like this I'm actually you see it changes on the height so this is higher than the window the hands go on top and we fought straight over like that if we go through the window the hands will go on top of the window as we're getting the height of the wall so in the next tutorial I'll show you how to jump up onto these and up onto here as well and up onto all of these vault over climb up all of that good stuff that we want to know so again that will probably up tomorrow as watching this as of recording this story so I think there'll be if this video we've done anything wants to do we set up the vaulting part of our parkour so we can go up to something an object like this hit V or whatever you set it to and we'll just follow over simple as that looks quite good well it's very well obviously it might not look too great sometimes but that's just because the animations were using so if you have your own animations which looked better obviously just import those instead and also mess about the delays to get it perfect for you but this works perfectly fine so I hope you enjoyed and I hope you find helpful and if you did make sure to LIKE subscribe down below so thanks for watching I don't see my next one [Music]
Info
Channel: Matt Aspland
Views: 102,258
Rating: undefined out of 5
Keywords: ue4, unreal engine 4, unreal engine, tutorial, ue4 tutorial, unreal engine 4 tutorial, how to make a game, how to, 3d modelling, blender, unity, games design, graphic designer, vault, vaulting, jump, jumping, climbing, line, tracing, trace, pubg, cod, fps, through, window, over, wall, up, climb, on, to, animations, anim, montage, line tracing, array, character, easy, quick, follow, first person, third person, how to vault, implement, put in, how to climb, rock, blueprint, blueprints, simple, advanced, basic, math, ue5
Id: h_Cr_azdsDE
Channel Id: undefined
Length: 21min 33sec (1293 seconds)
Published: Fri Jun 26 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.