How To Make Parkour Slide In Unreal

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey what's up guys in this series of videos I'm going to be showing you how to create some Parker features for your gaming unreal in this video specifically we are going to go over sliding so I have this obstacle right here and we want to slide under it so we need an animation for this of course and I have this anim slide that I have from mixo but obviously you're going to have your own sling animation so I want to open it first of all and one thing that we need to make sure here is if we go into the asset details and scroll down a little bit we have the root motion and what we need to check is that enable root motion is checked like this is it has that blue check mark basically what it means is that our character is going to move along with the animation so with that we can close this and we need to change it into animation Montage so right click on the animation create create an montage and I'm just going to call it am slide am is a shortcut for animation Montage then we are going to go into our player blueprint and I have my thir person character opener right here then we need some kind of a key bind that we are going to bind it to so I'm just going to keep B it to see now what we need to also do is we need to go to viewport and we have this thing called capsule component and this is basically our collision and if you go into the details under the shape you have capsule half height and what this means is basically how tall our capsule is now the reason why we need to check this is because yours might be slightly different depending on your character so what we are going to do with this is I'm going to just create a quickly a new variable and I'm going to call it CS height I'm going to set it to let's say float and I'm going to compile the blueprint so that we can set it and I'm going to set it to 90 and you want to set it to whatever you have here as the default because we are going to be returning to it another thing that I want to do here is I want to search for hidden in game and I want to make sure it's not unchecked because if it's checked then we are not going to be able to see it in the game and we want to see it to check if this system works so then we can go into our event graph and do the actual code so what we want to do first is create another variable and I'm going to call it can slide and I'm going to change it into Boolean now we want to get a branch plug it into the C event or whatever your key bind is get the can slide get it plug that in into the branch and then immediately want to set it and we want to plug it into true and we want to set it into false another thing we can do here is compile and just change the can slide into through by default then we are going to get our capsule component drag it in drag from it and search for set capsule half height plug that into the variable and then we are going to change the half height so what I'm going to do is I'm going to get my caps height get it drag from it search for divide and I'm going to divide it by two that way we are getting the half height of what we would normally get basically and we are going to plug that into the half height then we are going to get our mesh drag from it search for a relative location then direct from that and search for plus and then here on Z we want to add 45 then we are going to direct from the mesh search for set relative location plug that into the set capsule half height and then the new location we are just going to plug this plus into it and I'm going to explain everything after we do the code like usual then we are going to get our play animation montage plug that into the set relative location in here we can slot in our animation Montage that we created so we can just drag it from the content browser then we want to get a delay plug return value into it and that's basically plugging the length of the animation into the delay and then we want to get a sequence so you can hold on S on your keyboard and left click to get it quickly in here we are going to need to create two timelines so I'm going to drag from this create timeline and I'm going to call this set cup back because we are going to be setting the capu back to its original height then we can get our can slide set it plug it into the finished and we can set it to true then we are going to get our capsule component again drag from it set capsule half height plug that into the update then we can open this timeline add a new track our float track I'm going to just leave the name as is and I'm going to change the length to let's say 0.3 but you can change this around as you want I'm going to right click add key and then I'm going to do it again now the first one is going to be time Z and the value is going to be 45 and then the next one is going to be 0.3 which is the maximum of our length and then I'm going to change the value to 90 this basically means that we are going to start off on the 45 which if you remember we reduced the half height to 45 because we want it only to be half of it and then we are returning back to 90 if yours is different and your regular height is let's say 96 instead of 90 you want to return it to 96 then we can just close this and go back into our event graph then from the other pain in the sequence we want to drug out and search for timeline again and I'm going to set the location back then we want to get our mesh drag from it search for set the relative location plug that into the update and we want to also drag from our mesh then we want to drag from our mesh and search for a relative location then we want to right click it split stct Paine and we want to do the same on the new location we can copy paste the X and Y so we are just going to plug it into each other now we can open our new timeline add the track flow track and I'm just going to leave the name as is length I'm going to change to 0.3 as well and you want to keep these timelines to have around the same length on the timeline so if you change one to maybe smooth it out or something you want to change the other one as well then we are going to right click add a key add another key then the first one is going to be time Z and value on zero as well next one is going to be time 0.3 and then we are going to change the value to minus 45 this is basically just because we added at the start plus 45 and we are just removing the addition basically another thing that we want to do here is when we go back into the event graph we want to plug the new track into the new location Z and then on top here at the set cap back we want to do the same with new Tru into the H fight one thing to note here is since we draged from the sequence and search for timeline directly it plugged it into the play this is actually a problem because it's going to mess around and it's going to basically make our camera glitchy so what we want to do is we want to unplug both of these and plug them to play from the start this way it's going to restart the timeline basically every time you play this so how does this code work well it's actually really simple we are going to press a key band or something that you key banded it to we are going to check if we can slide if we can slide then we can slide because we don't want to slide in the middle of the slide obviously then we are setting the half capsule height and you're going to see that once we go into the play this is just so that our player character can actually move below obsti otherwise if we would just get stuck then we have the Setra location this is because of the animation because sliding animation would play on the same level as the body but that would mean it's not really on the ground so we want to also put it on the ground then we want to play the animation obviously we are waiting for the delay which is the duration of the animation and then we are basically reversing it back through the timelines so you can change the timelines and the time in thems I'm going with 0.3 but you can go with 0.5 0.2 whatever you want just play around with it and then from the Finish we are also setting it so we can slide again basically so we can compile and save this and now when we are in play you can see our capsule component out our character and now when I run and when I press slide as you can see it basically changes it to around half height now when we try to slide under the object as you can see we are sliding just fine another thing to note here is if we try to slide and then we are going to get stuck in between like this we are not going to be able to move we are basically just glitching through it so one way to solve this and probably the best way for an actual game is to have some kind of Crouch system where your character can Crouch around and then from side you can either go straight into the Crouch or you can make a detect system going to detect if you can stand up and if not it's going to move you into the Crouch now I don't have a Crouch system we might look into that in the future but that's one of the ways to solve this so I hope you found this helpful if you did leave a like And subscribe it helps out a lot thanks a lot for watching and see you in the next one bye
Info
Channel: That Skye
Views: 3,006
Rating: undefined out of 5
Keywords: Unreal engine, UE5, Tutorial, Learning, Indie game, How to, How to unreal engine, Beginner, Beginner guide, Beginner Tutorial, Camera, Third Person, Camera Work, AAA game, Armor, Parkour, Slide, Sliding, Mirror's Edge, Apex Legends, Fortnite, Call of Duty
Id: 6jeAkhjqDD4
Channel Id: undefined
Length: 7min 44sec (464 seconds)
Published: Mon Dec 11 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.