How To Blend Animations For Different Weapons - Unreal Engine 5 Tutorial

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
what's up guys mizo frizzo here and in this tutorial I'm going to be showing you how to blend your animations based on which weapon your character is holding so in this project I've set up my weapon system with simulated physics pickups and my two weapon system and if you haven't already guys I highly recommend you check out those videos because this is built off of the top of that and on that note if you like anything you see about the setup in this project check out my videos because swapping your character out with a metahuman animating it with realistic poses and procedural recoil and so on and so forth is all included in my videos and that's very easily set up if you follow along so if I grab this weapon here you'll see my character has one kind of animation and if I grab a different weapon it's a different animation so on and so forth different for every weapon because obviously with with each weapon I want his grip to be correct and slightly different um so that each weapon looks and feels right so without further Ado guys let me show you how to do this all righty guys if you haven't already what I want you to do is find this animation starter pack on the epic games Marketplace and click add to project and if you can't see your project here just click show all projects select your project project and then select the most recent compatible version which should be 5.2 and hit add to project you'll see that it has added this anim starter pack folder to your project and we've got a whole bunch of animations here but they are for the ue4 mannequin so we are going to need to retarget them for the ue5 mannequin if you have started with the third person template you will have a retargeter already if if you started for example with the firstperson shooter template or a blank project you will not have the retargeter so you will just need to click add add feature content or pack and add the third person uh content pack to your project that will give you a retarget it and what we're going to do in this enom starter pack is right click and create a new folder call it ue5 and then I'm going to filter these by animation sequence so if you don't have this filter here just click this little icon animation and animation sequence we're going to filter by animation sequence and then we're going to press contrl a and then right click and retarget animation assets duplicate and retarget animation assets / blueprints we're going to select the retargeter ue4 manyu to ue5 manyu and I'm going to change the folder to ANM stter pack u5 hit okay and you want the uh the skelet or mesh that your character is using uh on here so I'm using Manny if you're using Quinn you want to change that to Quinn and hit retarget this will take a few moments when it is done it will take you to the folder they were retargeted and duplicated into right here we have a whole bunch of animations retargeted onto our u5 mannequin so you can uh open up any of these and you'll see very nice some useful stuff here this will save you a bit of time um it doesn't matter which animations you use but this is just one option to get some animations to get you going um okay the next thing we're going to do is open up our animation blueprint but before I do I'm just going to open my characters blueprint and uh I just want to point out that if you you know you start with Quinn you may have changed this to Manny so you do have the option here to change the animation blueprint to ABP Manny because ABP Quinn for example has the more feminine Idol um among a few things a few small differences um I'm going to use ABP many but no matter which one you're using ABP many or ABP Quinn I'm just going to hit this browse icon here to browse to the animation blueprint you should make all of the changes in ABP Manny because ABP Quinn is actually a child of ABP man okay um so everything you do you should do in ABP Manu so I'm going to open this up and the very first thing I'm going to do in the event graph here is change this reference to the character because this is not a specific reference to the third person character it's to the character class so we won't be able to grab our current weapon in from this character reference we need to delete this node and instead I'm going to cast to third person character plug these in and also select this set character reference node and change the variable type to third person character object reference It'll ask you if you want to change the variable type change variable type it will do some things and stuff and now we will be able to get uh current whoops sorry get current weapon int and I'm going to promote that to a variable leave it called current weapon int add an execution pin plug this in here nice now we have access to our current weapon int we can head on over to our enm graph and what we're going to do is straight way I'm going to disconnect this main States state machine and I'm going to copy its name and then I am going to drag off of here and I'm going to find new save CED pose and I'm going to click on that and rename it main states so basic basically I'm saving this whatever this outputs into a cache which I can call elsewhere I'm also going to do the same thing for my weapons so I'm going to right click I'm going to make a new state machine I am going to call the first one pistol enems I'm going to copy that name cache that pose and I'm going to call that pistol atoms I'm going to duplicate pistol atams and rename it um ar4 X anoms that's the name of my assault rifle I'm also going to copy that name cach it rename the cache ar4x anms and now I'm going to blend these based on our current weapon int so I can right click I can find blend by int blend poses by int and I'm going to add pin right click and add blend pin as many of these as I need I've actually got six weapons pistol is weapon name zero and my AR 4x's weapon name five so um you would obviously need to plug the appropriate animations into the appropriate blend pose pin but I'm just going to show you uh pistol enems in AR 4 x enms so I can pull up my cached pose pistol enms plug it into blend POS zero I can also find my AR ar4x enms plug them into blend pose five and then Active Child index is going to be your current weapon int and then the output of this I'm also going to cache and I'm going to call that Das upperbody atoms like so okay and now what we want to do is blend our lower body enims and our upper body enims with a layer blend per bone node so I'm going to disconnect this uh default slot here this is for animation montages I am going to grab my main states and I am going to drag off of here get a layered blend per bone and this is going to blend our lower body with our upper body what we want to do is Select it and then drop down this layer setup in the details panel over here and index and find Branch filters and add a new Branch filter drop down the index on that Branch filter change the bone name to spinecor 01 and and we want to check mesh space rotation blend and mesh space scale blend so this node is going to blend whatever's plugged in here into all of the bones above the first spine bone so upper body and I'm just going to grab my upper body anms plug it in here and the reason we want this default slot for montages here is because if we're playing any montage montages they're probably going to be like reloading or firing montages so we only want them to play on the upper body nice this is all set up what we've got some warnings here ah we didn't add the animations here sorry about that so I want to go into pistol enems here and off the entry I'm going to add a state I'm going to call it base and then in base I'm going to grab my idle pistol animation from that folder plug it in here and I'm going to with it selected I'm going to make sure I check Loop animation over here then I'm going to back out also go into my ar4x enms also add a state also called base and in base I'm going to find my idle rifle iron sights plug it in here make sure it's looping and now if I compile and save it should should be working now the problem here is he's uh he's doing the pistol pose even though he's unarmed um so it's not the best demonstration of how this works so I'm just going to fix that really quick um the problem is with my enumeration so if I go into my weapons folder I've got this enumeration weapon name and uh I usually have zero as unarmed so I'm going to add one more here I'm going to call it six and bear with uno momento P of all I'm going to move all of these down one and make this one unarmed okay and now pistol needs to be 1 and ar4x needs to be six so I'm just going to very quickly open BP ar4x change the we weapon name to six and my BP pistol change that weapon name to one and then in my animation blueprint I am now going to add one more blend pin ar4x will go into blend Bose 6 pistol atoms will go into blend pose one and then in blend pose zero we can just get our main states plug that in there now if I compile it should be idle normal and what I'm going to do is grab one pistol and one assault rifle right here I've got my idle animations unarmed if I grab the pistol he's doing the pistol pose and if I grab the rifle he's doing the rifle pose like so I can switch between them animations will change very nice um and if you'd like to know how to change these animations to look a bit better I highly recommend you check out my leftand ik hand sway procedural recoil and realistic third person poses tutorial yes that is one tutorial it is quite a banger it's an hour long but you set up some really cool stuff and it's very easy to follow uh as are all of my videos um but that's it guys we've blend poses based on which weapon your character is holding so if this Cho has been of any use or value to you whatsoever please hit like And subscribe and I will see you on the next one
Info
Channel: MizzoFrizzo
Views: 1,592
Rating: undefined out of 5
Keywords: ue5, tutorial, animation, video game development, 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, ue5 weapon system, unreal engine tutorial, unreal engine 5 tutorial, unreal engine 5 weapon system, unreal engine gun system, unreal engine 5 fps tutorial, ue5 fps tutorial, unreal engine fps tutorial, ue5 fps, ue5 first person shooter, how to add a gun
Id: G1s3uiifVMA
Channel Id: undefined
Length: 13min 59sec (839 seconds)
Published: Sun Jan 21 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.