UE5.2 Enhance Input 8 Way ROOT MOTION Locomotion Tutorial Part. 1 - (Walking & Running)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
Hi guys, welcome to part one of the enhanced input  root motion tutorial Series today we're going to   add in our walking and running we're going to  set up our blend space our animation blueprint   as well as go ahead and add in a  walk run toggle while we're at it   so without further Ado let's  go ahead and get into it so first things first go ahead and open  up our third person character blueprint and then we're going to go ahead  and create an animation blueprint I'm just naming this so I know what it  is you can name it whatever you want   to name yours let's go ahead and make a  blend space as well while we're in here save those now let's go ahead and in third person  character folder we're going to create   a new folder and name it animations let's go  ahead and just import our animations real quick those are going to be pin comment down below you  can download those if you did the previous root   motion um tutorial Series without the enhanced  input we're going to be using the same animations all right we're going to pick our SK  mannequin underscore skeleton this is our ee4   animations are for so that's what  we're going to use and import all those out and go ahead and highlight all  those we're going to go to asset actions   down to bulk edit via property Matrix we're  going to go to where it says root motion and   we're going to go to the box for enable root  motion and check that go ahead and click down   here save selected so it saves all that that's  going to enable our remote on our animations and let's go ahead and open up our blend  space we'll go back to our blueprints folder in space drop the horizontal axis and vertical  axis under your access settings over here down   horizontal axis or name two side input set minimum access to negative  two maximum axis to positive two   and click on Snap to grid and vertical  axis we're going to do forward input and that's going to be the same negative two   and two and snap to grid so basically this sets  this up our forward input is going to be up and   down on our graph and our side input is  going to be left and right on our graph   on our graph so let's go ahead and drag these  in we'll start with the idle in the middle run backwards we'll go all the way down to the  bottom we're going to run back to the left we'll   go in the bottom left corner run back right bottom  right run forward we'll go all the way to the top   forward left top left forward right top  right run left all the way to the middle left   run right to the middle right walk backward  we're gonna go right behind our idle in   between our idle and our run backward  backward left same thing right same thing   or forward in between our run and our  idle forward left same thing as backward   forward right same thing right side and then  walk left in between our run left and our idle   and our walk right in between our run right and  our idle so you should have basically diamond   Square diamond and a square I'll go  ahead and click the names just so you can see those so if you hold Ctrl and move your mouse  it's going to go through your animations um and then I always like to add smoothing time and switch this over to cubic and play around with these and see what  works best with you for your animations   all the every animation pack is going to  be different with these being for miximo   it's kind of the best that we're gonna get it go ahead and save that and we're going to close  that out we're not going to need that anymore so let's go ahead and go to our BP third person  character blueprint let's go ahead and move this   jump input down we're going to stretch this out  let's go ahead and disconnect this get rid of that like this for that   we're gonna get rid of control rotations and  get right forward vector get rid of those so from our leftover action value  um a reroute node here we're just   going to right click that promote that to  variable we're going to call that side input go ahead and connect this here [Music] and then same thing with our  action value y we're going to   promote that to a variable we're  going to call that forward input stretch that over here and we're going to  set that on the forward backwards section and go ahead and duplicate both of those if you haven't figured it out when you duplicate  um you use Ctrl D to duplicate but it's going to   duplicate wherever your mouse is at so just put  your mouse where you want to duplicate them and   it makes it a little bit easier that way it's not  being duplicated right on top of it or next to   it we're going to go ahead and connect those  to our completed on our input action IA move okay and then we're going to  connect our Set Side input to   our scale value on our add movement for  Left Right same thing with the forward and then let's open our animation  blueprint rename that the ABP   let's go ahead and open that up and we're going  to grab that fun space BS and we will set up State   machines and stuff later we're just going to go  ahead and drag this stuff in make sure that it's   all working right now as you see we don't have  any variables for our side input and forward   input we're not going to create those variables  here we're going to go into our event graph okay we're going to right  click and create a blueprint create in in play bent blueprint   begin play we're going to go ahead and move  this try get Pawn owner up here there's that as to BP underscore third person character  we're going to connect that get tripod owner to the object pin and we're going to go  ahead and right click the as BP third   person character promote that to a variable  and I'm going to call this character reference okay and then from our event blueprint animation  update go ahead and actually no let's just go   ahead and get our character reference I'm gonna  right click on the pen convert to valid get   that's basically going to give us a as valid node  but it's specifically for our character reference and so from the character reference we're  going to drag off we're going to get side input   drag in get forward input and then we're going  to promote each one of those to a variable   straighten those up that two variable [Music] and then we're going to promote  this to a variable as well go ahead and compile and Save and let's go back  to our anagraph we're going to drag the side   input to the side input pin same thing with the  forward input go ahead and compile and save that   go ahead and then close out your animation  blueprint and we're going to reopen that   once you reopen that you'll have the details  over here on the side root motion mode you're   just going to switch that to root motion  from everything compile and save that again and file and save our third person blueprint   we need to change our mesh so on our mesh  and our third person character blueprint   we're going to go over here to the  mesh grab the drop down SK mannequin   we're going to switch our animation class switch  that to our animation blueprint we just made so   mine's going to be ABP EI tutorial we're going  to compile that let's go to the viewport make   sure that that's working that looks good let's go  ahead and play so now we're set up for our walking you know and as as I said in my previous uh  tutorial without the enhanced input I would   definitely recommend changing the animations  I just want to give you guys the base for it   to be set up all you got to do is go in and  put your own animations in and then figure   out your uh how you want to blend those  and stuff to make those look better but   so far we're at the point now where we've got  walking implemented it is working correctly   we are going to go ahead and add in the  toggle Walk and Run um so we can get our   run set up as well so we're gonna go back into  our event graph of our BP third person character and we're gonna add a branch before our Set Side   input so hold B and click that's  going to create a branch for you go ahead and connect that remove these ones  connected to the completed down out of the way   so the reason that we did this um and this was  actually the issue that I couldn't figure out   this is what I couldn't figure out was I was able  to basically do the same setup we're basically   doing the same setup as we did uh without  enhanced input it's just a little bit different   um but the completed is going to reset us back  into zero for movement for us to go back into idle   the issue I was having was I could not get  the character to stop moving the character   was just continuously moving in the direction  that I pushed for the movement uh so something   this simple is what I couldn't I just couldn't  figure it out for the life of me and uh just   happened to stumble across it you know thought  well what if I try this and see what this does   so a lot of times if you run into an issue just  try things out until you find something that works   you'll be surprised sometimes how how easy of  a fix something actually is since so now that   we have that branch in there we're going to go  down to our variables we're going to create a new   variable um this is going to be a Boolean variable  you can call it is running with a question mark   we're gonna go ahead and drag that  into our condition for our branch now we're going to set up our input for our  toggle Walk and Run so we're going to go to   our input folder we're gonna go to actions um you  can actually just duplicate your IA jump so Ctrl d   rename that to IA toggle walk let's go ahead  and open that up you can leave that set as bull   and our triggers go ahead and hit your plus we're  going to set our trigger to pressed save that okay and then we're going to go back to our input  folder we're going to go to our IMC default this   is our our actual controller where we add our our  mappings at now so you got your mappings as you   see it's basically the same way it was before  it's just now in the controller instead of in   your actual project settings um so we're gonna  hit the plus to add a mapping now we've already   got our mapping set up all we've got to do is just  go down to our IA toggle walk and then we're going   to pick our key so click on your keyboard icon  here and left alt that's what you want to use   um you can use that or just use whatever key you  want to use save that and go ahead and close that pile we're going to air next to  her jump right click IA toggle walk we're gonna go ahead and add a branch off of our trigger drag to our branch I'm  going to grab that is running variable get that   drag off of that we're going to add a not Boolean plug that into our Branch condition we're then going to get our is running if you  drag that and hold it and then go ahead and   click on your alt and then let go  that's going to go ahead and set it   we're going to duplicate that once one into  true one in defaults and then our our true   we're going to go ahead and click that set  it to set it true highlight all those hit C   go ahead and comment this is toggle walk okay and  now what I was trying to show in the last series   but uh OBS wasn't working with me right now if you  click on one of these go to the comment color and   you drag off of your color into here that's going  to store that color for you to use now you can add   quite a few colors in there so now we can click  on this one go to our comment color click this box   now it just looks a little bit better and I  always do show bubble on zoom on stuff like   this that way I just know where it's at all right  so then we're going to go into our movement input drag this back a little bit room off of our Falls we're going to go ahead  and grab both of these and duplicate those cleaned up a little bit here double click here send another reroute node from  our y value we're going to drag down into our   forward input and then from this route node  we're going to drag down into our side input all right and then we're going  to disconnect this side input and we're going to drag off and add multiply we're going to set our multiply value to 2. and  from our reroute node we're going to drag off into   the top of our multiply so what we're doing here  is we're telling the engine that we're now going   to move up to two because in our blend space we  set back run speed was negative two forward run   speed was two um run speed left was negative two  run speed right was two on our side input let's   go ahead and save that file and save and let's go  ahead and check that out should start and walking so we're still walking forward   check left and right left and right okay  so our side input is working correctly so now we're going to do the same thing on our  forward input let's go ahead and disconnect this   drag this reroute node back we're just going to  go ahead and copy this multiply paste it over here   add to the forward input and  this to our top file and Save it oh all right so now our running is working and  our toggle walk around is working as well   all right so let's go back into our BP third  person character and we're going to click on our   character movement underneath our components  here and we're going to type in rotation   click on use controller desired  rotation click file and Save now we can still look around the character the camera's moving with the character  and we may set up the camera lock that   I have set up in the previous version  if you guys would like to do that let   me know in the comments please right  now I don't have any plans to do that   but if there is interest in that people want me  to add that in as well so I can show you how we   do that with uh enhanced input I can figure  that out I don't know if we really need to   change anything so it may be pretty simple for us  to do other than that you know we're set up now so appreciate all the support hope this helped you   guys get set up for enhanced input  for root motion for your project I'll see you guys in the next video peace
Info
Channel: Torchlight Studios
Views: 22,845
Rating: undefined out of 5
Keywords: UE5, Unreal, Unreal Engine, UE5.1, Root Motion, Indie Development, Indie Dev, UE5.2, Enhanced Input, 8 Directional, Locomotion, tutorial
Id: qvGGBVBDWvc
Channel Id: undefined
Length: 22min 23sec (1343 seconds)
Published: Thu Jun 15 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.