Blender FPS Animation: creating a rifle reload animation

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
this is just going to be a video where i kind of show my workflow for making a reload animation inside of blender now this will be for both the arms and the weapon and then importing and setting it up inside of unreal engine now for this specifically i've already made a couple i'm just going through and i i had to remake literally every single animation for the nazi zombie series so i'm at the point where i need to remake the reload for the m1 carbine so i'm just going to show you kind of how i do that now there's going to be another video well this is going to i don't know which one to upload first but i'm recording this one before i record the other one so i'm kind of doing it backwards where i showed the initial setup and how i actually kind of set up my projects and blender for making these kind of animations and stuff so for example i have my amnon site idle i can tell exactly where the bullet's going to hit because i always use the muzzle bone or a socket off of that muzzle bone as my source of the either projectile or the line trace so that way that muzzle when it shoots depending on how far the target is away this is at a actually how far is how far away is this it's at 10 meters out so i'm currently had this rifle just with irons anyways 0 to 10 meters so it's hitting roughly in the center there so i'm going to be showing a video on kind of how i set everything up like that so i can have very quick uh changes between projects and weapons so i have one dot blend for the arms and one dot blend for the weapon and i can literally just drag and drop and switch them all around and make animations that way very smooth and quickly so let's go ahead and begin first things first i go ahead and create a new action for my arms here so i'm in the action editor i'm going to hit new i'm going to go ahead and hit fake user and i'm going to call it let's see my names were yeah just normal so i'm going to call this one just simply reload and i'm going to click the weapon here the armature click no i'm going to call this one m1 underscore reload so that way it follows along with how i hardly i already have a certain thanks to the fire and the reload i'm just going to hit fake user again so to start it off i'm not going to be having them both uh those things of armature selected i will later on as we start kind of uh working with attaching like the magazine to the hand and that kind of stuff so pretty much when we start working with constraints first things first well because constraints i want to really focus on because those are a big problem in my opinion when trying to animate inside a blender because you have to use visual keyframes and it you kind of just got to set up a little bit we'll do it a little bit differently than you would in something like maya so we currently only have 10 frames here i'm just going to extend this out to about the length that i would want it to be so i'm going to go 75 and make it fill up the timeline and begin i'm going to go ahead and head into pose mode here select my arm or my hand and i want to bring it back actually to where the hip pose was right there and i'm just going to simply do a keyframe so select all i location rotation i'm going to select my bone layer that has just the hand ik on it i'm going to go up to start out with 15. bring the rifle up and rotate it around and that is a good bit too steep so i'm going to drop it down some and i also want to lower it a bit so just kind of get in a good position and i'm pretty happy with it there i'm going to go ahead and keyframe now one thing i want to go ahead and do is i want to extend the index finger get off the trigger so i'm going to do that from the start at frame one hang on i just realized i did something here i go back into pose mode for the m1 reload i want to extend the trigger back out like so and simply keyframe it so frame one i'm going to select the layer that has all what i need on it extend it out next would probably be worth just throwing up on the stock yeah that'll be good and i want to select all three of the finger bones and insert the keyframe so now it should be stuck there which is good let's go back to frame 15 and what i want to do is after i can probably frame 10 i want to detach this left hand here which has a child of constraint to this bone here and just make it so i can move it around freely so what i want to do in order to do that is at frame 10 is when i want it to release i'm going to go to frame 9 i want to keyframe the influence at one and same thing location and rotation here i want to go to frame 10 and what i'm going to do is i'm going to insert a keyframe of visual location and rotation and then set the influence to zero and keyframe it now watch when i move the timeline it snaps right back and that's the that's the main thing i was talking about so it still follows along so we have frame one to nine it's still attached frame ten it's in the next place so it's still where it would be if it was attached but the hand is now free so if i move this around the hand up front is no longer with it then from here on i can just take it and move it roughly where i want so i want to go ahead and start bringing it to the magazine and from there we can start just kind of positioning it not entirely sure how i want to grip this because the hands look huge i'm just going to grip it straight up from the front or do you want to rotate a skirt this is a tutorial it doesn't really matter all that much i'm just going to save a little bit of time let's get the rotation whoops about there and i want to go ahead and keyframe location and rotation and go back to my fingers and here's where i'm going to edit the hands to kind of focus on grip in the magazine first thing i want to do though so i want to go to frame 14 i want a keyframe location rotation and go back to 15 so that way all my finger changes won't be slowly interpolating to the new position from set frame 0 to 15. instead it's going to go from frame 14 to frame 15 or whatever i want it to be so i'm actually going to move this back to what's that 12 yeah 12. oof i need to really change the end position here that's for sure go where it's at its worst about there and just put it in a similar position keyframe it all right so now i'm just going to extend this out a bit so we go from there to frame 11 let's go from frame 20 and try that okay time-wise that seems okay i just got to deal with this wonkiness and let's look and keep kind of adjusting and keyframing all right i can probably span that out a bit unless that's going to break it again it doesn't seem to be so i want to move it forwards a bit give these in a closer obviously this could definitely be improved and once i'm done with the basic block out i'm going to be cleaning it up just probably not in this video so let's just say it's already smooth we're good to go we have it at the uh the hand at the magazine let's go ahead and adjust the fingers so i'm gonna select all the fingers what the difference is between these two move it up to yeah i'm just going to leave it there and make the adjustments so go ahead and grab about the thumb actually bring it in closer tilt the thumb up kind of give it a little bit of the impression of squeezing i'm gonna go ahead and keyframe both of those let's do the index finger wrap it around a little harder happy with that and i'm going to do just the ring and the middle finger as well the heck am i grabbing okay from you you and you let's do the ring actually rotate you out a bit keyframe those three and the pinky i'm just going to kind of close and keyframe so now let's just clean up the arm a little bit more let's go to where we're inside the magazine and back it away just a little bit okay i just grab the magazine in hand and now we can start working on the constraints for the magazine into the left hand so for that i go to the weapon armature and go to where we want to grab so keyframe 25 is where we want it to be fully attached to the hand 24 can be relaxed so i'm going to go ahead and keyframe all the bones of the weapon and go to the magazine gonna add a child of constraint to the armature of the hand voiding of the arms then we're going to add it to the ik hand l and hit set inverse so now i remove the hand around you can see the magazine's moving as well so now we need to get it from this position to this position so let's go ahead and insert the keyframe for the influence at one or wait no that's zero sorry we're gonna go to frame 25 because that's where we want it to be attached to the hand we're gonna do a visual location rotation set the influence to 1 and keyframe so now out of curiosity let's test that out the frame 24 nothing's happening frame 25 we have full grip so that means we're good to go and ready to continue this uh animation process so i'm gonna go ahead and yank the magazine out of the hand good just do like a quick little yank now that be i don't know three frames just give it a tug and try to keep it lined up as best as possible with where it was that's actually almost spot on it looks like then insert location rotation for the keyframe and i'm going to select the and and kind of give it that little bit of a tug let's rotate on the y and insert keyframe so now i have the issue of this whole movement here so it's slowly moving the arm down it's not really giving us that pulling effect so we need to insert our keyframe earlier before this i'm just going to control z we're going to make a slight adjustment around frame 25 so we're going to insert a keyframe on frame 25 go to frame 28 that's where we're going to finish the rotation press r and y to rotate on the y locally and insert so now he grabs it yanks it out and then about another three frames up right up pull the magazine back or the gun back up kind of like that let's go to frame 25 and i'm going to make a slight adjustment actually play yeah i'll just do it there so it's got to go forward a bit there we go and now we can do the whole you know magic of just trying to get the magazine out let me know discard the old magazine and make it look like you're picking up a new one so let's go to frame frame 35 just going to keep dropping and that'll work now we can just pretty much keep it there and figure out roughly what frame we want to start inserting the new magazine so i'm thinking probably i'll just come back up about frame 48 so i'm going to come back up to this keyframe at frame 48 whoops there we go i need to extend this keyframe do it frame 42. i think that's a decent kind of waiting time again this is just a block out okay so the magazine roughly back in so i kind of want to do a little bit of work on this arm because we're not doing anything from here it's just staying completely still let's get about 40 and just maybe move it around just a little bit all right that's a little much just very subtly a little bit of rotation just so that way it's continually moving and then we can start moving it back at roughly frame 48 so i'm gonna grab this t frame insert it here so now we're going up and back down as the magazine's coming in and they're meeting just like they were at frame something something over here so we can continue with the insertion so let's see let's go to copy frame 25 put that at frame 50. and i want to give it a little bit of a like it's giving a little bit of force and by frame 52 i want to have the magazine fully inserted so i'm going to copy frame 24. pretty much the rest away and i wanted to detach the hand from the magazine so that way we can put it back in its exact location so let's go to the weapon armature and not do anything with it all the way up until you know here so frame 52 i want to release it i'm going to frame 51 insert normal location rotation and keyframe the influence i'm going to go to frame 52 on a visual keyframe location and rotation lower the influence and press i so now we have these here and we have no influence at frame 52 so by like frame 53 or 4 i'm going to have the magazine the rest of the way in so if we come back here where the influence is also at zero the magazine's fully in so i'm going to copy this keyframe go to let's look at frame 54. yeah i'll work with that and then i'm going to make some changes over at the arms so frame 50 yeah i want to make it look like it's finished inserting at frame 54 so i'm just going to drag it up kind of move the palm into it a little bit more okay just doing location or keyframe it and alter the finger sum so let's get that thumb up and do something with the finger here i think we'll just kind of rotate it and keyframe so and also keyframe the thumb so let's look at it i think that's okay kind of looks like it's giving a little bit of a bump in which case from there because we have the magazine all the way in we can just give it another little kind of adjustment because here the magazine it doesn't really matter after a frame what is it 52 yeah so it's fully attached to 52. i'm going to keyframe 52 with that hand and give it a little bump at 54. it's got like a little bit of a jarring movement and from there on this hand frame 57 i wanted to keep going up just a little bit yeah no let's uh yeah let's go up and back like so as if we're trying to slap it into the mag well and get right off of it so notice there's a little bit of clipping the hand here so frames d4 i'm going to do some adjustments to the fingers and when i select all actually i want to select do that all that frame yeah i'll keyframe all of 52. and a 54 well that finger up same thing with the middle and ring and keyframe we gotta get that make that pinky look a little bit better so we can start i guess just open up the pinky i'm going to move it kind of right alongside the ring so highlight those two and keyframe all right so now by frame i guess 60 we're going to enter the next uh part of this and i want to go ahead and run the bolt for this animation so i'm probably going to run out of space here so i'm going to extend this to 100 frames just so i have room and just work with the hands for now so let's go ahead and kind of straighten it back up like probably just to have it transition i'll work with that position so frame 65 we have that back we can take that and we can just kind of alter it and rotate on the x raise it up just a bit and keyframe so there we go it just kind of flops right over and then i need to position the hand so we're going to be doing just getting that primary pose on the actual uh where we want it on the charging handle and then we're going to work between frames 57 and 65 to kind of get it out of the way because we're there's obviously going to be some clipping when it tries to interpolate between them so let's get started on that i'm going to flatten the hand out let's see actually don't want to do it over the top or from underneath actually on second thought i'm going to go from underneath so i have that there rotate on the x rotate on the y so let's just keep it there but rotate on the y and rotate the x a little bit get it in kind of a decent position and keyframe this way we can speed it up as well for gameplay so our reload's a little faster save some frames so about frame 60 i'm going to want to start trying to reach over there actually just bring the hand up and over rotate it like so i'm going to extend the fingers so that way i know roughly the height to have my hand so you're about out just open you up i want to see if i can get the index in the middle yeah those are what's going to be what grabs the charging handle keep grabbing the wrong one and the other two i'm going to keep pretty much closed you can rotate straight so when a keyframe the hand i'll go ahead and do the adjustments to the thumb and i'm going to wrap the ring and pinky actually around the thumb go ahead drop the thumb in further just kind of open you up just a tad i'm going to go and actually keyframe the thumb in that position open up the fingertips a bit uh grab rotate you that way i'm gonna go ahead and keyframe all the fingers so now i just want to get the uh index and the ring and the middle finger kind of align better so i know you were rotated that way good ways i just want to get you lined up in just a little bit as well as you like so and just keyframe the entire hand there we go i'm going to go ahead and grab the actual hand ik and just move it roughly into position and this way and rotate a little more trying to keep it as best i can against the uh the stock there and just bring it up roughly to the charging handle and insert the keyframe so that's a little fast extend view out a little bit i guess it'll be okay let's try pushing to 65. move the fingers over to frame 53. and i think that'll be okay so we're actually just at the turning panel now so now we're going to do kind of a reverse constraint so i want to attach this hand to make it a child of this um the charging handle so i'm going to go to boom constraints deliver you a bit minimize sorry make another child of of the weapon armature and attach it to the bolt and set the inverse so this is completely fine except when i get at frame 64 i wanted there to be no influence so i'm going to keyframe location rotation right there and keyframe influence at zero so it's not attached at all during any of this then at frame 65 i want to keyframe visual location rotation set the influence to one and keyframe so now as i go through my frame 65 i should be completely locked in so if i come to the uh weapon armature the bolt as you can see it's now working and following pretty well so i'm going to actually open up both of the armatures for this so i'm going to select the webinar butcher and the hand armature and go to pose mode you'll see down here which one we have selected so we have reload when i have the arms armature selected and m1 reload whenever i have the firearm selected so i want to keyframe 64 where the bolt is and i guess we can start moving it let's go all the way to the rear about there and keyframe let's extend this out to i don't even know actually i think that's about good so then we need a way to release and do kind of like a snappy release to it make it look like it's under some spring tension so this frame were where we wanted to be all the way back so i want to release at this frame i'll release the hand of this frame so what i'm going to do is i'm going to go back one frame insert local rotation her location and rotation go forward one frame or sorry go back to 67 and insert a keyframe on the uh influence as well and go to frame 68 insert a visual location and rotation lower the influence to zero and keyframe so now we go back just like normal except on frame 68 we're completely freed go to frame 70 and return this just send the bolt home so let's enter in zero that should be back at the back of its home or uh back into battery i'm going to do a location and rotation so let's look i want to make it a little faster if i make it like one frame long like so and now i want the fingers to kind of relax react to it so it's not just going through the fingers even though it's hard to tell but in real engine it kind of you'll you'll have the points between the keyframes to make them really smooth so you'll see it go through the fingers so let's go at 68. select the fingers uh pose the layer we're just gonna open these up i actually want to open them up down here like so wait a minute i want to do this i want a keyframe i'm at 68 and then move to frame 16 9 and do it i got myself confused make sure they're still together and open them up and keyframe as we go the fingers are back and it's released and then let's go two frames forward and close them back up again so it looks like it's uh kind of forcing its way through the fingers and now that this is all done we can start setting up uh to go back to our initial pose so that's gonna be where we set up the constraints for the hand as well because it's no longer well it's got to have the child of for the actually name this child of right and and child of bolt so let's select this hand select frame 0 go to frame 75 and just put it there so we need a key frame to spot before go to let's see want a keyframe at 70 and then paste it at 75. now let's go to just 80. smooth it out okay 80 or 76 or seven that's a little better okay so now we need to work on the hand so we gotta get this hand in a pretty close position so i click on it here let's look at the influence so here we're at one then zero so i'm going to copy this keyframe then go one before it and paste it that's not quite correct i also want to do the fingers select all the fingers and select that keyframe as well and paste it in and that did not move the fingers at all select all the fingers deselect the hand so remember it's frame 76. and i don't think i even actually if there's no i can just copy frame one so 76 paste it in there there we go i love that completely like 360 the wrist just did all right 676. now you can see if we change the influence kinda it's a little off i think it's because we're doing a visual keyframe so it's like just that remove only you there we go so i just went ahead and selected the one frame that we did right before we uh removed the influence so now at frame 76 we're back at an influence of one as well so we want to set up the part right before it so i'm gonna go to 75 and do a let me actually keyframe 76 actually it already is i'm going to go 75 do a visual location rotation drag the influence down to 0 and keyframe so now it's going into place and at 76. we're completely locked back in in the correct position so that way whenever i move this hand around you know it follows and stuff but we need to work on the frames and the frames before this or most specifically the uh that monstrosity i kind of start opening up the fingers a bit earlier i'm going to select them all select 76 paste them at 73. let's do some small adjustments and you're let's see are you rotating all the way why the heck are you doing a full-on loop and so for whatever reason you're freaking out there as well all right just do adjustment on frame 75 get close and by frame 76 we're locked in okay now the only difference is i want to spread this out a bit so i release off at 78 start moving down i want to extend i'll push you back a bit about four frames and then open up the hands well not the hands but the one two three one two one and i'm happy with the time so now we just got to deal with these uh rotation issues like that but first we have some clipping so frame 74. i don't want to have it looking like that and that random rotation yeah 79 it's just a little work that 81 is a little wonky so let's 80 actually better than 81 let's bring you up a little closer and we have the final somewhere from 79 to 80. bring you up a little closer to the correct position base in oops 81 and i have 81 just kind of come up and be a little bit closer to 82. okay i just realized the mistake i made i push this to 82. so it's gonna kind of mess up some of this stuff a little bit just the clipping here let me think by just doing a little rotation all right a lot of clipping on 80. not much on 81 and 82 we're locked in so and all in all this took us 82 frames and it took me oh god only 46 minutes let's just go ahead and look and see what we have for the basic block out that's not too bad we have to fix a little bit of clipping at the start and obviously smooth that out some let's see where we clip between 10 and 14. actually we're pretty far in there at 14. so let's try to rotate the hand out pull it away it's not really clipping and we're good there i have to deal with this monstrosity let's go to the halfway point try to rotate the hand up i'm almost wondering not sure quite what's causing that i'm not going to be moving the hand i'm just going to be rotating it so we have some clipping there have to deal with that 17 18 and we're pretty much good extend you out which of course gives us another frame that we have to fix and then we can just do some very basic smoothing so we have the frame 12 is clipped in rotate keyframe all right i'm just going to say skirt and this is where i'm going to call it because we pretty much have our reload good to go now i'm just going to export it so we can export even though we're have both selected pretty much ready to go actually i'm going to select all put that keyframe back at let's say we're pretty much done and good to go at frame 75 so i'm going to paste the end at 75 so that way if we wanted to we could uh have it where we kind of start shooting before the actual reload animation is finished so if we wanted to at frame 75 we could continue the shooting so it'll just interpolate faster kind of to the end there even though it's not going to really make much of a difference but now let's go ahead and export it so i'm going to export my armature first and my weapon save it and open up the engine and i can't remember i don't know if i have this setup to play quite yet but i can probably just set that up so we can see it anyways all right now i gotta wait the good old 10 seconds or so there we go so i have my animations here just add reload to it i'm gonna just see what it looks like add you up there and add the weapon reload oops the only thing we should see moving magazine and the bolt which is the case save all and i guess give this a test so i have my hammer carbine blueprint that's still got the mesh set i had the reload animation set the fire as well i have to just make a quick little animation montage so i want to copy the 1911s and change out the animations so one carbine reload and one carbine hip fire and m1 carbine ads fire oh and one carbine it isn't hip let's flip these around and we're good to go there so save it set that montage and hopefully it'll all work i had to like i said i had to redo every animation camera if it's set up or not i'm gonna go with no yeah so i gotta set up that in the animation blueprint real quick i'm just gonna copy the state machine and one carbine some carbine idiot hip idle ads idle i'll save add the m1 carbine slot connect there we go and our reload so there we have it that's a basic block out and we finally have our reload and everything playing it doesn't look half bad especially considering we spent about 40 minutes on it not really fine tuning anything just kind of slapping it together i'd say we did okay so the main part of this video was uh just kind of one show how i kind of have how i do this as well as showing the uh like trying to put emphasis on how to transition between constraints and having them be placed you know without completely breaking your animation because i've had it before in the past where i would go to do a keyframe i'd try to change the constraint so i'd lower the influence and it would just kind of take the control bone and just kind of move it off into narnia to where i would either have to manually reposition it or just something along those lines and it would never be perfect so this way with the visual keyframing and how you kind of set that up so if we wanted to go from the influence of zero to the influence of one so it's fully constrained we would do a normal insert of the location rotation keyframe on frame one and keyframe the influence at zero then when we go to frame two we would do a visual location rotation keyframe and keyframe the influence at one and then whenever we move the timeline it'll snap the uh the bones back in place and that's pretty much it so yeah hopefully uh kind of downing would find this useful but this is how i created the how to create a reload animation and import it into unreal engine i've already showed videos on how to make use of it but in another video i'll probably have upload these about the same time i will show you how to do the basic setup so i'm going to be setting up this m1 carbine as well as i guess i'll do the first person arms as well just so i can show you how to uh how i set up so i can quickly alternate between gun animations so for example i have my 1911 here i have my fps animations blend and it's the exact same thing the only like it's literally like the exact same thing my difference is the gun swapped out and the way i can do that is i have this fps arm setup blend here that just has what i need it has the crosshair out in front of me exactly where i want it i have the camera already set up i have the arms set up i don't have the pose layers set up how i would like them but i i kind of have to make that a little bit of a change so all i do is i just for example i'll just drag this out append it and append the arms and i have arms good and set up to go it's the exact same thing for the weapons so i have the same one carbine blend here and the guns just set up so i have this collection called m1 carbine i have the cylinder the cylinder is just that line trace so i can see exactly where i'm aiming and it's attached to the muzzle bone so that way i can make very tiny tweaks to it so wherever you're looking through the iron sights you can adjust the muzzle bone and make it intersect at x distance so that way that's kind of like your zero distance so i have these all zeroed at 10 meters and that's pretty much where they're going to hit at so that's what i'm going to be showing in the next video so yeah that's pretty much everything at least that i can think of so hopefully someone at least found this useful and maybe learned something from it because i am tired but i'm going to go ahead and i guess record the next video or clean this animation up i don't even know either way i will see in the next one
Info
Channel: Sneaky Kitty Game Dev
Views: 33,319
Rating: undefined out of 5
Keywords: Unreal Engine, UE4, C++, Coding, Code, Tutorial, How To, Ray Trace, Object, Light Switch, Switch, Modeling, Light, Sound, Multiplayer, Client, Server, Dedicated, Survival, Respawn, Inventory, Crouch, Chat, Message, Online, Subsystem, OnlineSubsystem, Steam, SteamServer, WebAPI, asp.net, mysql, world at war, nazi, zombies, nazi zombies, blender, 2.8, 2.9
Id: S7k3WwkIWdA
Channel Id: undefined
Length: 57min 9sec (3429 seconds)
Published: Sun Jul 19 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.