How To Use Upper Body Montages - Unreal Engine 4 Tutorial

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey guys and welcome back to another mention 4 tutorial in today's video i'll be going over upper body montages so i'll show you what i mean by that as that would be a good explanation so typically if we play a montage it'll be like this so the whole body is moving which means that if we then try to move we're going to get this which is why you sometimes disable the movement so the player can't move around so if we're punching here which means sliding around however we might want it so that only the upper body moves so we can still run around while punching so get something like this instead so we'll go from this to this which as you see is a lot better and this works with any other animation that we're doing and it just looks a lot better than this so this is what we're gonna be doing today and as you can see here i have a full body and an upper body so i'll also show you how we can switch between the two like that instead of just having upper body so let me delete this code and i'll show you how i've done this so what we want to do first is we want to create our animation montage now you probably already have this but if you don't you want to right click on our animation so mine is this cross punch anim here which i got from miximo i'm going to go up to create at the top and create a montage i'll leave this as the default name and open it up straight away you can see in here we have our animation montage what i'm going to do is i'm just going to pause that and then over on the right you can see we have anime slot managed there so we have anim slot manage so we're going to click on that if you don't have the anim slot manager you can go to window and then select it there it should bring you down here like so what we're going to do here is we're going to hit the add slot and we're going to name this one upper body now the name doesn't matter however you're going to want to name it upper body so you know what it is and what it does after that we're going to go back into the middle here under the montage default group you see we have default group dot default sort we're going to press the arrow there for slot go to slot name and select default group dot upper body so now we're using the upper body slot that we have here you can see this isn't going to be playing anything just yet that's because we haven't set it up all we've done now is telling it to use the upper body group in this montage so we're going to save and we can close that however i'm just going to up the scale to be 1.5 as i want this to play a little faster but that isn't required that's just because i want it to play faster so we can save and close that montage next we want to open up our animation blueprint so for me that's content mannequin animations third person and bp again this could be anything that you have you want to go to our anim graph here so you might be in the state machine so just hit adam graph i'm going to move our state machine out a little bit like so we're going to come out of the state machine i'm going to get a new saved cache position i'm just going to rename this to be cached movement or movement cache or anything you can name this whatever you like just whatever makes sense for you but this is going to be the cache for my movement now in this example it's punching however i will just be using it for all types of movement as well and now we have this like so however you can see this is no longer connected to the output pose that's because we need to do something else as well so we're going to do is we're going to right click use cached pose whatever you named it so i need mine cached movement there actually i'll rename this to movement cache to keep it a bit shorter like so and out of this we're going to get a layered blend per bone with that going to bass pose then we're going to duplicate or get again the used cached pose there and now with this we're going to get a slot default slot plugging that into the blend poses zero so it's going to go between these two poses here except we want to change it from slot default slot as that will be the whole body we want to change it to our upper body so we can select it go to slot name and select default group upper body and now you can see this is a slot upper body there and we'll leave the blend weights as one and we can just plug that into the result there if we hit compile we can see this is nearly there so this is the base part done we now need to just also set up where it should be moving so at the moment we know it's upper body but the code doesn't so to do that we're going to select the layered blend per bone here we're going to open up layer setup open up the zero and we're going to add an element to the branch filters open that up the bone name you're going to want to make sure you spell it correct so i'm going to do mine as spine o2 and i'll show you how to get this so you're going to select the skeleton at the top here you can see we have all these spines here for the upper body you're most likely going to want to do spine one however i found for this specific animation spine two looked a bit better but for you you're most likely gonna want to use spite one but you can mess about with it to get it perfect for you so spine one would obviously rotate it there spine two rotate it a bit further up there and spine three would do it there so you can obviously just pick where you want to rotate it from and make sure you spell that the same way so it's all lowercase and underscore so spine o2 again you might want yourself one or three you can choose the blend depth we're going to set to one then we're also going to take mesh space rotation so we know that we want to rotate it in the mesh not the local space and now it should be done so again change these getting perfect for you now let's actually play our montage as well again you've probably got that set up so i'm going to compile save and go to my character blueprint now so that's content third person bp blueprints that person character but few this could be different now i'm just going to do a very simple left mouse button going to go into a play anim montage with the anime montage as my punch i have there now if i compile we should see this working so we hit play and left click and we have our montage playing like so rotating from the spine too as that's what i set it to so this works great and we can move around play all our different animations as it's only playing the upper body animation montage which we wanted to play however what it's going to do is it's now going to play this for all of them or if you have a normal animation montage it won't play it so let me show you now how to have it as an upper body and full body if you wanted as well so we're going to go back to where we have our animations which for me is the upper body montages i'm just going to duplicate my actual animation i'll just put one at the end then we're going to do the same process so right click on that animation create create a montage and open that up again now in here we can leave this all the same so again i'm going to up the scale however everything else we can leave the same so make sure that it's just the default slot not upper body then we can close that we can go back to our animation blueprint in here what we want to do is just move this code out a little bit and out of the layered blend per bone we're going to get a blend poses by ball so if a boolean is true or false it will switch between the different poses and that can go into the result there and i'll just move this up give it some space so true is going to do the upper body false with our normal one so we want to right click and get use cached pose movement cache again because that is our state machine there out of this we're going to get a slot default slot leaving it as the default slot now as that is our full body and that can go in false there so now that will perfectly blend between the two different poses of upper body and normal body however we do need to set the boolean so i'm going to right click on active value promote a variable and i'll name this one upper body so if this is true we are going to do the upper body and i will compile that like so then we'll go back to our personal character or sorry also you can see here it's going through the false value because that's false if i set its default value to true it will do the upper body so you can see that working like so again let's go back to our third person character and i'll set up the other montage and set in that boolean so i'm going to now right click and get a right mouse button event again just playing the animation montage like so and that one can be left the same because that is going to be our full body so we'll actually also change it to be our full body one there so if it's full body leave it as it is if we want it to be upper body off of pressed want to create a new variable say a plus variable naming this one upper body the same as we just did in the animation blueprint i'm going to set that to be true off of released then after the play on the montage we're going to come at the return value and get a delay and set this upper body boolean back to false so it's only true while the montage is playing the reason we want to set it back to false is so that it then goes back to using the normal montage and we want to do it afterwards because otherwise it will stop halfway through if we set the boolean back to false so this should now work perfectly for us as well so again the final part of setting this up let's go back to the animation blueprint go to the event graph and off of your cast to your character here so for you that might be all the way up here off try get pawn owner essentially we're going to come out with the as the person character or whatever it is for you and get upper body and then off of this we're going to set up a body which we already have in this animation blueprint here now we can compile minimize hit play to test it and if we left click we got our normal upper body montage that we have here doing it perfectly like so and if we right click we're going to get our full body montage which we wanted as well so this works great so i think that'll be for this video as we've done everything we want to do we set it up so we can use upper body montages we've also set up so we can blend between upper body and full body as well so we can still use both so thanks so much for watching i hope you enjoyed and i hope you found it helpful and if you did make sure to like subscribe down below so thanks so much for watching and i've seen the next one [Music]
Info
Channel: Matt Aspland
Views: 14,963
Rating: undefined out of 5
Keywords: ue4, unreal engine 4, unreal engine, tutorial, ue4 tutorial, unreal engine 4 tutorial, how to make a game, how to, ue5, unreal engine 5, anim, anims, animation, animations, montage, montages, play, upper body, upper body anim montage, upper, body, full, blend, bool, poses, pose, slot, default, create, while moving, walking, runing, forward, moving, lower body, punch, mixamo, character, blueprint, blueprints, bp, manager, asset, bone, bones, skeleton, spine, layer, layers, layered, output, cache, cached, active, selectio, group
Id: bU95pf5hTkI
Channel Id: undefined
Length: 9min 18sec (558 seconds)
Published: Sat Feb 13 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.