How To Create First Person Animations - Unreal Engine 5.4 Tutorial

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
what's up guys mizo frizzo here and in this Unreal Engine 5.4 tutorial I'm going to show you how to use sequencer to create firstperson animations right here in engine I'm going to show you how to set up animations for a uh traditional firstperson character where the arms are parented to the camera I'm also going to show you how to set up uh sequencer for creating animations for a true firstperson character and how that works I'm going to give you a few tips and tricks on using sequencer for animation I'm also going to show you how to rig your weapons so that you can create firstperson animations that include animations on the gun itself and as kind of a bonus I'm going to run through how to alter existing animations to tidy them up in sequencer so that they you know for example you have an an where you're reloading the gun and the hands aren't quite in the right position for you know pulling out the magazine or something like that I'm going to show you how to alter those animations and clean them up a little bit but just before we get started guys a word from my sponsor as per usual guys this Unreal Engine 5 tutorial is brought to you by you my generous subscribers and viewers who have been so supportive over the past 12 months or so if you find this video to be of any use or value whatsoever please hit like And subscribe and if you're so inclined please do consider making a small donation to the channel via my patreon link is in the description or via YouTube using the thanks button just below the video there now just FYI guys being a patreon member does not currently give you any added benefits it's it's just a way of helping you to make your donations to the channel to help keep me going and making more quality tutorials for you guys but just FYI I am working on setting up a Discord server where membership of my patreon will give you access to my Discord server and hopefully we'll have that set up in the next month or so so without further Ado guys let me show you how to do this all righty guys I'm going to create a new project using the third person template leave everything as default and hit create okay and for the record guys I'm using Unreal Engine 5.4 so any small changes that come up because of Unreal Engine 5.4 uh we should be able to work through those together so the first thing I'm going to do is add the firsters uh content pack so I'm going to click add and add feature content or pack and add the firsters content pack to the project I'll hit add to project and you'll know this is added to your project because you'll see a couple of new folders down here namely first person and first person arms so I can close that um but just before we jump into the setup of the firstperson character and a potential uh true firstperson character I'm going to run you through uh sequencer how to access sequencer and how to start working with it so as per usual I'm going to use this little corner of the map down here is my kind of Animation studio now there's a couple of ways that you can open up sequencer and create a new level sequence uh one of which being dropping a control rig into the world so if I go to characters mannequins and rigs you'll see this control rig mannequin body right here this is the control rig for Manny and if I click and drag this out into the world this might take a second uh if I drop this here it will assume that I'm wanting to create an anim and it will open up sequencer right here with the control rig manne and body already added into sequencer right here now this isn't the only way that you can open sequencer for example if I just delete the control rig from this level sequence here you can see we've still got it in the world here so if I find this in the world outliner here control rig Manic and body and I drag this into sequencer you'll see that it's added it into sequencer right here so you can just find any objects that you want to add into your sequence and drag them from the outliner into the sequencer you can also if I delete this and I close sequencer here and I click up here I can add a level sequence right here it will ask you to save it somewhere so this is the one that was automatically created right there when we uh uh drag and dropped the control rig mannequin into the world um so I'm just going to create another one here new level sequence and then obviously this has nothing in it so you would have to find your mannequin and add it to sequencer right there um and these will save like any other asset so if I go back out to the content folder here you can see the level sequences here and you know you can open those up and it will open up the sequencer right there so you can see this is the one where we deleted the control rig from the sequencer but if we go back to new level sequence this one will it right here so um using these assets as kind of templates is a very handy way of sort of transferring poses to other animations so I might show you a little bit about that later on but basically you know if I have like an idle pose and I then wanted to um do an aim down sights pose that transitions you know to that aim down sights pose from the idle pose I might duplicate my idle pose and then open it up and then start making changes to that one um that's just that's just a handy little tip I'm just going to delete that one and I'll also delete this CR mannequin body take one and we'll just work with this one here nice okay so sequencer is this tool that you can see down here it is a very very powerful Tool uh that can be used to key frame animations on control rigs so skeletal meshes or other actors in the world to create animations or cinematics um so we've got our control rig mannequin right here and basically the control rig are these circles and boxes and arrows and shapes that you can see around the skeletal mesh here and these are just a way basically of manipulating the body for an animation um the first thing I want to look at with you is switching on the ik for the arms because if I switch this to the move widget and I move this hand you'll see that it's going to deform the body just going to hit contrl Z and undo that so FK is basically really only good for rotation of Bones and if you're doing stuff with the hands ik can be much more useful um and much faster to iterate and work with so how we switch on ik for the arms is if we scroll to the top here in sequencer and look under the control rig mannequin body just drop this down if you don't if you haven't already and you'll see the first one here is global control you can drop that down as well and down here you'll find arm L FK ik switch and arm R FK ik switch if you check both of these you'll see that it's removed this FK from around the shoulders and the elbows and the wrists and it's replaced it with this box around the wrist right here and if I grab this box and I move it around you'll see it's no longer deforming the mesh so terribly it is using ik to position the hands and the elbows like so so you can you know start working with the hands and anim the hands without having to worry about deforming the mesh all righty so couple of things to point out about uh sequencer here and this little animation tab that pops up when you open sequencer there's a couple of Handy um handy functions in here you can for example hide control shapes so if your control shapes are getting in the way a little bit distracting and you want to you know check out your animation you can hide control shapes and and the other one that I like to use is only select rigged controls so if you select this one you know you're not going to select the the um the mesh itself or the level behind it you will only be able to select the rig controls so only select rig controls I find is quite handy and to be honest I usually just check this one and then close this tab because it takes up a bit too much real estate for my liking um nice so let's have a look at doing a first person animation so firstly um we're going to look at animating the first person arms that come in the first person template okay so if I go into my firstperson folder and blueprints and open BP firstperson character let's just have a look at the setup in here going to go to the viewport and you'll see that the firsters mesh the arms are parented to the firstperson camera so wherever the firstperson camera goes the arms go um and this is how you create that kind of uh traditional firstperson look where the arms just you know follow the camera when you look up and down you run around um it makes animation very very simple so um so we're just going to have a look at the setup in here so first person mesh is parented to the first person camera and the position here the relative location of the firsters mesh is -3 0 and Ne well let's just make this 150 for sake of ease and we are now going to basically copy this setup in our sequencer setup so that we're ready to animate These Arms um you know where they are right now I'm actually going to change this location to minus 10 just so um-5 so they're not so so far back from the camera uh so we don't need to reach out as far the other thing I want you to note about this setup in the firstperson template is that the rotation on the arms is set to zero here whereas usually the rotation on a mesh will be set to NE 90 and basically as far as I can tell here uh the only reason that this is different is they've kind of forgot to change the alignment of the character before they've done all the animations that come in the first person template so if we set this up exactly like this in sequencer and we apply the animation here you'll see what I'm talking about so I'm going to go ahead and set up my arms to be at -15 0 and -150 50 relative to the camera so I am going to add a camera first so I'm going to click here and search camera and find a camera actor I'm going to drag it into the world and I'm just going to place it about here it doesn't matter too much and then I am going to and the reason I'm using the third person character here is because there's no control rig on the first person mesh but we can replace the Skeleton on the animation so I'm going to find the control rig here and I'm going to drag it onto the camera actor and now that it's parented to the camera actor what I can do is change the location to -15 0 and -150 and if you have a look at the position of the arms there you'll see it's pretty much EX it will be exactly the same as the position of the arms here so I'm going to create a very basic animation very quick and show you how to apply these to the first person arms um but first we need to set it up so that we can actually see from the camera's perspective because uh obviously that's what matters in a firstperson animation so I'm going to click these three little lines up here and go to layouts and I'm going to select this two panes side by side layout and then up here where it says top I can drop this down and select the camera actor that we created and if it says real time off here you want to click this and it should disappear because real time has been switched on you want real time switched on and just be careful that you don't uh you know try to move this pane right here and move the camera it shouldn't matter uh because the character is parented to the camera it doesn't matter in this instance so you can move this it doesn't matter too much um but I'm just going to leave it whoops edit LZ what did I edit there I thought it would uh undo the movement of this pane but it hasn't so just leave this B and what I'm going to do now is go back to my sequencer and I'm going to change a few initial settings here just to make animating a little bit easier so the main one that I want to switch on is this create a key when channels properties change only automatically adds a key when there's already a track and at least one key so see how it says it only works if there's already a track with at least one key right so if I switch this on it won't actually add any automatic key frames on whatever I move unless there's already a key frame on it so what I like to do when I first open up sequencer is switch this on and then I'm going to add a key frame on the mannequin body and if this is dropped down you will see that it's added a key frame for every component of the control rig so now whatever I move it will it will add a key frame to that so I'm going to turn off grid snapping and rotation snapping right here and I'm just going to move the hands up in front of the camera like so you know momento P for four and now is a good time to mention Global space and object space so right here where the widget is sort of aligned with the world you can see up here we've got this little globe and this is um because it's uh see it uh transform Gizmo coordinate system between world and local so this is in World space right now it's aligned with the world uh but when I'm manipulating the hands especially with regards to rotation I prefer to change this to object space so this now aligns the widget with the actual object that you're manipulating and when you're doing fingers and stuff like that you don't really want this to be on global space because if this is on global space I am now bending fingers sort of out of shape you know that's not bending over in line with the bones of the finger I will undo that and change this to object space and and now you can see you can manipulate fingers more naturally and if you want to go sort of off AIS you can do so in small amounts you know if it's required to achieve what you're trying to achieve um so with the hands and the fingers especially I I like to sometimes use object space very very handy um so I'm just going to and this is independent of the transform widget and the rotation widget so you can see here the transform widget I will switch it to uh worldspace and if I change to my rotation widget oh no it is now transferring over so that is one small difference that I've just found with Unreal Engine 5.4 in previous versions uh it would be independent this change right here would be independent of which Gizmo you're using so I would be able to leave my transform widget on worldspace and this one on object space but it is now changing for both okay so I'm going to bring this up in front of the camera like so and this finger I'm just going to fix that because that is really annoying me there we go so with his hands up in front of him like so I'm just going to create a very simple animation that we can apply to the first person arms um what I might do is change this to 60 frames I will change this to 60 frames it's another one of the things I'll do when I open up sequencer automatic key framing key frame everything on the mannequin and then uh change the frames to 60 because 30 is pretty old school all righty especially when it's first person animations you know if it's a cinematic then 30 for objects that aren't very close might be okay um all righty so what I'm going to do with automatic key framing switch on and everything key framed on the initial frame I'm going to move this to 60 frames and then I am going to with this on world space I'm going to select the ik for the hands and I'm just going to move them sorry just fighting with the camera a little bit here I'm just going to move them up a little bit and out a little bit and the same with this one up a little bit and out a little bit and if you look here under the 60 frame Mark you'll see that it's created a couple of key frames for the hand R ik and the Hand L ik right here so this is a very quick way to identify where they are on the list here you can see it's created two key frames for the hand L and the Hand r i and what I want to do now is make them return to their initial position so that's this key frame here I can click this one and then control click this other one and then contrl C to copy I can go to 120 frames crl + V to paste and if we grab this slider now you'll see that it's moved up and out to where I plac them and then back to the original position I can now grab all four of these key frames crl + C to copy go to 180 frames crl V to paste and then this red line here is where you want your animation sequence to end so I'm going to make it 24 frames so at 60 frames per second 240 frames is a 4 second animation it's just going up and back in twice over the course of 4 seconds and that's my animation if you're if you need to you know view things in finer detail you've got a couple of options down here so this is obviously how much um scale you want to view here and if you need to make make it longer or shorter you've got a couple of things that you can so this is what I was just playing with there these inside numbers right here and then these outside ones are how far you want to be able to look so this is kind of the extreme you know you can drag this out if I really want my animation to be able to go a lot further um so obviously I'm not going to be going before zero so that's why this is at about -30 by default and we obviously we don't need that way out there okay so now we can bake this animation um into a animation sequence so I can scroll up to the top and I can right click on the root of the control rig mannequin body here and I can find bake animation sequence and I'm just going to put this in the content folder and I'm just going to call it um I'm just going to call it mannequin idle sequence or idle mannequin sequence there we go and hit okay we can leave this as default and Export to animation sequence and now if we go to our content folder we can find that animation sequence right here and there we've created an animation sequence on that skeletal mesh now I'm going to replace the skeleton of this one so just out of you know force of habit what I might like to do is duplicate this one and do it to the duplicate because you know I might want to keep this one keep this one there so I might rename this one you know third person idle sequence and this one will be first person idle sequence or something like that but I'm just going to right click on this one and replace skeleton and the skeleton I'm going to replace it with is the SK mannequin arms skeleton like so and now if I open that up you'll see that if I hit play it works perfectly fine on the first person arms like so nice so if I go to my BP firstperson character here and change the animation mode to use animation asset and I find my idle mannequin sequence one you'll see that it's rotated 90° like this and this this is what I was talking about so all the animations that come with the firstperson template are kind of twisting the skeleton 90° um but obviously if you're going to be making all of your own animations you don't want to have to do that you just want to turn your character 90° like so and with this on use animation asset um and this asset selected you can very quickly see this animation at play um I'm just going to click this button right here just restores The View port to this View and if you want to go back or you want to focus on this window you can do that so you can just click this button here to cycle between your your layout setups um what I'm going to do is go to the world outliner and the game mode override and I'm just going to override the game mode and select the BP firstperson game mode and now if I hit play you'll see that my character has this animation that we've created like so nice so that is how to create a firstperson animation um using a traditional firstperson character that just has the arms uh let's have a look at true first person so there isn't that much difference with true first person other than the um you know the camera is not going to be the parent of the body it's going to be the other way around the camera is going to be parented to the body so let's say I I'm just going to click and drag this CR mannequin onto the camera actor to unparent that and then I'm going to press end and drop it to the floor like so and I might just move it out from the wall a little bit here um so basically your true firstperson character your camera will be parented to the mesh and it will be attached to a bone uh maybe the head or one of the neck bones and you will just need to copy the orientation of that so if I grab my camera here and I drag it onto the mesh and it will automatically drop down with a list of parent sockets let's say I want to parent It To The Head And then I want to go to the details panel and change the relative location and rotation of my camera here I'm not going to touch rotation cuz it's already correct I'm just going to zero out the location of the camera and now that is attached directly to the headbone but let's say in your character you've changed this relative location to something like 8 and 12 or um I think six and maybe 14 is about bang on with where the eyes are so whatever your setup is in your characters blueprint you want to copy that right here and uh and and that's it if I bring up the two Paine view again um you'll see the hands have dropped out of view here because they were they were right in front of the camera for traditional first person but if you wanted to make a true firstperson setup and animate them this is how you would do it it's just a matter of making this setup with the um control rig and the camera exactly how it is in your character so if I placed the camera here uh for the third person character um and I created an animation sequence here with the exact same setup here this this would look exactly the same inside that character nice okay the next thing I want to have a look at with you guys is rigging weapons and creating firstperson animations that uh sort of align with you know an animation on a weapon so we are going to head over to the unreal Marketplace and the free asset pack I want you to find is this one military weapon dark there is also a military weapons silver but the main thing is that the skeletons on these weapons are set up so that you can actually use the new modular control rig tool to add controls onto the different bones such as the trigger and the slide and the hammer and whatnot um now I have encountered problems with weapon packs such as the FPS weapons bundle which I usually recommend as a alternative to this one if this one is not free in your country but I have found that setting up controls the different Bones on the skeletons in the FPS weapon bundle uh doesn't work um as easily as it does with these just because of the skeleton hierarchy it hasn't been you know the the modular control rig is is been designed to work on um character meshes not anything like weapons so basically what I'm going to be showing you is a very quick and hacky way to create a control rig of a weapon there are better ways to do this you probably would want to just create a proper control rig but that takes significantly more effort and I'm just like you know we can animate our weapons in this way and as long as it works then that's all that really matters so I'm going to hit add to project and if you can't see your project here just click show all projects select your project and then select the most recent comp compatible version which is probably going to be 4.27 and hit add to project you'll know this has added because you'll see a new folder here military weapons Dark we can go into that one and into weapons and what I'm going to be using is this pistol right here pistols B so I'm first just going to create a new folder and I'm just going to call it pistol and I'm going to grab all of this pistol stuff right here and drag it into that pistol folder move here and now we've got the pistol in this folder here so basically a control rig is something that allows you to um you're rigging the skeleton of that skeletal mesh so that you can manipulate that skeleton for the purposes of Animation so if we open up the skeleton here we can see we've got a trigger bone and this one just slides back and forth like so and the slide bone and the slide bone is what we're going to be messing with today which just going to create a nice little animation where he checks the chamber for ammo right here there is one annoying thing here which is the the ammo in the clip uh the clip bone right here is you know showing in the chamber like so in reality this would actually sit more sort of down here and when the slide comes back it would feed that round from the top of the clip into the chamber here and it would be aligned with the barrel now if I wanted to be really precise with this animation where our character pulls the slide back to check the chamber I might get a static mesh of one round and attach it to this skeleton right here attach it right here in the chamber so that when he pulls it back you can see that round in there but we're not going to be doing anything like that today I just want to show you how the animation works so we can close this skeleton and what we're going to do is right click in our pistol folder here and we're going to find animation control rig and create a new control rig and we're going to be using the modular rig that is new to 5.4 right here the modular rig so we can hit create and I'm just going to call it pistol uh crore pistol and open this up and for some reason the compiler results comes up here we can just close that uh the first thing we want to do is add the skeleton here so we can go to preview scene right here and under preview mesh we can find our pistols B pistols B skeletal mesh and add that as a preview mesh right here now as I said um I'm not going to be showing you U any advanced control rigging here I'm just going to show you a very quick and hacky way of adding controls to the bones that we want to use so um down here you've got the root the root bone here and the first thing I'm going to do is right click on it and go new new module and I'm going to just add a control I'm not going to use any of these because these are kind of set up to work on a character as you know it's kind of self-explanatory they're set up for arms and fingers and legs and whatnot I'm just going to add a control and the control right here I am going to put it on the grip bone so this is going to be our kind of root right here um and if we go to the details panel we can have a look at the control settings right here and we can change the we can change the offset so we can move the offset and I generally don't like to have this one sticking out the front of the grip because when you're wrapping your character's fingers around the grip can get in the way a little bit so I might move it back here and I might also just move it up a little bit and let's see if we can change the size uh so we can lock the scale here and make this say 0.6 and that's fine like that so if we grab this control now and we move it around you'll see that it moves the entire uh pistol around so this is kind of our our root control right here and then what we can do is we can right click on the rout again actually yes we'll right click on the route again and go new module and add control and then this time we should be able to select some children of the grip bone and this is where the problematic uh skeleton hierarchy comes into play with some other weapons this may not work like this for your weapon and you may just need to um fiddle around with your setup here to try and add controls to the different bones um so I'm going to add one to the trigger bone socket right here like so and immediately I'm going to change the scale something like 0.5 0.4 and I might even unlock the scale here and I might make this control a little bit of an oval shape like so so it sort of sticks out the sides a little bit um I've done it the wrong way around here hold on this is what I meant so that it's just sticking out the side of the weapon a little bit might even make that 0.5 and then the offset I will just move it up and now we have a control on the trigger like so so we can control our trigger let's do a couple more so we'll right click again on the rout and new module add control and let's make this one the slide bone again we can fiddle around with the scale here and the offset and since we're going to be grabbing the weapon you know back here most of the time or over the top um what I might do is offset this one uh sort of down into the slide like so that's where my slide control will be and we have a control on the slide nice um let's add one more just for funsies add new module add control and this one can go on the clip bone um so this will be a control on the clip or magazine make this 0.5 and drop it maybe down here onto the front of the clip and then we have a control on the magazine nice all righty that's pretty much it guys you can go into the nitty-gritty and mess around with um you know you could change the colors of the shapes so you can denote them a little bit easier um but I did not see so it says this item has been created procedurally so it doesn't allow you to change it here but there are there is a way of changing the shape shape visible shape properties color I did find a way of changing the color but uh it seems to have escaped me right now but that's okay we've got controls on these bones and that's all we really needed so I'm going to compile and save and close this and now let's do it on our first person character so we're going to need a socket so I'm very quickly going to create a socket uh by browsing to the skeletal mesh of the arms here and opening up the arms skeleton and I'm just going to go to my right hand right click add a socket then right click on the socket add a preview asset and add my pistols B and put it more or less into the r position not going to fiddle around too much with this I am just going to put it more or less into the right position so it looks relatively natural nice that'll do and now let's create an animation so again uh however it's set up in here is how you want to set it up in sequence so what we're going to do in the first person character is I'm just going to add a skeletal mesh component call it gun drag gun onto first person first person mesh make sure it's parented to first person mesh I can change the skeletal mesh asset to my pistol if I can spell pistol today and change the socket to the hand R socket that we created zero out the location and the rotation and there the pistol's in the right position like so so what we can do is go back to our world and sequencer right here and just to make this a bit less confusing I'm going to undrop down that and I'm going to add that pistol control rig to the level right here so in my pistol folder control rig pistol drag this out drop it in the world and then find it over over here in the world outliner I've got only uh only select rig controls set up so I can't actually click on this so I'm also going to drag it onto the mannequin and I'll get this dropped down and I can choose my hand R socket I cannot because I added it to the first person character um and we're not actually using that character to animate here we do have to use this mannequin they just haven't created did a control rig for the first person arms but the arms are exactly the same as they are in the third person character so I do need to add that socket to my um SK mannequin in the characters mannequins meshes SK mannequin right here and I'm going to change the preview mesh to skm Manny and then I'm going to find the right hand add a socket add the preview asset pistols B get this into the right position sorry about that I did forget that we need to do our animating on the third person character mes that'll do that'll do for now okay so I can save and close that and I'll close that first person skeleton as well and now uh with this pistol dragged onto the CR mannequin body I can now choose that hand R socket and zero out the location and the rotation and then the pistol's in the right position like so nice okay so I'm not going to try and make this animation super super neat and tidy I am basically just showing you an example of a um of two synchronized animations it's going to be an animation on the arms and an animation on the pistol as well so basically going to change this back to my two pane view like so um and I do need to change this set up back to the first person setup so I going to unparent the camera and then I'm going to parent the body to the camera and we made this -5 0 and 150 yep that is right and I'm just going to we don't have the sequence uh from the first person set up anymore CU we kind of just replaced it so I might just um create a very quick idle sequence for the first person mesh so I am going to make sure that this is on frame zero and I'm going to delete all these extra key frames that we created make sure automatic key framing is switched on I'm going to go to frame 60 and just going to create a little idle animation make sure this is on world space move this up a little bit and out a little bit and then copy that original key frame to frame 120 copy both of those to 180 and just got this really basic idle animation so I'm just going to use this this pose as a base for my my animation so I'm going to bake this animation sequence first bake animation sequence and put it in the content folder and I'm just going to call this one idle sequence export and then I'm going to browse to the sequence I'm going to save this sequence and I'm going to browse to it and just check which one we're using here so we're using new level sequence here and I'm going to duplicate that one and I'm going to call this um let's just call it chamber check sequence something like that so this is what I was talking about earlier if you want to use this pose as the you know the base pose for a different animation you can duplicate that so I've duplicated my idle sequence and I'm making this chamber check sequence so I can now open this up and I can delete those extra key frames that we made and now I have a separate um a set separate level sequence with the same starting base pose all righty so as I said this is going to be super super basic um basically let's go to um half a second here and let's at half a second move the hand and the weapon up in a way where we can see sort of into into the chamber so let's just put it and let's put it nice and close to the camera so that we can see this in action and so the first move is he's putting his hand up like that and at the same time he's going to put his left hand up and grab the slide and pull it back actually I might make this a bit more in line with the camera like so he's pulled it up to here and he's going to pull the slide back and and have a look inside so at the same time this hand is going to come up and bear with me here this is going to be a little bit fiddly but I'm not going to do anything with the fingers or anything like that I'm not going to make it look super super you know slick um that is up to you this animation stuff uh it takes it takes a lot you know this is usually uh you know the job of of several people um with lots of time and and money um but I'm just basically showing you how you can do this yourself if this is something that you're interested in making really cool animations for your game which if you're going to be making your own game you do want to have your own animations so just trying to get his hand into the right on that grippy part of the slide there so it at least looks like he's grabbing it with his thumb like so so the first move here is he's gone from the idle pose and he's pulled the pistol up and he's put the hand onto the slide like so and now he's going to pull it back and yeah this is not going to look great but it's going to work so let's have him over the course of another half a second pull it back so I'm going to advance another half a second to the six frame Mark and I'm going to look at where his thumb is here on the slide it's right into that grippy part of the slide right there and we're going to move his hand and we might want to use local space it won't matter too much it is it is going to not look great but that's okay um the slide we can definitely do in object space and we want to slide this straight back and we don't want to slide it too far um let's use this little piece of um this bit of Steel poking out here as kind of a reference we might just pull it back to exactly almost exactly so just a tiny little bit of it it's showing there and this hand obviously needs to come back to the same position let's change that back to Global that's pretty close to where it was I do know that it was clipping through a little bit like so and if we just move this back and forth ah there's a problem here with where we didn't key frame the initial position of the slide so what I'm actually going to do is just bring It Forward again and key frame that so we can just grab this change it to object space and bring it back to where it was and I do just want to check that that's not moving around too much yeah that's that's pretty bang on to where it was that's another thing I forgot you definitely want to key frame where the slide was before you um start to move it and ah it hasn't created a key frame for where it's moving to odd so I just find the slide slide bone ah see the problem here was I did not create a key frame for the control rig um pistol at at the beginning so so as I said earlier when you start you want to change on frame zero you want to add a key frame for the control rig of the pistol so that it has a key frame for everything right there and then we can go to frame 30 and we can key frame just the slide bone there and then we can advance to 60 and we can move this back to about there sorry about that and now we have the hand comes up grabs the slide and pulls it back let's say he releases his thumb so we might just go like so and release his thumb and move his hand away might move it to there and then down down and out that way a little bit so it looks a bit more natural so boom and then pulls it back he's letting go moving his hand away and right here is where we want the slide to start coming forward again and we might want it to happen really really quickly so let's just go forward 15 frames which is a quarter of a second which is it's probably going to be even quicker than that let's put it at let's put it at 70 for now see how that looks um and we can find the slide bone down here and we can just actually just click on that key frame and control C it go to 70 frames and paste it there and now he's pulling it back and when he lets go it's popping back to the front and as he lets go here we might start moving his right hand back to where it was so let's find the right hand and key frame it right hand here key frame that and then let's get the original position and copy that and let's paste it at about 95 frames right here pull the slide back let him go and then his hand goes back and we can have the animation pretty much stop there um might just stop it here at 105 where our left hand returns back down and actually this position right here um I'm going to copy the hand and R ik key frame and I'm going to put it at 105 and then right here I'm just going to have it sort of in the upper position of that idle so that when it comes back it comes back and then it kind of settles down and then it will start back into the idle like so okay so that'll do for our purposes um what we now need to do is bake these animations so you want to use the root and we're going to be baking the animation of the arms and the animation of the pistol so we can right click on the CR mannequin body bake animation sequence and again I know it's not very organized but I am just going to put everything in the content folder um and I'm going to call this um chamber check I'm just going to call it chamber check and hit export animation sequence and I'm also going to right click on the pistol and bake animation sequence and I'm going to call it um pistols B chamber check nice and just to demonstrate these working on a character we're going to do a very quick and hacky setup where we can um just play these animations in tandem on on this character right here so we do need to replace the skeleton of chamber check um so that it's on our arms so I'm going to duplicate that one chamber check one is the one we'll be looking for I'm going to right click and replace skeleton replace the skeleton with the SK mannequin arms skeleton and the um and actually we might make this a Montage so I'm going to right click and create an anim Montage chamber check 1or monage this is the one we'll be using we'll open this up and I'm just going to change the blend in Trigger Time to 0.01 and the blend out Trigger Time 0.01 so make it blend in and out nice and snappy and then on our first person character in the event graph let's make this happen on the r key so when we press the r key what I'm going to do is play an animation Montage on our first person mesh play montage and the Montage we're going to play is the chamber check one and then on our gun we can also play animation and that's going to be our chamber check no it's not it's going to be our pistols chamber check isn't it pistols B chamber check and for this to work we have to switch it back to an animation uh blueprint so we can find our firsters mesh and change to the animation blueprint oh blueprint firsters ANM bpc and we might need to make a change to this let's open up the firsters animation blueprint and we just want to make sure that in the anom graph we have a a slot for our montage and I'm just going to delete this one and make it a default slot slot default slot and I'm also going to go into my base animations right here The Locomotion State machine and I'm just going to get rid of all of these and replace the idle with the idle that I made um idle mannequin sequence one make sure I check Loop animation and just going to open this one up make sure that that's the one um that is not actually the one that we wanted we wanted the one that is this new level sequence uh so idle sequence there we go idle sequence that's the one we need um and I need to replace the Skeleton on that one as well so it be idle sequence one replace skeleton SK mannequin arms and then idle sequence one Loop animation and open this one up double check yes that's the one that we wanted yep so he's doing the animation now and we just need to check that we wrot oh I've crashed the editor so I am going to restart the editor real quick sorry about that guys I crashed the editor some I probably should have been hitting save uh along the way there but uh oh well happens okay so what did we lose here the progress do we have our we don't even have our default slot cool I'm just going to go ahead and set up everything that I just uh showed you guys very very quickly I don't need to walk you through it again and now I've got this animation if I hit R I've got my little animation that I've created it does not look great but uh I mean it it is what it is um with this information I'm hoping you guys can go on and make all sorts of really cool first person animation uh you know such as you know pulling a charge lever and ejecting cartridges or or whatever you want to do you can you can now do it yourself and one last thing I want to show you is how to fix an animation that um that isn't lining up properly between your you know for example your gun and your first person AR so I'm going to show you how to do that very quickly all righty guys for this next part we're going to head head back over to the unreal Marketplace and I want you to find this free asset pack called the animation starter pack it's by epic games themselves you can hit add to project and if you don't see your project here just click show all projects select your project and then select the most recent compatible version which is probably going to be 5.2 and hit add to project you'll know this one is added to your project because you'll see this folder anom starter pack right here and the first thing we're going to need to do is retarget these for the ue5 skeleton so I'm going to right click in here and create a new folder call it ue5 and then I'm going to filter for animation sequence if you don't have this filter here just click this little drop down and find animation animation sequence and filter for animation sequence and then I can click in here and press contrl a to select all of these and um actually I'm not going to I'm not going to do all of them actually I'm actually just going to retarget one for the reload rifle ion sights right here reload rifle iron sights this is the only one that I'm going to look at to uh give you an example so I'm going to right click on this one and retarget animations now for UE 5.4 this is very very easy I just select the uh skeletal mesh that I want to retarget them onto and I'm actually going to retarget them onto Quinn so I'm going to select skm Quinn and I'm going to find my reload rifle Iron Sites and select it and hit export animations and I'm going to put this in my anom starter pack and ue5 folder and hit export and leave this as default hit export and now we've got this little reload animation right here nice so I'm going to go to my world settings and change change the game mode override back to my BP third person game mode and just double check that that's working yep I'm back in my third person game mode and I'm going to add to my third person character so if I just find my third person folder blueprints BP third person character I'm going to add a skeletal mesh to my third person character call it gun make sure it's a parent uh parented to the mesh and I'm going to find the skeletal mesh asset assault rifle B from my military weapons dock um we just need to create a socket for this real quick so I'm going to browse to the skeletal mesh asset here and open up SK mannequin and I'm actually going to change the preview mesh back to Quinn cuz we're using Quinn now and I am going to find the right hand sock it and right click on it remove all attached assets and now I'm going to add a preview asset and it's going to be the assault rifle B like so and that position is actually fine the way it is uh that will do it doesn't matter too much um but what I'm going to do is now play that animation um that we retargeted in an starter pack I'm going to play this on my character and play the reload animation of the rifle on the on the uh rifle at the same time just as we just did with the animations that we created just to show you um how there's a bit of a mismatch going on here so I'm going to right click here and create an a montage I'm going to open that montage and I'm going to change the blend in time to 0.01 the blend out Trigger Time to 0.01 and I'm just going to make sure that we've got a default slot on the animation Montage here so ABP Quinn C which is actually a child of ABP Manny so I'm going to open ABP Manny go to the enm graph and we've got a slot default slot right here so that's fine very good we have that so in our third person character we can find the r key R key and we're going to on the mesh play the Montage that we created reload rifle iron sights montage and on the gun we're going to play animation and the animation we're going to play is I believe it's reload rifle not prone that's the character reload reload rifle hip you know what let's just have a look in the folder so let's go to military weapons Dark weapons enms and we've got fire rifle and we''ve got Rel load rifle iron sights yeah this is the one here so I'm going to close that and with it selected go to the third person character and click this little arrow to assign that animation to that play animation node right there nice and now if I hit play ah I didn't zero out the uh location and rotation of the weapon so in the view point we need to actually attach this to the hand R socket and zero out the location of the rotation so it's attached to the hand like so and now if I hit R you'll see play a little reload animation but if you look at the clip and the left hand it's uh it is designed to work um in tandem with this animation it seems um but it is just not not quite you know the hand is is not quite grabbing around the clip and not following it so we're going to change this animation on the um on the on the skeletal mes of the character to line up more closely to that animation so I'm actually just going to delete this from sequencer and I'll just use this this level sequence here we're not going to go back and use any of the old ones so I'm just going to use this one here um and we do need the control rig for the character here so let's go to characters mannequins Rigs and drag out the control rig like so and let's um let's also grab the skeleton of the weapon uh we don't need a camera here because we're just doing third person animations but if you are doing firstperson animations obviously you know have the camera set up um but we are just going to get the assault rifle B skeleton or the skeletal mesh we'll just drag the skeletal mesh out and in sequencer we want to make sure that that assault rifle is attached to the hand ass so socket throughout the location and the rotation and we also want to make sure that that assault rifle is in the sequencer right here and what we can do on this animation drop down here is add an animation and it will be the reload rifle iron sights W and now when we play the animation here it has the animation on the rifle we can also I think we need to delete the control rig not the main control rig here but this one here I think we need to delete it and then add the animation uh reload rifle iron sights like so and now it's playing both animations as you can see here and we don't actually have Quinn's body here which is um a little bit annoying I'm not sure if we can let's try and figure this out right now so characters mannequins rigs maybe what we can do is just open the control rig for the body and then maybe in preview scene we can change the preview mesh to skm Quinn that's not changed it in sequencer compile and save that and then maybe we'll delete that um and we will add this one with Quinn there we go and we will move the assault rifle onto that mesh and she's already been added to the sequence we can then delete control rig mannequin body and add the animation there we go because we're doing it on this body let's do it for that one and it looks like there a little bit of disparity here between the animations the body animation is finishing slightly before the other one let's just finish this right here CU that's how long the uh body animation is anyway so now that we have this animation playing on the control rig um and and this position here is just to do with the um the socket actually let's let's fix the socket up a little bit here um so we can go to the SK mannequin skeleton right here and we can change the preview animation to the reload rifle iron sights and we can pause it and take it back to the first frame and you'll see that disparity there with the the front left hand so um with hand R socket selected we can rotate this into the right position there and that will do that will do for now so if we go back here here the socket has changed nice so we're really just changing the key frames of the left hand there to grab that mag and make it a little bit more accurate so the reason we deleted the control rig body from here before adding the animation is so that now we can right click on the route and we can bake to control rig and choose the CR mannequin body and we can just leave that as default and hit create and now it has baked that animation onto the control rig and we can now you can see it's added the control rig back in and it has all these key frames it's it's basically just added a key frame at every moment for every single component um to to bake that onto the control rig so now we can go in and we can edit this this let's make sure that our automatic key framing is selected and we're first just going to look at the initial position of the hand here where it goes onto the magazine and let's see if we can get hand ik set up here so Global control check these yep we can use hand I here so we can go from here you can see it's it's already way off um oh it hasn't done it with everything so I wonder if we can just hit contrl a no um I'm trying to set up the hand ik for the whole animation so I'm wondering if switching it to hand I from FK for all key frames is going to do it so switch this on HM ah I see it's it's Chang the animation here this is not ideal if I go undo until it undoes everything that I messed up there what we might actually do is just switch on the ik for the left hand so if we just just um if we just go here and um L FK ik switch and we switch on the ik for the left hand it won't mess up the animation because the right hand and and we don't have to mess with that anyway so this is how we'll do it we'll switch on the ik for the left hand and then when it grabs the mag here we can select that ik put it onto the mag oh yep put it about here and I'm not going to mess with the fingers or anything like that I'm I'm just trying to clean up this animation a little bit we're still going to need to delete some frames here so um we might want to just go from there to there so I'm just going to make this scale a lot closer and let's have a look at the frame that we set is there the initial frame is there where was it frame 14 and let's see what happens if we just delete those yeah see that's a that's a lot cleaner so what we can do is just key frame where we want to key frame and we'll delete all of the other ones in between so this obviously the gun is rotating here and then it's starting to pull out so at frame 29 here I might um going to delete everything before there and then this Frame here we obviously need this grabbing on here and obviously with the way this is set up um you know my hand can only reach so far there's not much I can really do about that without changing the whole the whole animation so I'm just going to focus on oh grabbing and then it's starting to pull and I might make another key frame about here so I'll delete all of these and once again get this hand on the mag and the mag is not the hand is not really reaching the mag at this point but that's okay like I said we're not going to go into massive detail here we're just looking into how you can actually um make changes to an existing animation to make it a bit cleaner so here it kind of goes on a bit of an arc and if we want it to follow the mag it's going to be quite a lot of key framing um we can actually just delete a lot of these and then do it all ourselves you can see it's way off here way off um so I'm actually just going to delete a lot of those and then start key framing it myself here so oops sorry I'm fighting with the viewport a little bit here and then once you've got a couple of you know key key frames you can take a look at the animation and anywhere where it starts to slide out of play so you think it needs a little to be a little bit more fine-tuned you can do that um and let's just for the sake of this tutorial let's have let's have her fully reach back like this and can't there we go and even bring the elbow forward a little bit like so uh that's going to make problems with the elbow um let's find the um ah so it's that one there yep and I might just uh Delete say three frames on either side of the elbow here and actually even more just delete quite a few frames around that elbow movement and then it will kind of be a little bit more more smoother than just snapping between those key frames and we're going to go back to the hand and get it onto that magazine oops what's the hand doing now can't really see it what has happened to the end uh the fingers have uh g a bit screwy there yeah I've accidentally selected several controls there whoops and again we're getting into the territory here of the arm being a little bit too extended it being tricky to reach this animation but as long as you see kind of the point that I'm trying to make here with altering these animations that's what we're going for so I might have to just delete pretty much all of these key frames until the hand is back on the weapon so I'll delete most of those and then I'm just looking boom boom boom I can't really reach that anymore it looks a lot better than it did even though you know when we look in this really super fine detail at every single frame you can see a lot of moments where you know it's it's not great um the hand is at least following that mag which is you know it's a lot better than it was if you're doing a third person shooter you wouldn't have to do too much more work after this to make this animation look passible but now that that is more or less where we want it we can right click here and we can bake animation sequence and let's just call this a Reload sequence whoops reloads underscore sequence hit okay export the animation and then then we obviously need this to be a montage so we can find our where did we save that reload sequence where did we save that we can press contrl B ah I I accidentally saved it in the manin rigs folder I'm just going to move that to the content folder move here and the reload sequence here we can take a look at that that's our new sequence very nice let's create an animation montage Call It reload sequence change the blend in and out times and go to our third person characters event graph and change this to our reload sequence Montage just browse to that one make sure that's the right one very good compile and save and I might save all just to try and avoid the engine crashing and now if we hit play go to full screen so we can see it more clearly and we press r ah you'll see one thing here it's with the feet she looks a bit odd uh it's because um basically creating your own animations uh breaks the foot ik in the third person character so if I just browse to the animation blueprint and open up ABP Manny delete this control rig node here which is for the feet ik um that will fix that weird thing with the feet and the feet are moving because we don't have that idle animation from the uh ANM starter pack but can see there uh that is a lot better than it was the hand is actually following the clip somewhat nice all righty guys as per usual if this video has been of any use or value to you whatsoever please hit like And subscribe and if you're so inclined please do consider making a small donation to the channel via my patreon link is in the description or via the YouTube super thanks function you can find a thanks button just below the video you can also donate money that way um guys at this stage uh being a patreon member does not give you any added benefits it is just a way of your making donations to the channel without so much of that donation going to YouTube because YouTube takes 50% so more of your donation uh goes towards helping to keep me going and making more tutorials for you guys but for the record I am working on potentially setting up a Discord server so uh membership of my patreon will give you access to the Discord server and hopefully we will have that set up in the next month or so thanks for watching and I will see you on the next one
Info
Channel: MizzoFrizzo
Views: 3,899
Rating: undefined out of 5
Keywords: ue5, animation, blueprint, unreal engine 5, tute, true first person, shooter, shooting game, realistic, unreal engine 5.2 first person shooter tutorial, how to make a fps game, fps tutorial, TFPS, unreal engine tutorial, unreal engine 5 tutorial, unreal engine 5 fps tutorial, ue5 fps tutorial, unreal engine fps tutorial, ue5 fps, how to make a fps game in unreal engine 5, first person shooter unreal engine 5, ue5 first person shooter, animation tutorial, how to animate
Id: imA0aW9AdKo
Channel Id: undefined
Length: 85min 38sec (5138 seconds)
Published: Tue May 14 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.