Unreal Engine JUST made Animation blending TOO EASY

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
now with unreal 5.4 we have motion matching as a feature now and it is actually quite awesome because it more or less eliminates complexity in your state machines and in some cases replaces them all together or even can replace things like your blend spaces and stuff like that entirely based on the actual animation data itself rather than having to set up a bunch of programming around it it's so so nice so let's get into set setting it up I have an example here already set up for you uh this is a miimo character and the reason I went with a miimo character is to show you something very very important and that is if we go here uh we have a root bone that is not part of the actual like animation rig bones it's just a a bone that everything else in the end inherits back to that's very important because motion matching is based on the root motion and usually in miimo maybe in your own skeletons as well if you haven't thought this through very well uh the root bone is actually uh the hip bone itself so if you're using mixim animations which I am assuming quite a few of you are unre is going to be releasing a library of like 200 or 500 uh humanoid animations sometime in I think July or August is the plan for now so maybe by that time you won't be using miimo as much anymore but for the time being if you are you're going to be running into that problem so we're going to walk through that first and the way we're going to fix that is with miimo converter it's a free little Tool uh you can find on Google fairly easily I'm going to try to remember to link now Below in the description if it is not in the description yell at me in the comments and I will add it uh but if we open this up what we can do here is we can say hey I want to uh start converting and there it will give you a full in which to place all of your miimo animations that you downloaded from the website this can be a Auto riged character that you've made and let mixim Auto rig or in my case just a character that I downloaded over the website this is in the folder incoming fbx uh then you simply just say hey I want to convert these animations and once you've converted those animations uh they will be here in the outgoing fbx which again you can just open with this folder and you can see we now have all of the animations do u. fbx so now they're all unreal ready these are the animations that you're going to be importing so first you import your character I can just do this in a separate directory real quick to show you uh so let's just do that un like this directory because I don't really care so first off we drag in the actual character for which we're going to import the skeleton mesh and the mesh all that stuff you're probably used to doing that once you've got that imported you might get a error or a warning rather like this it works don't pay attention to it really all I have to say about that so it'll import all of your uh skeletal assets and then what you can do is you can select all of your animations and simply say hey they belong to this skeleton if you get prompted to also import the mesh with any of these animations uh uncheck that you want to not import a mesh only import the animations and Link them to the skeleton of the character that you just imported so we're going to import those all and now we have all of them this is where the actual motion matching uh process starts so we're going to take uh all of the locom motion animations which in this case uh includes idle uh left strafe uh left strafe walking uh not the Turning ones the right strafe uh right strafe walk uh the running uh the sprinting backwards and the walking and walking back selecting all of those we want to go into asset actions and edit selection in property Matrix this will just give you a way to edit certain things about all of the files at once and the things that we're going to want to edit is going to be the root motion so we want to enable the root motion because motion matching kind of what it does is it looks at the root motion of your character I think it also uses like specifically the feet which you can tell which bones are the feet uh but it primarily I believe uses the root motion uh to calculate what trajectory this animation belongs to and then it uses the trajectory of your character we'll get to that in a moment looks at what combination of animations that it has in a database how it can blend those to end up with a good blend of animations for the movement of the character in that moment uh we also want to have Force root lock on and of course since these are all Locomotion animations we also want them to be looping now with all that I'm going to save everything in the project so that we have everything properly set up next up we need to enable the motion matching related plugins so if we come up into the plugins here uh we can look for motion trajectory which we want to enable it is labeled as experimental so do be aware of that uh but for the most part it's fine and then we also want to um enable the post searching plugin once you have both of those enable restart your engine if you haven't already and then you will be able to add in the stuff that you need so that will be in animation now you see here motion matching and the first thing we want to add is a post searching schema for which you will need to select what skeleton you are going to be setting this up for so in our case it will be I don't even know which one this is I think this is the one that we just added so we're going to be doing with that one and I will call this for now character motion schema or something like that doesn't really matter what we call it opening that up we get a bunch of options which uh we're just going to mostly ignore you can dive deeper into this and uh figure out what all of these options do and how they all work if you just have simple animations for a simple normal humanoid character uh you can kind of just ignore this once you have that doubt we're going to come back here into animation motion matching and we're going to uh make a post search database and there you have to supply a post search schema so the thing we just made is going to say hey I belong to this skeleton these are the settings and that's what I'm going to use to interpret that skeleton again for the most part you can just kind of keep it at default and let's call this post database and we can open that up and this is where we'll put all of the animations that we want to be blending between so all the animations that we just enabled a root motion for we're going to have to select them all again so let's go through this Idol left strafe and walking right strafe and walking running sprinting I think that's all of them we can just kind of drag and drop them into there and now if we select any one of them and now if you select any one of them uh they will play the animation and you will see that blue line there indicating the motion path that this animation takes so idle is just nothing left strafe is quite quickly moving in that direction uh but left strafe walking is a little bit more slowly walking in that direction and so on and so forth so the more animations you can add to this the better it is for instance right now we don't have like starting and stopping animations but if you added those it would be a lot more smooth when you start and stop running right now it has to interpolate between the walking animation or the Running Animation and the idle animation if you have an animation specifically for that you can just throw it in here and it will just magically improve the feeling of your character it really is that easy now with all that last thing to make in animation motion matching is the post search normalization set which we'll just call uh the normal set or something like that call whatever you want in there uh we simply just have an array of databases and we just add in uh the new database that we just made if you have multiple databases for whatever reason that are all relevant uh for instance if you have a separate database for your crouching and a separate database for your non- crouching State uh you can blend those in your animation blueprint however you want uh you can both add them in here in theory maybe you also have one for crawling or something like that speaking of Animation blueprints we've gone through all the setup so now we can do the exciting bit and that is making the animation blueprint so so easiest way to do that is just right click on the skeleton create animation blueprint and we'll call this um motion matching and now that we're in here uh this is going to be ridiculously easy right so just hold your horses what we're going to do is we're going to add in a motion matching node and there we need to give in a database so that'll be our post database that we just made uh but it also will need another node it's really complex it needs two nodes uh the second no that it needs is a pose history uh because with a pose history it can see what poses it just had so that it can blend into the next pose uh I'm pretty sure that's kind of all the rest to it and that's going to go into our output pose and that's kind of it uh but we need a trajectory input for this one uh because otherwise it's always just going to uh play the idle animation and the way we do that is with the new trajectory component uh which if we go into our blueprints here real quick into just third person character you can see I have this component right here and you can just simply add that with just simply character trajectory I've said this so many times in this video my mind is just refusing to accept this as a word at this point but now that we have this component this will just keep kind of the direction of our movement and we can use that in our animation blueprint map so in our event graph we're going to uh with try get porn owner cost to our bp3 third person character again this is just normal animation blueprint setup technically speaking I suppose you could do this only once and then save it out as a variable but it doesn't really matter we get the trajectory component and just simply upgrade that to a variable so now we have that available there as a variable and with that in the animation graph we can write click this trajectory and we can bind that to the trajectory on the character trajectory component I'm telling you the word trajectory has lost all meaning uh but with that set up now it's going to uh use our characters movement to blend between all of those animations that we just kind of put into a list and the engine is going to take care of the rest for us of course we need to set the mesh to the actual mesh um I have this mesh in the project twice now because I reimported everything to show you guys how to do it uh but let's change it to the other one uh just for shits and giggles and I think I called this something like motion match there we go and now if we play we can see that even though we didn't really set up any state machine or whatever uh it is pretty seamlessly matching uh our movement in whatever direction we're go with the animation uh if you don't get these strafe animations by the way uh that is because your character itself is using control rotation or or not using control rotation rather so if we set this to false uh the character will just automatically turn into whatever Direction you are walking toward which makes it impossible to strafe it's kind of up to you what your game wants and needs of course but for the purposes of showing the blending between different directions I uh enabled that so that we can actually strafe left and right and show you that like we even have these like little middle grounds and and whatever so you really want to add as many animations as possible here just like you would in a normal traditional blend space right just having the two three different directional animations is a good base but the more animations you add the better it's going to do the difference being is now you just add them and unreal takes care of the rest for you you don't have to find like the perfect position for them to be as long as the animation you made is actually like physically accurate and the amount of space as your character moves in the animation with the rude motion matches what you would expect and a very big thank you to all of my patreons you can see them on screen right now if you want to help out supporting the channel there's a link Down Below in the description to the patreon page and a special thanks to my cave Digger tier patreons Serge Thomas
Info
Channel: The Game Dev Cave
Views: 4,063
Rating: undefined out of 5
Keywords: unreal motion matching, motion matching, tutorial, unreal tutorial, motion matching tutorial, unreal engine, unreal, the gamedev cave, animation
Id: 9AJmkBBfmJI
Channel Id: undefined
Length: 13min 20sec (800 seconds)
Published: Mon Apr 29 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.