Using Root Motion With Mixamo Skeleton + Animations! | How To Make YOUR OWN Game! | Unreal Engine 4

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] what's up guys sean the bro here and today we're going to be using the fighting game tutorial to go over root motion in our animations and how to make that work from miximo animations so uh it doesn't matter what project you do this in you don't have to know the fighting game or anything to know how to do this or to follow this tutorial if you would like to check out the fighting in tutorial i'll leave a link in the icard in the top right corner so you can check out the first episode we're 54 episodes in at this point so we've made a lot of progress on this fighting game there's still plenty to go okay so what i've got here is i've changed some of the animations those who are familiar with the series may know and that's because i now have root motion capability on my character so i can walk back and forth and the camera follows right the camera follows the character from the root component so it follows the capsule collider so the way you know the root motion is working is i can do an animation that moves me and when i finish my capsule collider also moves to where that animation is that's what root motion is you might have heard me refer to root motion as just an animation that is moving from its you know moving out of place that's actually not totally correct root motion is when the root of the character follows the animation follows where the animation takes the character so if you have a character walking when he's done with his walk animation then he should leave off where he was walking to okay so you can see i've got my hurricane kick the hitbox will come in the next episode uh the next fighting game episode one right after this which should be episode 54. so ignore that for now fight um but yeah so let's get into how to implement some root motion i just wanted to give you a large overview before we get started because this is going to be quite a bit of work and i felt that it needed some explanation so root motion requires basically something called root on the skeleton if we go to uh our character skeleton now this is what ours looked like before mutant skeleton when you download a character with the skeleton off of mixamo it starts with the root of hips if i were to close the top area here you see i have hips well hips is okay but unreal specifically wants you to have a root up top so if i go and i click into my mu t pose skeleton i have a root above the pelvis now this pose is a bit of a problem for us if we've been using miximo animations because i did not realize this but you have to have since mixed mode does not start with root we need to find a way to get our skeleton to have root in it and then all animations after that of course have to line up with the skeleton that uses root so now we have to add a new thing to our chain uh to be able to put in an animation from miximo into our game if we want to support root motion now quick thing i should say before we get into it if you do want to add root motion but you don't plan on keeping mixamo animations for your whole game i would not do it here you know i want to be completely honest so this method works and it's nice but it's you're going to essentially have to rewrite the entire nmbp it's going to be the same logic but you're going to have to duplicate it and when you duplicate an animation blueprint in unreal you have to set up all the new and notifies since there will be a new skeleton and things like that it's going to be a pretty long process it took me about two hours just to get into the state so i did not realize that root was required to be a part of root motion i thought it could take just the root bone but it cannot unreal specifically need something called root so anyway the way this works is pretty annoying but what we're gonna do is we're going to we're going to download a free program that someone has offered um and we do have permission to share it change it and publish it so i'm not going to be doing all of that i'm going to be giving them full credit but we are going to be using it today so i have a download link in the description let's go to that and also go to miximo but i have this download link in the description and when you download that you should get this mixed mode converter master now miximo converter master you don't have to unzip it this is going to have a readme if you do unzip it so you'd have to extract it but you can see the readme here and this will give you all the instructions you need this is very helpful this is what i use to follow it but i'm going to make a video i'm going to actually show you in this video how to follow these instructions i'm not going to have the instructions open but if you get lost at any point or if i'm not making sense feel free to use the instructions in the readme otherwise you do not have to zip it though or unzip it you can keep it as is so open miximo and open blender blender is another free software you don't have to be a student or anything you can just get this for free we do need blender because that is a blender plug-in and that's how we're going to change the skeleton so go ahead and open up another tab i'll put the link in the description but you can just go blender download and it'll come up right away i went ahead and downloaded 2.91 you don't need this version however you do need above 2.78 is what the readme says so if you have 2.78 or higher you should be good to go okay then once everything's installed once you have your zip file downloaded and you have blender installed open up blender and you'll get some stuff it'll ask you oh what are your preferences in blender whatever you can put whatever you want doesn't matter then you'll eventually get to a scene that looks like this i've not added this cube it's there by default but the cube doesn't matter so if for whatever reason you don't have it there it's not important what we want to do is add our plugin that we downloaded to blender so that we can import our skeleton and outboard it with the root bone what we do is we go to edit preferences and then install and then it will give you it'll ask you to go to your file path i'm going to go ahead and choose downloads and here's my zip file just go ahead and install add-on on your zip file now it should automatically bring you to it but if it doesn't it'll exit this menu and once you're here all you have to do is select the thing that you want so it's called animation mixamo converter so you can either scroll down and get to it you can search for it if you have a lot but i don't think you'll have too much i'm pretty sure these are all the basic blender ones so it should look pretty similar the only one you actually care about right now is animation mix mode converter if you want to double check that you have it right just make sure you can click down this arrow and read the information this is what it should look like but make sure that it is installed it's got its check and you're good to go now once it's installed you'll be able to access it and all you have to do is click anywhere in the scene here and click the n key now for the record i'm not by any means an expert at blender in fact this is the first time i've ever opened it so you know feel free to if you know a better way to do any of this let me know or just go ahead and do it this is just i'm showing it this way because this is how i know to do it so you press the n key and then it could differ where it's on your screen depending on how your setup is but look for this little pop-out window when you press n there should be something that pops out and it might look like this where it says transforms and stuff you want to look for a tab that says miximo and then here is our converter we've got a bunch of different settings and i won't really cover everything because it's a lot of it's pretty self-explanatory but there's a few things that weren't self-explanatory for me so for one uh the hip name does not need to be a thing the hip name is if you're not a miximo rig as it says so essentially what uh what node needs to be adjusted to work in this fashion to get a root node to get it where it can use root motion without you know if you don't have the hips or the pelvis as the default node like the miximo skeleton does but we don't want to do remove name spaces we want to use unreal engine bone names that's one we care about i also removed fix bind but i have no idea if that's actually important or not i was just trying to get rid of all the things i could to make this as simple as possible fix bind worked fine with me not using it i left everything else the same for the skeleton we're going to import the skeleton first then we're going to import the animations so go into miximo now and you can pick your character and you can pick your animations i've already done it with the mutant and it's working so i'm going to pick someone else and hope that it works as well if i pick a skeleton doesn't work then i'll be sad but let's do it on the spot so this guy looks pretty cool vampire a lust so if you just go ahead and download the character you can choose between all these types and the pose we want the t-pose and we want to go ahead and just pick whatever type that's interesting for us i usually just use fbx binary go ahead and download that okay and then we have the the file let's go into our file explorer and let's go ahead and edit this and let's call this vampire t-pose okay this is our skeleton vampire t-pose so you see i have my skeleton here now let's go into blender real quick what we're going to do is essentially import or remove our skeleton into this input folder and then the converted skeleton is going to pop up in the output folder so you need to set two paths i went ahead and made two paths in my downloads folder i made a test and inside the test i made it completed now these are the things i've converted and converted properly the skeleton as well as some animations i'm going to clean up a few of these because when you do these then it gets longer and longer every time so i'm going to get rid of all the animations i put on the mutant don't worry they're still unreal i'm just getting rid of them so they don't get converted every time so just pick two two folders um i'm gonna pick like i said test you just go into the folder and hit accept and same with output test completed accept then go into where your animation is and put it into the test folder the folder that is in the input path here and then you're good to go so go ahead and check fix bind i should be able to just batch convert which should convert my new fbx file then i should be able to go back into completed copy this bring it into my vampire folder after i delete the old one to avoid confusion unreal will pick up on it and ask me if i want to import this we do then when we're here now we have our character in here and you can see he's got the root bone the root bone is what we need that's how we can apply root motion so now the root bone is here we are good our root bone is what gives us access to be able to use root motion as we've discussed and now this character has it his normal skeleton would be starting at the pelvis or the hips or something along that line and he would not have access to it now if we go to our retarget manager and hit select rig select humanoid rig you can go ahead and see where everything's linked up i did not have to change anything here and it doesn't look like i'll have to change anything here this time either however the readme and the other video that i mentioned both say to change some things because they have some values that are empty i don't know if it's because i'm using a new version of blender or if something in miximo changed but i haven't had to change anything either time regardless feel free to go to your retarget manager select the humanoid rig and check these things out make sure that everything's where it should be now the last thing we need to do is actually just apply an animation make sure that it's uh doing root motion and then make the animation blueprint with this new skeleton so let's start by getting an animation that we want i'm going to close out of my other skeleton because this is my mutant skeleton but it looks good at this point this is my original skeleton you can see without the root okay now we're good we have our vampire in here i'll save them why not okay let's go ahead and find an animation for our friend that we want now a good way to do this is to just go to animations with the character still selected and find one that you want that has root motion i don't think there's a way to like specifically search for root motion but it's pretty obvious when there is root motion basically you look at where the character is and if they're moved from their starting point there's you know there's root motion that can be applied there so i won't do one with height because one with height is a little bit different it will still work using this method but it's going to change like oh on ground and settings like that and i think i might do another episode covering additional things there's a there's a bunch of specific cases and it's kind of unfortunate now if you're animating your own characters or if you if you plan on not using maximo animations you won't have an issue with this but if you're stuck with miximo animations for now like me while they are good it does give a little bit of headache because you know you have to be so specific but you'll get the hang of it i got the hang of it after about an hour playing with it and then now i can do it pretty much instantly so let's go ahead and find an animation with root motion um we can pick anything really it doesn't matter like a walk is even fine but i'm trying to have one that's not it doesn't have any rotation and i don't think this does this appears to be in one straight line let's go ahead and get one that's straight like this i'll go ahead and download it i'll keep my fbx binary without skin i don't need the skin i'll put it to 60 frames per second uniform or non-uniform it doesn't matter again i usually do none but we should probably reduce them uniformly it would be the best performance wise i'm going to download it just like this okay we have our drunk walk animation so now if we go back to downloads we have drunk walk so we want to go vampire drunk walk i want to copy this into test as i have you can delete the other ones now as long as you're happy with them or keep them in this case i'll keep it just to show you nothing bad happens if you don't but you can feel free to delete them at this point they're already converted in and in unreal let's go back to blender now that we put our thing in test now this is what was giving me some issues and it says the comment here whether to transform transfer sorry whether to transfer rotation to root motion should be enabled for curved walking animations can be disabled for straight animations now it says can be disabled for straight animations where in my personal experience it should be disabled for straight animations if you don't disable this i could not get a single animation to look correct now i don't know if i'm doing something else wrong so it's very possible but go ahead and get rid of transfer rotation and then you can keep apply rotation down here we want to apply the rotation of our character we just don't want to transfer the rotation into movement okay we want to walk in the same path that we're walking in that the animation is showing if the character is rotating and all during that like he probably will since this is uh someone intoxicated walking then we want to apply that rotation we just don't want to transfer the rotation to movement now we can go ahead and batch convert only takes a few seconds and this is with three things in there if it was one it would only take seriously about five seconds but three files converted as usual we can go into completed grab the file we want open up the other file where we're going to put stuff and i should have like an animations folder here so just just for the sake of it animations we'll do that then let's go ahead and add it right there okay now if we go back into unreal you can probably guess what's going to happen we have to add our correct skeleton on the vampire a lust skeleton which you can always rename these later but that's the skeleton i keep everything else the same and i import all okay it's done so we go into art vampire animations and here's the drunk walk animation so you can see that he is moving in the animation which is good he's got he's clearly has the potential for root motion here but if we were to play this animation just like this and unfortunately i don't have an animation blueprint set up for this guy so i can't show you what it would look like in the fighting game right now but you can clearly see that he's moving this is his origin and he gets all the way over here there's no doubt about that all you need to do to check if your if your stuff worked is go down on the animation you have your asset details which should be open by default when you open an animation scroll all the way down to root motion enable root motion and then you can see that it looks like he's walking in place this is actually good the unreal camera goes ahead and follows follows the character so you can see he's moving he's not really moving but that's okay it's because his animation is not moving on its own it's going to be moving the capsule collider or whatever the root of your character that you apply it on and that's how you'll know that your root motion is working now as long as this animation looks good as it does now like it looks like it's valid you don't have anything weird going on with the animation then successful once you put this animation in he will walk with the walk with the root motion now another thing to talk about with this so now i got to go back to my mutant to show you some stuff but that's importing it this is working correctly if you can play your animation with root motion enabled and it looks like he's moving in place that's actually what you want to see this means that he is waiting he's essentially waiting for the root component of the character to be able to move he doesn't have that here so you're not going to see any movement but when you put that in the game it'll look good i'm going to close out of these because these are good and i'm going to show you some stuff with the mutant now now if we go into our mutant i have something called mutant and bp root motion for those that are familiar with the series mutant animbp is my main animation blueprint i went ahead and i copied the entire mutant and bp again it took about two hours now you can just click in here ctrl a see everything highlight ctrl c just add new animation animation blueprint you'll have to select the correct skeleton so select your new skeleton that's got the root motion in my case of the mutant i was using mutant skeleton i now have to switch to the mutant t-pose skeleton um and then once you go in here you can control v and paste everything now obviously i don't want to do that because i already have it in there so i just undid it because i got nervous that i was going to save or crash and then that was going to be there forever but it's the exact same logic again my logic isn't important for this episode but i'm just showing you i i didn't change anything with the mutant atom bp it's the same animation blueprint but you have to make a new one with the skeleton unless unrealist chain something that i'm not familiar with at this point then you have to make a new one it's a big complaint that people who are using unreal have and i agree it's kind of silly you need to be able to change the skeleton and it needs to be able to just change the available animations and that's it it should be able to keep the rest but the way it works unfortunately we can't do that so you have to rewrite all your functions and you can copy and paste i did that but it's still going to take some time make sure you promote all your variables back to variables and then unfortunately your state machine you'll also all your transition rules will stay and everything like if you you can actually control a control c in here but you will have to change out your animation for all the animations that you download from miximo with the new skeleton or with the converted method if you had all your animations in your folder still you can just pull them out know exactly what animations they are from mixamo download them convert them and put them back it really won't take too long again it took me about two hours to rewrite this whole thing it's not too bad but it is a pain in the butt the good thing is with this method now in place now we can have root motion and let me show you how we actually activate root motion on the animbp because you can have root motion on the animation and there's still no root motion occurring so if you go in class defaults anywhere in your animbp you have a section called root motion and a setting called root motion mode and it's normally no root motion extraction ignore root motion or root motion from montages only i can't remember but all three of these will not work for the way that we've set up our character you need root motion from everything now but i will say root motion from everything does not support networking at the moment well it does support networking or networking does support it rather but it's not as optimal and ideal as root motion from montages only so there's a very good chance if you want to have root motion you should do it in an anime montage the good thing about that is doing an anime montage is not going to screw up our state machine it's very very easy to switch between them and we are going to be going over mon root motion with montages and just montages in general so don't worry that's not going to make you rewrite your nmbp or anything in fact it's not even going to be a major change we just might have to learn some stuff that we're not really we haven't done before but for now root motion from everything if you don't have montages in there just so that you can see it working when you switch it over once we get montages in then we'll be good to go networking wise and no problems there but now just to show you that it is in fact working um let me go to my hurricane kick if i could find it it's this one right here okay so just to show you that this does work it looks like he's in place right but that is what you saw with root motion at the beginning okay these and notifiers are related to the fighting game and not this episode so don't worry about that um and i want to show you what could happen with certain animations now this appears to be a part of the converting issue and i've only seen it about one out of eight attempts eight animations i downloaded but for some reason this animation becomes very jittery this is one of the things that i'm not entirely sure what settings are should be used to fix this if any can but there are certain xml animations that have this effect it appears to be a lot less than you know actually work normally but just be careful if you see this it will look like that in game which obviously looks bad so you may need to adjust some of the logic what i will say is it's not a root motion thing it is literally when that animation gets converted it looks weird now but yeah i kept that in there to show you guys all right guys that's about all i wanted to cover for today i am going to be getting into some air combat and some juggling in the fighting game tutorial and when i do that i'm going to need some more root motion on animations in the air and things like that so i may very well come back and do another episode on how to refine this process for different types of animations such as the issue we just saw or maybe air combat and things like that but before i get a full grasp on it i don't want to lead you astray that's what i know from now that's worked for me for about however many animations this is 41. so i'm confident in this method and i'm confident that this will work okay but just be sure when you're applying root motion on animations that they get converted and all your all your animations even if they don't have root motion will unfortunately need to be converted at one point or another so that they can have the proper skeleton we are using now anyway guys thank you so much for watching if you enjoyed and this helped you apply root motion to your characters and in a way that you found was nice given the circumstances no method is nice here as far as i'm concerned when using miximo animations please subscribe it means more to me than anything else you can do for this channel and i just really really appreciate it so thank you so much i want to give a huge shout out to my youtube membership and patreon supporters thank you colton for the new uh patreon support patreon subscription appreciate that and yeah just thanks for believing me and giving me the support to do episodes like this where i want to tear my hair out redoing two hours of work that i did not realize would have to happen just because i was using miximo animations if you did have issues with this episode or any of my tutorials feel free to join the discord the link is in the description we'll be able to get you sorted for any problems you have and and you'll be good to go lastly guys if you want to come support us on twitch we're finishing demon souls this week as well as starting a new horror game on friday we'll see what that's about but anyway guys thank you so much for watching i'm sean the bro and i'll see you in the next one goodbye guys [Music] you
Info
Channel: Shawnthebro
Views: 2,795
Rating: undefined out of 5
Keywords: Shawnthebro, Shawn, the, bro, Shawn the bro, video, game, video game, Shawn thebro, stb, shawnthebro27, root motion ue4, root motion unreal, root motion blender, root motion, root, motion, root motion unreal engine 4, unreal engine 4, unreal engine, ue4, unreal, engine, root motion mixamo, ue4 root motion mixamo, mixamo root motion blender, unity, ue4 root motion, mixamo, animation blueprint, animbp, anim bp, animation, blueprint, root motion not moving character, not, moving, character, enable, move
Id: F5T1cPqDoQo
Channel Id: undefined
Length: 28min 13sec (1693 seconds)
Published: Fri Feb 05 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.