How to Get Models and Animation Packs from Mixamo to Unity

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
In this video you will learn how to download and use characters, animations and animation packs from mixamo.com and import them into unity properly and you will also learn about the difference between the animation settings. Ok, so first let's open up unity hub. here we gonna create a new project, choose 3D, choose where you want it. and name it whatever you want. I'm gonna call it "mixamo imports", then click create. Now once the project is open I'm gonna right click on the project hierarchy. create. folder. And I'm gonna name it "characters" and in the same way I'm gonna create another folder and name it animations. Let's also make it bigger. Now I'm gonna open a browser. type in mixamo.com. click enter. if you already have and adobe account you're gonna sign in and if not you're gonna sign up for an adobe account and then log in, I'm gonna click log in. Enter you adobe account email address. click continue. enter your password. click continue. and here you have all the characters and animations that you can download. If you're interested in checking out an overview of everything you can do in this website then check out the link down below in the description. Now, here we're gonna download a character by going to characters. I'm gonna search for a specific model. so we we're gonna go to search and type in "paladin". click enter. and here we have two options: we have the normal one and the one with the props. so we gonna download paladin with prop jnordstrom which has a sword and shield. we're gonna click on it and here you have an overview of him where you can check him out from all angles. so you can rotate around and pan the camera and zoom in and out. so let's click download. in format you're gonna choose FBX for Unity. in pose you can choose T-Pose or Original pose. I'm gonna download both of them to show you the difference. so first let's download FBX for Unity and T-Pose. Click download. Now I'm gonna go to my downloads folder by opening the file explorer. go to downloads and I'm gonna rename this by right clicking on this and clicking rename to "paladin TPose". and then click enter. and I'm doing this so I can know the difference when I'm gonna import them. You don't have to do this. I'm gonna minimize this. I'm gonna download the same model again but this time choose FBX for Unity and pose Original Pose. then I'm gonna click download. now again I'm gonna go back to my downloads folder and rename this to paladin original pose. then click enter. so now let's minimize mixamo. and go back to unity. here go into the characters folder. open the downloads folder. now you can select them and then drag them right into the project hierarchy in unity. so let's minimize this. as you can see we have them over here. we have the paladin with the original pose and the paladin with the T-Pose. I'm gonna select them with the left mouse button and dragon them into the scene then release the left mouse button. click "F" on the keyboard to focus on it and as you see he's missing the textures and the models and let's do the same with the other one. move him a bit so we can see both of them, as you can see both of them are lacking the models and the textures. so the way we fix this is by going to the model you downloaded. here in materials you have a few options. so in material creation mode you're gonna make sure it's on import via material description. you also have standard and none but make sure it's on import via material description. In location, you can choose between use external materials and use embedded materials. you're gonna make sure that it's on use embedded materials and as you can see. right now it has paladin mat which stands for materials. it says none. so what you need to do is click extract textures. you can extract it to any folder you want but I'm gonna extract it to the characters folder so it's gonna be in the same folder with the model. then you gonna click select folder. if you get this window all you gotta do is click fix now. as you see now the textures are imported and it repopulated the models with the textures but they still don't have materials so let's do the same with materials. you're gonna click extract materials. select folder. so we're done with this guy. and the other guy populated himself with the same textures but if we click on him, you can see he doesn't have a material. you can use the same paladin material if you want or you can click revert and then extract its own textures and materials. so let's click extract textures again. click select folder. fix now. extract materials. select folder. and we have both of the populated with their own textures and materials. as you can see because it's the same model It's the same textures and materials but if it was a different model then you will have different textures and materials so here I'm gonna right click on paladin original and click properties so we can have the properties window separately. and I'm also gonna do the same with paladin T Pose. Right Click. Properties. Then I'm gonna move them side by side so so we can check all the different options. as you can see in the materials tab everything is the same. In the model tab also we have the exact same options chosen and the exact same options to edit. In rig again we have the exact same options. and if we go to animations you can see here it's also the exact same options. so the only difference is that in the original pose we have just take 001 clip imported and here we have take001and mixamo.com clips imported. but if you play them you can see it's just a t pose on both of them so they don't really matter. what this means is it doesn't really mater if you import t pose or original pose because original pose will most likely be T pose anyway. but I recommend to always get the T pose just to be sure. but here as you can see we have these animations imported. that is just a T pose of the model. we don't need it so if I'm gonna move those to the side and click this arrow next to them. here you can see the T pose has two animation clips and the original pose has one animation clip and the clips do absolutely nothing so we don't really need them. what you gonna do is uncheck import animations then click apply. and now if we open the arrow here. you can see the animation clips are no longer in the model. which makes it a little bit cleaner. and here on the preview you can see that the original pose and the T pose are the exact same pose. so it is basically the same model. so now I'm gonna close those windows by clicking X. and let's delete the paladin with the original pose. and keep only one of them. go to materials. paladin mats. so let's delete him and all his textures. those ones. I'm gonna select them and click delete. make sure you keep all the textures and materials that are linked to the model that you keep. Now here I'm gonna do one more thing. I'm actually gonna duplicate this paladin by clicking ctrl+D and change its name by clicking on it after it's selected to paladin TPose Generic and change the other one's name to paladin T Pose Humanoid. then let's delete this one and add those two to the scene. move it a little bit to the side by selecting him and then moving with the red arrow. then dragging him around the scene. and here I'm gonna right click them again. click properties on both of them. Now let's go to Rig and keep the T Pose Generic on Generic and animation type and on the humanoid we gonna choose animation type humanoid. here you have an avatar definition. you can copy for other avatar or create from this model. you gonna choose create from this model. skin weights you can choose standard 4 bones or custom. you're gonna keep it at standard 4 bones then you can choose optimize game objects or not. if you select it, then you get extra transforms to expose and you can choose which one you want. you also get this error: not enough bones to create a human avatar, it requires 15. so let's disable optimize game object. then click apply. and now if we move this around, you can see this one created an avatar which didn't exist before and since this one doesn't have an avatar, then it still doesn't have an avatar as it is generic. however if we want to use the avatar we made. we can also use it on another model. here in avatar definition you can select copy from other avatar and then select the paladin T pose humanoid avatar but if you select it then you need to change it to type humanoid which we not gonna do because we want to see the difference between generic and humanoid. so click no. here select again no avatar. click apply. basically the difference between a humanoid and generic rig type is how they gonna handle the animations. when you choose a humanoid you will have access to bake in animations as I'm gonna show you once we gonna download some animations. so let's close this windows. so now let's go back to mixamo. go to the animations tab. unfilter the paladin by clicking x. here in the search I'm gonna type in "sword and shield walk". and then I'm gonna select this walk. here make sure you tick in place and keep all the other options at default. click download. here we gonna choose fbx for unity. frames per second: you can choose whatever you want. I'm gonna choose 60. Here we gonna choose without skin. Keyframe reduction: none. and click download. now here we gonna also get a couple more animations. so let's type in sword and shield run. I'm gonna choose this one. click "in place". keep everything else at the default. click download. same options: fbx for unity, 60 frames per second, without skin and none. then click download. Now I'm also gonna get an Idle. so sword and shield idle animation. type in search sword and shield idle. let's get this one. so we gonna click on it. keep everything at default. as you see here we don't have in place because it's already in place. click download. again the same options. download. and let's also get one attack. so sword and shield attack. click enter. let's click on this spinning attack. click download. again same options. download. then I'm gonna go to my downloads folder and rename all the animations. now let's search for a run again. and download the same run animations but this time without checking "In Place" so I can show you the difference. click download. download. I'm gonna rename it to "run no In Place". and one more thing I want to show you is if you check "In Place" again. and download this one again but this time where it says skin you're gonna choose with skin so you can see what's the difference. click download. and let's rename it too for convenience sake. I'm gonna name it "run with skin". so now let's go back to unity. go to the animations folder. here you can right click and select import new asset. go to your downloads folder. select all the assets you want to import. so I'm gonna click on walks then shift click on run with skin. it's gonna select all of them. then you gonna click import. and here you see it imported all the animations. and as you can see, they all look the same except this one and the difference is that this one also imported the skin. so for example if we open walk. we have hips and mixamo. and if we open this one. we have hips and all the models and also mixamo. so if we drag this into here, you can see it has its own skin. what you generally want to do is import the character alone and then the animations separately without skin. but if you only want to download animations, then you can download one of them with the skin and all the rest without skin because there is no point in having the same skin multiple times downloaded with different animations. so let's delete him. so basically when you download an animation with skin you can use its model skin which is the character and you can also select its animations to be used with other models. But as we already downloaded this without skin, we can select it and delete it. click delete. now before we can check the animations, there is one thing we need to do. which is to add an animation controller to our models. so let's select them on the hierarchy. here you gonna click add component. type in animator. and you see it filters out to animator. you gonna select it. and you get this animation controller also known as animator. and you get the animator options here. you need a controller. so let's make one. you gonna right click here on the project hierarchy. create. animator controller. let's call this one AC_Paladin_Generic. and then we can select it and click ctrl+d to duplicate it or cmd+d on mac and rename it to AC_Paladin_Humanoid. then we gonna select the T Pose Generic. where it says controller you're gonna click the dot and select AC_Paladin_Generic. then leave it as it is. then we gonna go to paladin T Pose Humanoid. as you can see it already has the avatar applied. controller. AC_Paladin_Humanoid. and here you can see you also have the apply root motion option. what this means is whether or not you want the root motion to be applied once the character moves through animations. or if you want them to just play animations in place and not affect the world space that the characters move in. so now how do we add animations though. how can we check them. we need to have the animator and the animation windows open. so let's go to window, animation and here you have animator so let's click on this. this gives us the animator tab. you can drag it. I like to have it here down below next to project. and let's also click window, animation, animation. and drag it to the same place. now you see this is empty when you click on animator, because we have nothing selected so let's select paladin T pose generic. now you see we have the animator chosen. the base layer, any state, entry and exit. here we can right click, create state, empty, we can select this and then here on the top we can call it run. click enter. and now as you can see it updates here but it still has no animation. here where it says motion. you can select the white dot. and here you see all the animations are named mixamo.com. down here you can see which one it is. so assets/animations/walk.fbx, run.fbx. run no in place and so on. let's select the run and once you have an animation added. you can go to animation. select the one that you have the animation on and you see now you have the options here that give you a preview of the animation, so you can click play. and you see it runs. and as you can see the other one is completely messed up. so let's stop this. select the other one. animator. and let's give him an animation too. right click. create state. empty. click on it. change this to run. select the same run animation. now let's go to animation. select the T pose humanoid. and if we play it you can see, something is wrong. it doesn't work on this model. and the reason it doesn't work is because the animation is generic and not humanoid so what we need to do is go to our project. here we gonna rename everything just so we have a better reference. so let's add G in the end of it to mark is as generic. and then we gonna select all of them. I'm gonna click the left one. hold shift, click this one to select all of them, click ctrl+d, now everything is duplicated, and I'm gonna rename them for H standing for humanoid. now select all the humanoid clips. go to rig. and here where it says animation type, I'm gonna click on this and change this to humanoid. avatar definition. I'm gonna click on this. copy from other avatar. click the white dot. select paladin T pose humanoid avatar. click apply. and now if we go to animation again and select the T pose humanoid. click play. you can see nothing happens again. that because we didn't update his clip. so let's go to animator. select the run. select the white dot. and here instead of run g we need to find run H. so let's find run H. select it. now let's go to animation again. and select the T pose humanoid. and click play and nothing happens again. so what can be the problem here. and the reason it still does not work is because unity doesn't really find the difference between the different animation clips as they are all named mixamo.com. and to illustrate this problem I'm gonna go to this paladin t pose generic. you can see it has the mixamo.com read only. if you click play it plays it but if we go back to animator and try to add another state. let's call this one walk and choose the walk motion. here we have the walk G. let's select this. what should happen now is if we go to animation and select the paladin t pose generic, we should have 2 options to select here, the 2 animations that exist in the animation controller. but since they are all named mixamo.com it doesn't really find them so we need to fix this issue and the way we do it is by renaming all clips. so let's go back to project. and here as you see that we renamed these animation models. it doesn't actually rename the clip as we can see if we open it by clicking the arrow. we still have mixamo.com. so how do we rename this is we click on the main animation. go to animation and here you see where the animation clip icon is. you see clips mixamo.com. click here, delete this and call this attack_g. click enter. and as you can see now the clip name is changed. but you need to apply it before it takes effect so make sure you click apply. and now if we open the arrow, you can see the animation clip has updated. so let's do it for every animation we have here. rename. click enter. now if you forgot to click apply and you try to move on, for example click the arrow you see it's still mixamo.com even though we changed here, but if we go to another one. unapplied import settings. you get a warning message and you can click apply. and now if we open it again, you can see it updated. so let's finish doing it for all the other animations. ok so now after some time, we finished updating all the names. as you can see. so if we go back to paladin t pose generic and go to animation. now you can see now he has run g and walk g so the animations now populated properly because they are on a different name. so you need to make sure that your animations have different names so you can select them and update them. note that you need to reselcet the animation to make it update into the model. so now let's select the generic mode. choose the walk animation and play it. so now we can play the walk animation and if we go to run. we can also play the run animation. both animations work on the general model. let's go to T pose humanoid. and here we have run humanoid. and if you click play, you see that he updated his transform. so let me show you again. I'm gonna move him back. if we click play, you can see he runs but his position updated and the reason it updated is because we have apply root motion ticked on so let's move him again. disable apply root motion. and after you disable root motion select run H again. to make sure that it updates the apply root motion disabled. click play. and now as you can see, he runs in place instead of updating his position . so now let's go back to animator. and here create another state. and let's add the run g. and let's go back to animation and select the t pose humnaoid. here we have run g and run h. if we select run g, you can see you get a warning: some generic clicps animate transforms that are already bound by a humnaoid avatar, these transforms can only be changed by a humnaoid clip, and you can see he got also totally messed up. you see his helmet is of, his shield and sword are in the same hand and if we click play, you see he gets stuck. and this is because we're trying to run a generic animation on a humanoid model. but if we go back to run H, and click play. the animation works, although it requires some tweaks. and we check with the generic model again and do the same one here, let's say we gonna change the walk to run H. and click on him. and go to animation. if we select run H. you can see, his missing all those stuff. if we click play, it doesn't do anything but if we go to run G and play he runs the generic animation properly. so let's see what will happen if we add an avatar to him but keep generic rig. let's click on avatar. click paladin t pose humanoid avatar, then select run H. as you can see he got messed up again, even though now he has an avatar. and if we click play, you can see that the animation does work but he runs from side to side instead of running straight so it is not really a desired result. you can see now this works but if we go to run G , because it now has an avatar and we play, then it doesn't work. so as you understand you can have a generic model with no avatar to run generic animation clips or you can use an avatar but then the generic animations will not work so you will have to change them to humanoid. and also if you make a humanoid rigged model then it will only run with an avatar and only run animation clips that are set to humanoid type. so let's change the generic back. let's go to animator. change this to walk G. now let's select the animations again. Walk G. Doesn't work because we forgot to select him and remove the avatar by clicking on avatar, then choosing none. let's select this again. and you can see now the animation works fine. let's select run. and you see the animation works fine. and he runs in place. so now let me show you what root motion does when you have a animation clip that moves the position of the character. so I'm gonna go to animator. Let's delete this walk. click on the run. and change the clip to run no in place G. then do the same thing to the humanoid one. delete the new state. choose run. here I'm gonna choose Run no in place H. now if you select the T pose generic and click play, you can see he runs forward and goes back. this is the animation clip. and if we select the paladin T pose humanoid. and select the animation and click play. he still runs in place but a bit differently. and this is because we need to apply root motion . so let's stop this. apply root motion. select the animation again and click play and now you see he updates his position and starts running. and this is because humanoid rigged models need to apply root motion in order to allow the root motion to update the position of the model. so if we now go back to generic. and if we apply root motion. let's see how it looks while play mode is active. so let's start play mode. click play. and you can see both of them ran but stopped and this is because we forgot to enable the animation to loop. so let's stop this. go to project. select the run no in place. go to animation and make sure loop time is checked. so let's check this and click apply. and do the same with this one. loop time. apply. so here we can see we apply root motion enabled on both of them. so let's see what happens when we click play. you can see the humanoid one keeps going forward while the generic one keeps going back to place. you can go to scene. focus on the generic and as you can see, he keeps resetting his place while the humanoid just keeps running forward and forward and forward and forward. and this is because root motion can not be applied to generic animations and can only be applied to humanoid animations. now let's disable root motion on both of them. and click play again. and see what happens. let's go to scene view. and as you can see the generic model does the same thing but the humanoid model is now stuck running in place. and this is because root motion is not applied. so that is another difference between a humanoid and generic model. which is that the root motion can be applied to humanoid models but can't be applied to generic models and clips. now let's go to the T pose humanoid and click play and if we check the scene view we can see that he stands in place and rotates and if you choose this animation clip in the hierarchy. this one. and while this is playing let's right click on the animations and click properties on both of them. so here we have the generic and here we have the humanoid. as you can see most of the settings are the same, except generic one has resample curves option which the humanoid doesn't and the humanoid one has the bake into pose options which the general one doesn't. so here we can play around with those options and see how it affects our model and animation. so let's say we want to allow him to move. we can bake into pose X and Z. check this. click apply. and now as you can see he can move on the X and Z axis. and if we enable all of them, the animation looks more fixed and he's more like the generic one. he runs the animation back and forth. now if we disable the X and Z. click apply. now he runs in place without moving even though the animation actually has a built in move forward into it. so what those options do? let's disable them all. now he runs completely messed up because he doesn't have root motion applied and he doesn't know how to rotate his joints. so here where we have root transform rotation. if we click bake into pose. it will actually let him bake the rotation into the animation clip instead of root motion and when you click apply. you see now he runs much better. and here you have a green light which gives you a recommendation whether or not you should enable the bake into pose. in most cases it will be good to listen to the recommendations although you don't have too if you need different scenarios. so let's also check bake into pose Y. Click apply. and now you see he runs with a bit higher steps. so root transform rotation will actually allow the rotation of the joints, in most case you want this ticked. root transform position Y will allow the Y position of the root transform to change and root transform position XZ will allow the x and z positions to change. so if we bake this into pose, you will see that he will be able to move forward and will also be able to move to the sides. so let's uncheck XZ and click apply. and here you have another option that is not available on the generic run which is mirror which basically changes the way the animation looks as if you were looking in the mirror. so if you check this and click apply. you can see now the animation runs in a mirrored way. here you can also change the offset which means from where you want this to start. so if we change this massively and click apply. you can see now he rotates around. let's return this to 0. same thing on the Y. you can see here on the preview what going to happen. so let's say we do -1.13. click apply. now he went up. let's return this to 0. apply. and the other option you have is based upon which you have on all 3 options. in root transform you can choose body orientation or original. you can play around with them. different animations will require different choices. so if you click original and click apply. you see on this animation it doesn't affect it much. so let's stop playing and close those. so now that I'm done showing you how the root motion affects the animations that change the position of the model, we no longer need the run no in place so let's select them and delete them. delete. and now we're left with 8 different animations for each type generic and humanoid. so let's go to animator. select T pose generic. and here we can add all the animations at the same time. instead of right clicking, create state, empty and then renaming and then adding a motion to each clip. we can do it differently. so I'm gonna click on the animator with the left mouse button and move it to here. you can pan around the animation controller window by clicking the middle mouse button and moving around and zoom out by scrolling out the mouse wheel. so let's choose t pose generic. click run. delete this. since we are in the generic, let's select all the G animations. so this one, this one, this one and this one. and then click on them with the left mouse button and drag them into the animation controller. and now let's zoom in and as you see now we have all the different animations instantly imported into the animation controller and they are also named properly without us having to rename. so let's do the same with the T pose humanoid. let's delete this one. select all the H animations. and drag them into the animation controller. then you can move them around with the left mouse button. holding and dragging. and after we done that we can return the animator back to the bottom tabs. here we can also right click on the idle animation and set as layer default state which means that once this animation controller starts working it will automatically choose the idle animation as the first animation. so let's sort them out like this and do the same thing with the generic model . set as default layer. sort them out like this. now let's check how all the animations look on the generic and on the humanoid models. so let's change our view on the scene, we can play around with the middle mouse button by clicking on it and moving to pan around and the right mouse button by clicking and holding and moving to rotate. let's go to animation. select idle and play. you can see this is the generic idle animation and if we choose the humanoid, idle and play. you can see this is the idle animation which looks a bit to the side so first let's go back to project and make sure that idle run and walk are all enabled with looping. so let's go one by one. click loop. apply. click loop. apply. loop. apply. loop. apply. loop. apply. loop. apply. and the reason you want to enable looping is because let's say we disable the loop time on the idle animation. first let's go to the game tab and center the camera around the characters. so let's move the camera in a little bit by changing the Z axis of the camera. let's do -3 and let's rotate the characters by 180 degrees, so they will be facing the camera. select the prefab. change the rotation in the Y axis to 180. now we can click play. you see the idle animations are playing and then they froze. again. you see how the animation is playing, once it stops playing, it froze which can be better illustrated if we change to walk. so let's set this as layer default and do the same here. then go to project, disable loop time. apply. apply. now let's select one of them. click play. you can see they walking, walking but once the animation finished playing they are no longer walking because it's not looping. so make sure that you have looping time enabled on all the animations that require to continuously play such as idle animations, walking animations, running animations and strafing animations and stuff like that. so let's go back to project. enable loop time. do the same on walk and now if we play, you can see they keep walking because once it finishes it goes back and starts again and again and again and again and again until you change the transition to a different animation or until you stop the animation from the script. you can see here the animation is a bit different. this is the generic animation and this is the humanoid animation. you can see here his head is looking straight while here the head tilts a little bit and also the shield moves a lot more in the humanoid animation while here it looks quite still. and the reason it looks like this is because the humanoid animation requires setting up with the root transform and root positions which you can see here. so if we select bake into pose with root transform rotation and apply. now you can see his head no longer tilts. now we also have him a bit rotated, so if we change this to original and click apply. you can see he's rotated even more. so the way to fix this is to just play around with based upon and offset. so let's say we go to body orientation again. click apply. and then choose an offset. so the way we spin him around is by playing with the offset. so let's say we want -50 offset. click enter and apply. you can see he turned to the side. so let's try an offset of +10. click enter. apply. now you can see, he looks straight to us. so to fix humanoid animations you will need to play with the bake into pose, based upon and offset options. let's also bake in those options as well and click apply. and now you can see the animation looks a bit cleaner and here you can see the generic animation and the humanoid animation which looks slightly different. so you need to play around with it and check them both to decide what you want in your game. but generally you almost always want the humanoid animations as they are more customizable and they also give you the option to play with root motion if you're interested in that. let's exit play mode and change the default to idle. and do the same here. and now check the difference between generic and humanoid idle. here you can see it looks straight to us but this looks a bit to the side. so we need to fix this. we can click idle H. select project then click this. and it will automatically show you the animation it is linked to. so select the animation and here again we can play around with the options. so let's say root transform rotation. bake into pose. apply. and then we also need an offset. so let's change this to -50. click enter. apply. and now you see it's a bit more to our side and if we want to line them up, then maybe take this down a bit to -40. click apply. and now it looks a bit better. and we have a loop math on those two as well. so let's bake them also. click apply. and here you see the generic idle and the humanoid idle. so let's exit this. set the default to run. and do the same here. now let's play this again. you can see the generic run looks clean while the humanoid run requires a bit of tweaking. so let's go to project. select the Run H. we wanna fix the rotation. so let's bake into pose root transform rotation. click apply. now you see he runs quite fine but he's rotated to the side so if we change this to original. it's a bit better but still he runs to the side so let's change the offset. let's say to 15. click enter. apply. now it looks a bit better but maybe a bit more, so let's do 20. enter. apply. ok now he's looking straight at us. but as you see, the animation still looks a bit different because this is generic and this is humanoid. if we also bake in the root transform Y, let's see what happens. now you see he's a bit more straight up. so if we disable this. he's more hunched and if we enable this he's a bit more straight up and if we do the root transform position x and z as well and apply. now you can see the animation is a bit cleaner. but you see in the run animation, we see a huge difference between the generic run and the humanoid run. here it seems with more emphasis and here it seems like he's just chilling and running. so let's stop this. and the last animation we can check is the attack so let's set this to default. and do the same here. click play. and since it's an attack it should only happen once so you don't actually want the loop time on it but for the sake of showing you the demo I'm gonna enable it. so let's enable loop time on attack too. and here you can see the generic one just goes forward while this is completely messed up. so to see it better let me move the generic one a bit more to the side, now here you can see that it does no rotation it just does a simple attack which is fine because it also looks like a nice attack so you can use it as a separate animation. you can copy the animation and play round with the root transform rotation and positions to make different animations from the same clip. but let's see what other options we can do with this. so let's select the attack H. now here even though there is no loop match, we can do bake into pose and apply. and now you see he actually does the spin because now it has access to the rotation of the transform which gives is something that is actually closer to what we actually downloaded. we can also bake into pose the Y position and if you want him to also move like the generic one on the x and z axis. you also gonna bake into pose the x and z and click apply. and now you see he also does the spin forward. however keep in mind that when you don't have apply root motion, when you do something like this where they move on the XZ axis or on the Y axis, once the animation stops playing they gonna snap back into place so you will need to find a way to play around with it to fix the snapping issue. so it will not look like it's glitchy. now let's disable this. and we want to rotate him to be looking at us, so let's change the offset to 10. click apply. let's try 20. click apply. and he's looking at us and spins the sword. and if you exaggerate it and do 100 as you gonna see, now he's looking to the right side. so I like 20. I'm gonna keep it at 20. click apply. and now we have a nice spinning in place animation of attack so let's stop playing. so now let me show you all the different bake into pose options on a preview. let's choose, let's say the attack H and here on the side you can see you have the preview, if you don't have it then you can see those 2 dots here, you gonna click on it and the preview will show up and here on the top you have these 3 dots, gonna click on it. convert to floating window and here you can see the preview on a bigger screen and you can even make it bigger, so customize it. now you can also move the camera here by holding the left mouse button holding and dragging then the right mouse button and dragging to the left to position in front of him. now if we click play, you can see what kind of attack he does. he keeps moving forward. you can also drag this white line here to check it frame by frame and to reset it to 0. here you can see how much time it takes to complete the animation, the percentage and what frame it is on. so let me show you what happens when there is no bake into pose and offset 0. if we click apply and then click play. you can see how it goes to different places and if we click root transform rotation bake into pose and click apply then click play you can see now he only goes forward with slight changes to the rotation. you can also adjust the rotation so let's say we go to -20 and apply. now the rotation is applied, so let's line this up with the line. then click apply and select play. now you can also root transform position Y. click apply and play. and the same you can do with X and Z. click apply. return to 0. and play. now as you can see he moves forward and snaps back into place. let's better check it on the run preview which stands in place. so let's go to run H. set the camera. reset those to the defaults and click apply. now with everything disabled and no offsets. if we play you can see how he runs and changes all these stuff. if we now apply root transform position Y, as you can see it's a little bit different . as you can see based on the movement of this circle that shows how he moves. if we also bake into position the root transform rotation, now you see the circle doesn't rotate at all. if we change the offset, you can see it changes where he looks based on the rotation and if we change X and Z, you see now the circle moves in X and Z but if we check this then the circle completely stops because everything is now baked into the animation and the root transform doesn't have the option to change it. so if we click apply now he's completely running in place without any glitches to the sides. so basically what those options mean is: loop time means whether or not you want the animation to restart once it finishes so in other words looped animation. if you don't enable this then the animation will run one time and then freeze the frame if you have no transition. if you have this enabled then it will run continuously , loop pose means that the animation will loop seamlessly. you almost always want to check this too, cycle offset means in which frame of the animation do you want the animation to start playing it. root transform rotation means: when it's disabled it means that the animator can't access the root transform rotation but when it's baked into pose then the animator can change the rotation by itself without the root motion. based upon body orientation means that it goes to the forward vector of the character and you can set the offset. and original just means that the offset will already be applied if the author of the animation gave you the details for it. so if the person that made the animation said that the offset should be 20 and he put it in a file. if you click original then the offset will be 20 even though it will show you 0. if you click original, it keeps the offset that you chose but if it already has 20 and you do -16 then it will actually be +4. but if you do body orientation then it will be -16. you can read more about it by going to the unity docs in this URL here docs.unity3d.com/manual/rootmotion.html and you have the explanation for all the root transforms here. basically body orientation based on the unity docs means that it's fine for walking and running animation but it might not work well for strafing which is perpendicular to the forward vector so you will have to play around with the offset to get it right. root transform position Y means that when you bake it into pose it means that the animator can change the Y position of the root transform and when you don't bake it then it means that it can not change it. and likewise with the X and Z. if you bake it into pose then the animation can change the X and Z of the root transform but if you don't bake it into it then the animation can not change it. as I've shown you on the attack with play mode. and mirror just means that it reverses the animation as if you were looking at the mirror so if we stop this and play frame by frame you see his right leg is on the floor and his left leg is in the air and if we play it he goes to his left leg, right leg, left leg, right leg. if we enable mirror, change the offset to see it better. now you can see his left leg is on the ground and his right leg is up and if we play he starts with his right leg and goes to his left leg. so this is mirrored. and this is normal. so let's close this which will return it to the preview on the inspector. now let's click play again. click apply. here as you can see both of them move so. so let's illustrate again what the attack H root transform do. if we disable all of them. and return this to 0. click apply. let's move the generic one to the side. let's select attack again. you can see with everything disabled it has no access to the Y Position nor to the X and Z position nor to the rotation. so the animator can't do the spin like the generic one does. if you bake in the root transform rotation into the pose and click apply. now the animator can do the spin because it has access to the rotation. and if you enable root transform position X and Z and bake into position. now it can also do the forward slash because it has access to the X and Z positions and same thing with the Y. now it has access to the Y position but this will not show here because it's more like for things like jumping or other things that change the Y position. another thing you can do here is go to motion and here where it says root motion node if you choose root transform and apply. now you can see all the other options are gone so you can no longer do the bake into pose and all you get is the same one as the generic where you can spin and move on the X and Z option and you can not customize it. so let's bring it back to none and click apply and stop playing. attacks are one time thing so you actually need to disable loop time on them and click apply so they will only trigger once. idle is a loop so loop time and loop pose. don't forget to enable loop pose even though I forgot at the start of the video. click apply. same thing on run. and same thing on walk. if the animation is done properly then you don't actually need the loop pose but it doesn't hurt to have it anyway. now if you go to animator and change back to walk. set as default layer. and click play. you can see the animation is seamless. but if we disable the loop pose. you can see the animation still looks fine. so you can also play around with this and check what is more suitable to you but in most cases you probably want to enable loop pose in looping animations . so now we have seen the difference between generic animations and humanoid animations and I also showed you how to customize the humanoid animations. let's quit play. the last thing I want to show you is how to import animation packs from mixamo. so I'm gonna delete the generic paladin. I'm gonna delete all the generic animations and the generic animation controller and also the generic model. now since we gonna get an animation pack, let's also actually delete all the animations. and if we go back to animator we still have those but now if we select them you see they have no motion. we don't need those so we can drag on the left mouse button by holding it which will select all and then click delete to delete all at the same time. now let's go back to mixamo. here if you type sword and shield and click enter. you see we have animation packs. this one has 51 animations ,39 and 17 animations. let's take the 17. here you see the preview of the animations. you're gonna click download. choose FBX for Unity. 60 frames per seconds, key frame reduction: none, and pose: you have T Pose and Original pose or no character, T pose means if you want the animation pack and one of them will also gonna have the skin in a T Pose and Original pose means the same thing you gonna have an animation with a skin in an original pose and all the others will be with no skin. and no character means you're gonna download just the animations which is what we want so we're gonna click no character as we already have the character imported. click download. now let's open our downloads folder by going to file explorer. downloads. you see you got a zip file. so you can right click on this and click 7zip if you have 7zip and extract here. if you're on windows 10 you can just click extract all. and similar thing on a mac you will have its own default zip handler so just click extract all. make sure you extract it to the right folder. click extract. now it will automatically open it and if not then you will have it here. double click on this, let's go back to unity, project, animations. let's right click here. import new asset. go to downloads light sword and shield pack. select all and import. since we made a humanoid rig on our character we need to make sure that all of them are humanoid so let's select all of them. I'm gonna left click on this one then hold shift then left click on this one. which will select all of them . go to rig. where it says animation type click humanoid. avatar definition you're gonna make sure you change this to copy from other avatar. on the source you gonna click the white dot and choose paladin T pose humanoid avatar by double clicking on it. then click apply. now let me show you something . if we drag again the animator by left clicking and moving it around so we can add all the animations by dragging them into the animator. here you can see it added 17 animations but they are all named mixamo.com so if we click play, you see it plays this animation but let's say we set this to default and click play again. it did play a different animation but if we go to animation and choose our character. here you can see you can only choose one of them which is the sword sheath and this is because they all have the same name so it's thinking that all the animations are the same. so what we need to do is what I showed you before. we need to rename each of the animations by itself. so the way we do is. first let's return the animator to its place. then go to project and go one by one in each animations click on it. got to animation and here where it says mixamo.com. you're gonna delete this and name it what this is. this is draw sword 1 so let's name this draw_sword_1. click enter. don't forget to apply. and while you're renaming the animations you might as well also rename this so let's copy this by control+C then rename this by control+V. enter. and do like this for all the others. let me show you another one. so for example this one. this one is idle. so let's call it idle. then copy this and paste it into here. click enter. don't forget to check loop time because it's idle. then click apply. and same thing here. this one is run. so let's call it run. we have 2 runs so I'm gonna call it run_1. Control+A, Control+C. Enter. go up, Control+V. enter. loop time. apply. now let's do one of the attacks. here we also have attack 2, attack 3, attack 4 and attack. so let's call this one attack , ctrl+A, ctrl+C, enterm go up, ctrl+V, enter. because it is an attack it doesn't require a loop time. so make sure it's unchecked then click apply. this one is attack 2 so let's name this attack 2. ctrl+A, ctrl+C, go up, ctrl+V, enter. make sure loop time is off. apply. so let me finish this for all the other animations. ok so after we finished renaming all the animations. we can go to animator and here you can see, even if we click on one of them. you see the shield block 2, attack 3 so all the motions have been updated but the names here don't exist. but before we gonna change this, let's check animations. open the drop down menu, and here you see, now all the animations are populated and we can preview them from here. so let's click play and you see run 2, strafe, attack 3. some of them require tweaking like the attack. and you need to tweak each click separately like I showed you with root transform to make them fit to your needs. but I'm now gonna show you the tweaking again as I already showed you on the single animations and it is the same process. but let's go back to animator. select everything. delete them. move the animator. and select all the animations again. and drag them back into the animator and now as you see, we have them all properly named instead of having to rename them ourselves. and you can separate them to see what each one does, let's go to animation make sure that all the animations exist again. click play and we are done importing the animation pack. now all you have to do is tweak them to make sure that everything looks fine and nice. Now one more thing that I'll show you, if we take an animation, any animation. let's say the attack 2 animation and we open the arrow, we can select the animation clip and click ctrl+D or cmd+D on mac t duplicate it which will separate it out. let's rename it to something else. let's say attack main. click enter, and let's add it to the animator so we'll be able to choose it from the drop down menu. go to animation. let's select the paladin. now as you know we duplicated attack 2 which is this one and as you can see this is read only which means you can not delete keyframes. so if I select this and click delete nothing will happen. you can't add events, you can't add keyframes, you can't change the positions of keyframes. basically you can not update the imported animations but because we copied the animation. let's go to attack main, this is the same animation. we can change it from the copy of the animation. so let's say we want to delete all the end. click delete, now if we play this you can see we changed it. and here you can also add keyframes and events which are functions that affect the animations and other stuff. So I'm gonna click ctrl+Z, and let's say I'm gonna add a keyframe that it's gonna be on the top. click record and here he's gonna be on Y. now disable record and click play, you can see now he goes up. so we added another animation on top of this animation. we basically edited the animation which was only allowed because we made a copy of it. Now, if you go back to project and attack. here you can see you have the same options with root transform rotation, loop time root transform position and root transform position XZ and mirror but you don't have any other options. so it's completely separated into just the animations without the rig and the model. and it is reacted to as its own animation so if we let's say bake into pose here. as you can see here we don't even need to apply because it's applied automatically and we go to attack 2 you can see it didn't change here because it's not linked to it. it's a completely different animation now. if we bake into pose and apply and then duplicate the animation and then select it. you can see it's already selected here. so it duplicates out the customized animation but then completely makes it a separate so you can edit it on its own. so I'm gonna delete this. let's go to our animation again and click play. let's delete these last keyframes. now let's select the animation here and let's say we're gonna add root transform rotation so he can spin and now go back to animation, select the paladin, select attack main and now he should be able to spin. as you see now he's able to spin. and one more thing I'm gonna show you is how you can use the same animation clip to make different animation clips from it. so, let's say we go to animator and select attack main as our default and then go to project and make sure it's looping, we're gonna make it looping just so we can see all the different options we can do with it, then click play. so you can see now we have a spinning attack with the sword. if we disable this. we have a sword slash. if we enable root transform Y, we have a sword slash that is slightly more up, if we enable XZ, we have something that we really don't want. if we enable root transform (rotation) and XZ together then we have a forward spinning slash and if we disable this and we apply mirror, now we have a shield attack. and if we have mirror and root transform rotation. now we have a spinning shield attack. and if we also allow X and Z. let's check in the scene. now we have a spinning forward shield attack. as you can see here, so as you can see from the same animation we can make about 6 different possible animation clips that look nice enough to be used. and the way you do it is by duplicating. so let's say we gonna duplicate this and this one will be spinning sword attack which is with everything disabled except the root transform rotation. and then we can duplicate this and then change this to spinning shield attack which is the same settings but also mirror applied. let's duplicate this and call it forward spin sword attack. so here we need root transform rotation and root transform position XZ. and we duplicate this and call it forward spin shield attack and then select mirror. now we can also duplicate this again and let's rename one of them to standing sword slash, disable mirror, disable X and Z and the other one will be standing shield attack and here we're gonna mirror and disable X and Z and now let's select all of them and add them to the animator. so here we have them and let's go back to animation, select the paladin and check all of them. so we have forward spin sword attack which looks like this. we have forward spin shield attack which looks like this. let's check it in the scene. as you can see it's a forward spin shield attack, we also have spinning sword attack which is stand still and standing shield attack, and standing sword slash which we forgot to change so let's go and do it. we need to disable root transform rotation and the same on shield slash. so now let's go back to animation, paladin, standing sword slash which is like this and standing shield attack which looks like this. so as you can see we made 6 different animations from the same animation clip base just by changing the root transforms and copying them into their own separate animations
Info
Channel: Tech Mammal
Views: 9,025
Rating: undefined out of 5
Keywords: Unity, Mixamo, How to Import Models and Animation Packs from Mixamo to Unity, Free 3D Characters, Free 3D Animations, Importing from Mixamo to Unity
Id: gYcNa73taw8
Channel Id: undefined
Length: 54min 3sec (3243 seconds)
Published: Sun Aug 22 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.