8 Way Directional Movement - Unreal Engine 5 Tutorial

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello in this video we're going to go over how to create an 8-directional Locomotion system so our character will be able to move in eight different directions in this tutorial I'm going to be starting from the third person template but if you have your own character with their own custom animations the tutorial is going to be the exact same process I'm just using a different character to get started we're first going to import The Locomotion animations that we're going to make our character do attach in the description of this video they're going to be some Locomotion animations that you can download if you want to follow along make sure to download them then just select all of these animations and just drag and import them into this folder for the skeleton make sure to select the SK mannequin these animations will only work with the Unreal Engine 5 mannequin then just go import or to import the animations the next thing we're going to do is create a animation blend space which will control The Locomotion animation that our character does to create this we can just right click and go animation and just select blend space for the skeleton select the SK mannequin and just call this The Locomotion blend space open this up and we just want to go to asset details and go over to the horizontal axis and give this a name of Direction for the minimum value make this minus 180 and for the max value make this 180 and pull the grid divisions make this eight then go over to the vertical axis and give this a name of speed so the idea here is depending on our character's speed and their direction will depend on the animation that we make them play when our character has a speed deserve we're just going to make them play that auto animation so if you go to the asset browser and look for your character's Auto animation and just drag and place this where it says zero and just place this eight times along the bottom here so I'm just going to do that now okay so when our character has a speed of 100 and depending on that direction which goes from a value of minus 180 to 180 we're going to make them play a certain animation when our character has a direction of zero we're just going to make them play their running forward animation so if we just look for our characters I think it's cool yeah run forward and just place it in the center here next if you look for your characters run right forward animation and just place this here then look for your character's run right animation and just place this here then look for your characters run right back animation so running backwards and towards the right and then look for your characters run back animation and just place this here then we're going to do the opposite or the left side so we're going to look for our characters run left forward animation then we'll look for their running left animation then we want that running backwards and towards the left animation and then we want the running back animation if you just press the control button you'll be able to preview what animation your character will play depending on their direction and speed so when I place it here my card is running backwards if I place it here then my character is kind of running towards the right and if I place it here my character is running towards the left okay nice we can save this the next thing we're going to do is create an animation blueprint if we just right click and go animation select animation blueprint for the skeleton select the SK mannequin and just go create and we can just call this The Locomotion animation blueprint if we open this up the first thing we want to do is just right click and look for State machine and just connect this into here so this output pose represents the final animation that our character is going to do and we're going to code that inside of here so we just double click and open it up find The Locomotion down space that we made earlier and just connect this into entry then if we just double click and open this up we can see the two names here direction and speed and depending on these values will depend on the animation that our character does if we just right click on this direction One and promote it to a variable then do the same for Speed just right click on it and permit it to a variable so the next thing we need to do is calculate our character's direction and speed to do this if we just go over to the event graph and we want to just drag off this try get Pawn owner this will just get the owner of whatever is using this animation blueprint and we're going to make that be our third person character we just want to drag up here and look for is valid if we can get a valid reference to whatever is using this animator blueprint we're going to get the speed of it so to do that we can just drag off here and look for get velocity then from here we can drag off and look for Vector net and this will tell us the speed of whatever is using this animation blueprint we can just drag this in and look for set speed and connect enter here and is valid into here so this will basically update every second of our animation then to calculate the direction we can just drag in the direction set it then we just want to drag off this um get velocity and look for the calculate Direction so here it is so this also needs our character's rotation to get this we can just drag off here and look for get actor rotation and connect this into here then just click let's return that into Direction add this into here we can then go compile we can then close this and if we just go over to our third person character and to the viewport I'm just going to select them and I'm going to change them from using the um default animation blueprint to The Locomotion animation blueprint that we made earlier and one more thing if we just go to character movement go to the details and look for rotation and just uncheck Orient rotation to movement when we have this checked this will kind of mess with the I'm calculating of the direction because with this checked our character will kind of rotate to wherever we kind of make them move so we want this unchecked when we're making this Locomotion system we can just compile this and test this out so if I go play I can move my character forwards backwards backwards and towards the left backwards and towards the right towards the right towards the left and towards the front left and towards the front right nice so with this we have made an eight directional Locomotion animation system that's all for this video If you enjoyed like And subscribe and I'll see you guys in the next one also let me know any more other tutorial ideas that you want me to make down in the comments
Info
Channel: Unreal University
Views: 28,706
Rating: undefined out of 5
Keywords: unreal engine, ue5, unreal engine 5, 8 way locomotion ue5, 8 way locomotion, unreal engine 8 way locomotion, locomotion, directional movement, unreal engine directional movement, unreal engine direct, uisco, unreal engine 5 tutorial
Id: P2X4luGMxDA
Channel Id: undefined
Length: 6min 50sec (410 seconds)
Published: Sun Sep 24 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.