How to Make a Grappling Hook in Unreal Engine 5 - Very Easy

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
what's up guys welcome to new Unreal Engine 5 tutorial and today I'm going to show you on how to make a simple grappling hook system it's going to be a very easy tutorial to follow so let's get started alright so the first thing that we have to do is go into our character blueprint in my case I'm going to be using the default first person character but of course you can use whatever type of character you have if they're a person versus person whatever okay so the first thing that we're going to do is go into the event graph I'm going to find a space over here now we're gonna say that when I for example left click I will be grappling okay so I'm gonna go ahead and find the left Mouse and basically one I'm gonna be pressing it we're gonna be uh you know creating uh all the line trays and things that we need so I'm gonna go ahead and create a line Trace by Channel this will basically right cast a line into a point I'm Gonna Be Right connected uh right sorry uh from the first person camera so I'm gonna get all your third person camera whatever you have and I'm gonna get the uh location get the world location and plug that into the start and then we're gonna basically get the rotation and again the world rotation and we're gonna get the forward vector and then we're going to multiply this by the value that you want uh like basically the range okay first of all we're going to right click and convert it into float so it's a nice number and now uh this basically whatever distance you want to basically be able to grapple hook in my case I'm going to be like put in like 3 000 something crazy just to have something but you know you will put here whatever you want then I'm gonna basically add um both um vectors so just Ctrl or put this in here then add this one and that that will be the end point I'm Gonna Leave This in default to be able to play the ETC and we're going to do is just drag the written value make a branch so it only does things when it's actually impacting with something I got the out hit I'm going to go ahead and break the result and we're gonna get the impact point right click in it promote variable and this is going to be a variable for the impact point so it's going to be the grab point for example and I'm going to plug this in into true so now we'll basically be creating an invisible right cast it will be getting a point we can use the bug test by putting here a fourth duration to and then press and play then if I left click you can see that it's creating an invisible line well right now it's visible but uh to colliding where we want to basically grapple so that's cool so the next thing that we're going to do is create a new variable which is going to be is grappling it's going to be a Boolean okay and we'll be dragging this in here and we're gonna set it to true because basically we're going to be grappling grappling sorry uh when we have our Point uh selected then we're going to do is say on released we're gonna set it to be false because uh if we stop holding the button we want to stop grappling and there's one more thing to do um I'm just gonna put this a bit more to the left so I have more space okay uh the next thing I'm going to do is set the movement mode of the character movement component to be basically um flying okay it's gonna basically add some things that's going to be making it much more like we're actually grappling through the air or whatever okay so uh now if we hit play nothing really will happen uh even though that basically beef line you can see I'm sliding I'm also going to go ahead and copy this paste this on the released and put this back into instead of walking falling because basically you're gonna be kind of up in the air and when you touch the ground it automatically will switch back into walking it's going to be better if we put it in Falling okay so this is going to be the basically the um grappling mechanic mechanic there we go I guess but a nice color there we go so it's gonna be our greatly mechanic now we need to basically create a cable that will uh go from our starting point into the end point from our gun into the you know point that we have over here and then add some Force to go into that direction so I'm gonna go ahead and go down here and add an event tick because we wanted a bit in every frame so the first thing I want to do is make a branch I'm going to basically make sure that we are grabbing so just go ahead get it and then there we go so we will need to create a cable component so go into the viewports go into the first person camera or whatever camera you have uh now if you want to start it from the gun just add it into the mesh or whatever in my case I included in the camera and then you search for cable and then we have the cable component you can see so uh basically I'm gonna make it so that it basically starts um kind of when where he would be holding the gun so I guess it would be kind of here okay just I'm gonna do it quickly for now but yeah and then anything like to do is the number of segments I'm going to put it into one so that it will be more um it won't be such as baggy okay and then we're gonna go ahead and search visibility and turn it off by Depots because they started We're Not Gonna Be grappling okay so now we're gonna go into the bench graph and on here we're gonna get the up here actually after we set the movement mode and in cable I'm gonna set visibility um we're gonna set it to true so we can basically see it here we go copy I'm gonna go up into here where we start grappling and then this is gonna be false so we're going to disable the cable now on here we're going to do is yo it's basically um put the cables and location into the point that we have impacted with the right cast so we're gonna get the cable I'm gonna set um and I will set and location so we have to pass our end location here now we could just get the grab point and just plug it over here but the direction of where the forward is facing it will be wrong so we will have some uh artifacts uh sometimes so what we can do is instead of doing that we can we'll get again the grab point but we're gonna go ahead and inverse B transform location of this one and then this will be the get actor transform or place basically now we'll plug this into the end location and we'll have a nice cable and then the next thing I'm going to do well we can test this out uh so now you can see that if I press play and I hold you can see that I have a cable being applied now you can see that when I move it disables well now disable to just basically uh on top of me well I cannot see it basically um so I'm gonna be adding some Force so we can go into that direction of the cable so just go ahead and you can add force and it's going to be from the uh where is it what is it uh the character movement component and okay so we need to find this Force so the first thing that we need is to find the direction so just get the graph point and we're gonna get unit Direction so it's going to be from we're gonna control and put it into two it's gonna be two the graph point but from the guest actor location so where we are basically current at currently at uh then I'm gonna add this into or get move right left okay and then we are gonna plug this into uh another times value okay there you go and it's gonna be down and then we're gonna get the actor right Vector I'm gonna plug that on top of here and then we're gonna times this again by a certain number which we're gonna right click convert it into a float and I decided that this is going to be kind of 0.7 basically small value then we can plug it on here where we add it and the next thing we can do is normalize so there you go and then we can go ahead and times it by A Great Value right click convert this event to float now this is what type of value you have you want to basically apply the force it's going to be kind of how fast it will go into that point now are we putting something that is 250 000 um and then just plug that into Force all right and now we can basically test it out so I have changed map because this one just looks a bit cooler and if I go ahead and press play you can see that I can go ahead and grapple into these columns and it looks really really cool and really amazing you can go ahead and experiment a toe with uh how basically you would like to do it and by J in the force on top so yeah guys that was a tutorial and in general how helpful I will appreciate if you like the video and subscribe to my channel I have lots of Unreal Engine 5 tutorials as this one so if you want to check the outer score now yes without said bye bye [Music]
Info
Channel: Gorka Games
Views: 24,887
Rating: undefined out of 5
Keywords: games, videojuegos, unreal engine, unreal engine 5, ue5, grappling hook, tutorial, quixel, megascans, unreal engine tutorial, grappling hook unreal engine, ue5 grappling hook, ue5 grappling hook system tutorial, ue5 simple grappling hook, unreal engine grappling system, unreal engine how to easily make a grappling system, unreal engine 5 easy grappling tutorial, ue5 tutorial grappling hook, how to make grappling system in ue5, ue5 grapple hook
Id: 4SHDo8qkoco
Channel Id: undefined
Length: 10min 2sec (602 seconds)
Published: Mon Oct 31 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.