Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We are updating our Terms of Service for all Unity subscription plans, effective October 13, 2022, to create a more streamlined, user-friendly set of terms. Please review them here: unity.com/legal/terms-of-service.
    Dismiss Notice
  3. Have a look at our Games Focus blog post series which will show what Unity is doing for all game developers – now, next year, and in the future.
    Dismiss Notice
  4. Join us on Thursday, September 29, for a day with Unity's SRP teams here on the forum or on Reddit, and discuss topics around URP, HDRP, and the Scriptable Render Pipeline in general.
    Dismiss Notice

How To: Getting Mixamo and Unity to work

Discussion in 'Animation' started by cloverme, Sep 24, 2018.

  1. cloverme

    cloverme

    Joined:
    Apr 6, 2018
    Posts:
    152
    I'm writing this post because well, Animation in Unity is a nightmare for independent game developers. You found a great model, you try to use it and you have a mismatch between rigging and animations. Your character walks through walls, goes up, sinks down through the floor, etc. So, third party providers try to provide solutions by providing models that are rigged and animated. These are the best solutions, but often, the model isn't what you want or need, so you picking something else. Then you try to use Mixamo for some great looking animations, but you flail around in desperation as nothing works like you wanted it to.

    Likely, you've had the problem of the animation warping back to where you started and you search the internet only to discover that someone says "check root motion". You do, but that doesn't fix it, so you do what everyone else does and tinker away into oblivion until whatever good advice you get no longer works and you end up pulling your hair out. You see 10,000 posts about 'root motion', curves, each animation needing it's own avatar, and other spaghetti thrown at the wall of suggestions.

    (Hey, if anyone from Unity reads this: There's thousands of settings, checkboxes, dropdowns, and variables that you can set in Unity for animation and each one can throw off your animation. While the flexibility of Unity is awesome in this regard, most game developers want to drop a character into a scene and have it walk, run, or stand there without too much trouble. You need to do something to make rigging and physics with animation much, much easier. I'm sorry, but it's true).

    First, start a new project and a new scene to test your setup. I know, I know, you want to use your awesome scene that you build you drop your character in and see all the shaders in the awesome glory of your game. Sorry, spare yourself hours or days, it's just to test your character out, so new project, new scene.

    1) There's a T-pose pose in Mixamo, apply that pose first. If your model isn't recognized by Mixamo's auto-rigging, hire someone on upwork first to fix the model and put into a T-Pose. Great, download that and only that pose with the skin. If you don't have a T pose, give up now, it's a lost cause. Don't think, "well, it's close, I'll fudge it cause I try other stuff on the internet and I get close and it works". You need the T-pose.
    Pro Tip: If Mixamo doesn't recognize your FBX file, try an OBJ format instead.

    2) Import that *exact* FBX model you downloaded from mixamo into your project and add it to your scene. Not any other models you have, you need that exact model. Don't try the old switcharoo here, it won't work. The model should have the animator component added to it, if it doesn't add it manually. It will likely show up without materials applied, you can add them back later, just skip it for now. It must be the model you downloaded from Mixamo with the T-Pose avatar from Mixamo. You can't mix and match, it must be these two and nothing else.

    3) In your project window, click on the little arrow next to the model you added. You'll see an avatar down towards the bottom. Drag this avatar into the avatar slot on the animator component for the model in your scene. It might already be there, but if not, add it manually. If must be that exact avatar and that exact model. You can't get slick here either and try brute forcing a mix of models and avatars, it won't work.

    4) Click on "Select" on the model you imported. Click on "Rig". Change the dropdown to Humanoid. Click Apply. Wait, what? It worked... I know, you're expecting the errors right? You've been here before and it didn't work with the other model you were playing around with, I know, I know. If you followed the steps above, it worked without the yellow or red errors that ruined your prior weekend.

    5) In your Asset folder for the project where your model is stored, create an animation controller (right click, Create, Animation controller). Drag that controller to the open controller slot on your model.

    6) Go back to Mixamo. Your model should still be loaded there, now select the animation you want, like Walk. Download that animation. Use the import function in Unity to import that into the folder where your model is stored.

    7) Ah ah ah, don't add that animation yet. I know what you were thinking, it won't work. Okay, so click on the animation that you just imported into your project folder. In the inspector window, click on Rig, now change that from Generic to Humanoid and click apply. If you followed the steps correctly, no red or yellow errors here.

    8) In your model, double click on the animation controller you added earlier. Drag and drop the clip you just downloaded and set to humanoid into the animator.

    9) Click on your model that you added to your scene in the Hierarchy. Click Apply Root Motion, set update mode to Animate Physics.

    10) To add additional animations, follow steps 6 to 8.

    Optional depending on your project and animations:
    11) Add Rigidbody to your model, under constraints, for Rotation, check X and Z.
    12) Add a collider. Depending on your model, capsule or box collider may work best. Mesh causes a lot of additional problems, finish this step and you can tweak it later on.
    13) Add a couple of cubes to your scene to test, one for the floor and one for a wall.
    14) Place your model on top of the floor and in front of the wall.
    15) When you play your game, your character should not fall through the floor or walk through the wall.
    16) Go back and painfully add your materials to the model. You'll have to import them and then apply them. If you're lucky and placed your textures one folder above where your stored your model, they might auto-apply. If not, just put them back so your model looks complete again.

    If you've done everything above, your model won't fly into space, warp backwards during animation clips, sink through the floor, or just fail entirely. You can now copy the files into your real project and tweak from there for navigation meshes, etc.

    Good luck!
    -C
     
    VaultBoy125, Avisan, abj87 and 11 others like this.
  2. MadeFromPolygons

    MadeFromPolygons

    Joined:
    Oct 5, 2013
    Posts:
    3,592
    What about sliding feet from mixamo animations?
     
    eurobax and entropicjoey1 like this.
  3. GuardHei

    GuardHei

    Joined:
    Feb 10, 2018
    Posts:
    82
    Seriously, I don't see a problem here. For my several attempts with Mixamo, I always follow this workflow automatically, because this is what you normally set up animators in Unity and it wants you to follow such a process. maybe they should develop some third-party converters or tools to make things easier. However, they are not necessary, I would say.
     
  4. Shwashbuckle

    Shwashbuckle

    Joined:
    Jun 8, 2015
    Posts:
    3
    Great article! Following this, got me to working animations. I've noticed a strange issue with how Unity sets up the Mixamo imported animation though. Animation plays correctly in Mixamo but once imported to Unity the animation plays but with what appears to be rig bones and joint twisted so that the arms look backwards and the feet on occasions cross over and clip each other. Any ideas on what might be causing this?
     
  5. badradionz

    badradionz

    Joined:
    Feb 2, 2018
    Posts:
    21
    Hey guys, when importing my own models that came from Adobe Fuse > Mixamo I get this weird texture issue please see photo...
     

    Attached Files:

  6. pyjamaslug

    pyjamaslug

    Joined:
    Jul 5, 2017
    Posts:
    48
    Go into each material and set it from transparent to opaque.
     
  7. pyjamaslug

    pyjamaslug

    Joined:
    Jul 5, 2017
    Posts:
    48
    I just followed the process outlined by @cloverme and there seems to be a step missing. Here is what worked for me; I am using unity 2018.2.20f and working with the passive_marker_man model from mixamo.


    - Download T-pose for the model you are working with.
    - Set the rig to humanoid and place the model in the hierarchy. There should be an animator component already added with the t-pose avatar referenced, if not, add it.
    - In the Animator component, apply root motion and set update mode to Animate Physics
    - Fix up the materials (different topic, you can do it later if you want)
    - Create an animator controller and add it to the animator component.
    - Go back to mixamo and apply a new animation to the model you are working with.
    - Download the FBX and import it into unity.
    - Change the rig to humanoid
    - On that Rig tab, change Avatar Definition to "Copy from other Avatar" then in the "Source" box that appears, reference the T-Pose avatar from the model you have loaded into the scene.
    - If you want it to loop time, set that in the animation tab
    - Drag the FBX containing the new animation into the animator controller.

    Everything should work.
     
  8. abrahammakko

    abrahammakko

    Joined:
    Aug 12, 2019
    Posts:
    2
    when you download the animation clips from mixamo separately, is it necessary to download with skins or without...
     
  9. tylerguitar75

    tylerguitar75

    Joined:
    Dec 12, 2011
    Posts:
    51
    What about adding mixamo animations to your own custom animations?
     
  10. Shadex

    Shadex

    Joined:
    Dec 18, 2013
    Posts:
    89
    Couple of things to add. First : https://docs.unity3d.com/Manual/RootMotion.html A reference

    When setting up the avatar, some models don't correctly set to T-Pose. If so, Click on Reset, then Enforce T Pose twice, and the T-Pose should be correct.

    Also since Maximo uses the same bones and everything, you can setup a single avatar, then use that as the source for all Maximo models.

    In the link above, there is a animation clip inspector. For root motion, root transform postion and rotation should be baked into pose, and usually set all 3 to "Original".

    Enable IK in the layer of the animator that uses the animation, and check Feet IK. If that doesn't work, go to Animation Clip Inspector, and set Root Transform Position Y to Feet instead of original.
     
  11. Checkpoint71

    Checkpoint71

    Joined:
    Jul 30, 2019
    Posts:
    6
    i did not understand how this works; if i do the ybot with rifle aim Animation the Animation in Mixamo looks good; in Unity there is Nothing Right; Feet, Head, Hands have different positions and look crazy....

    is it possible that anyone do a Video how to do it - that the mixamo Animation is exakt the Unity-Animation??
     
  12. antk

    antk

    Joined:
    Dec 10, 2013
    Posts:
    24
    this was super helpful, thank you!
     
    mohawkalex likes this.
  13. antk

    antk

    Joined:
    Dec 10, 2013
    Posts:
    24
    i'm new to mixamo - does the asset i download from mixmo come with a character controller? the character actually ran off camera. i was assuming it would run in place until i added a character controller, transitions, etc. thanks in advance!
     
  14. antk

    antk

    Joined:
    Dec 10, 2013
    Posts:
    24
    Found out that I had to check the "in place" checkbox when downloading from mixamo
     
    mysticvalleycsa likes this.
  15. Chapmania_Design

    Chapmania_Design

    Joined:
    Jan 27, 2017
    Posts:
    8
    Your article went straight to the Pool Room. Great work.
     
  16. rogodoy

    rogodoy

    Joined:
    Jan 24, 2013
    Posts:
    17
    The best solution is this tutorial.
     
  17. Sylance

    Sylance

    Joined:
    Jan 2, 2018
    Posts:
    3
    Very clear, thanks.
     
  18. hertz-rat

    hertz-rat

    Joined:
    Nov 3, 2019
    Posts:
    71
    I've never had problems working with animation before, but the mixamo ones keep resetting their transform every time they move forward a few feet. What's causing that?

    edit: fixed it. It had to do with baking or not baking some offsets, and a loop pose setting
     
    Last edited: Apr 16, 2020
  19. jumisko

    jumisko

    Joined:
    Feb 18, 2020
    Posts:
    8
    Great idea, but why is that greyed out for me? I cannot change the transparency problem. I finally got textures through blind exploration after watching about ten youtube videos, and now I can't just fix the transparency problem! ugh. Why so hard?!?!?

    I'm using 2019.3.9. I may try an earlier build to see if it works there. I can't be spending a whole day working on one model like this.
     
    Last edited: Apr 16, 2020
  20. dropframe

    dropframe

    Joined:
    Nov 18, 2019
    Posts:
    1
    You need to duplicate all of your materials out of the prefab and then set to opaque.
    Once you have done this you can drag and drop the materials onto each game object they should be on
     
    jumisko likes this.
  21. jumisko

    jumisko

    Joined:
    Feb 18, 2020
    Posts:
    8
    Thank you, I shall try that!
     
  22. pjbaron

    pjbaron

    Joined:
    Jan 12, 2017
    Posts:
    41
    I followed these instructions but the T-Pose didn't have an 'avatar' on it (Synty Simple Zombie pack).
    Searched around and found advice on another site. Seems to be a problem with Unity 2019 (I ran into it on 2019.3.13f1)

    Posting it here to have all information in one handy thread (thanks OP!)
    1. install the Unity 2018 LTS
    2. create an empty project using that older version
    3. drag the T-Pose file into Assets, you should be able to see the avatar this time
    4. select the T-Pose in the Assets list, then Export Package
    5. switch back to your active project and Import Package|Custom Package
    This time the T-Pose should show the avatar as expected and you can continue to follow the instructions above.
     
  23. wdeprospo

    wdeprospo

    Joined:
    Aug 2, 2017
    Posts:
    1
    Thanks. I did not realize Mixamo animations did not have Humanoid checked.
     
  24. zedz

    zedz

    Joined:
    Aug 31, 2013
    Posts:
    176
    I've been working on this for a while, so this is a scratchpad of my thoughts trying to get it working.
    The OP is long (thanks I like thorough), but missing some things & I cant get it working, maybe I can figure out where I'm screwing up

    1) Download I assume WITH skin, they didnt mention this
    2) when you download it there is NO T-Pose avatar from Mixamo, so I'm not sure why they mention this
    3) There is no avatar so I assume I create from this model, press apply

    OK done it all still no go, I'll leave this here maybe it helps someone
     
  25. cloverme

    cloverme

    Joined:
    Apr 6, 2018
    Posts:
    152

    A few things have changed with both Mixamo and Unity over the years, so let me answer your Q's in that context...

    1) Download without skin, set the format to FBX for Unity, 30 or 60 fps, no keyframe reduction.
    2) If you need the T-pose from Mixamo, you can get it by searching for "T-Pose" in the Mixamo search.
    3) If your model doesn't have an avatar, in Unity click on your model, the Rig tab, chose "Create from this model" and click apply.

    For a larger update to the first post, things are a little more simplified now:
    1) Click on your model, Rig tab, change to Humanoid, click apply.
    2) Download any mixamo animation (no skin, FBX for Unity).
    3) When you have the Mixamo model in Unity, set it to Humanoid on the Rig tab (if it's not set), click apply.
    4) On your model, create an Animator Controller. Open Animator.
    5) Drop in your Mixamo animation into Animator.
    6). Make sure Apply "Root Motion" is checked (for most of their animations anyway).

    In most, if not all, circumstances now, you don't need to copy your model avatar into the animation rigs to generate and apply them.


    If you model does not have a rig, you'll either to A) create one in Blender or B) have someone do it for you.

    Things that are still situational problems:
    - Foot sliding with root motion - This is more a problem with the animation and how root motion was recorded into animations. More than just mixamo animations have this issue. It's not easy to find quality root motion animations for free, most of the motion capture animations are a little pricey, but even then, some of them have these issues, which is a bummer. Why Unity doesn't supply like 1,000 animations for everything is still a mystery.

    - Unity IK isn't very good, so getting hands and feet where they need to be is a lot of work. FinalIK on the asset store is 100x better than the new animation rigging package from Unity.

    - Unity has no built in solution for facial motion capture, so animating expressions isn't possible as it has to be done outside of unity if required. Unity has no hair animation either (as of 2021.3) so you'll need to use either the standard physics system or another 3rd party solution.

    - The newer Unity Third Person Controller is pretty decent, BUT it doesn't use root animation! It needs in-place animations. If you want to use Mixamo animations for character actions, you'll need to use a 3rd Person controller that supports root motions.
     
    zedz likes this.
  26. zedz

    zedz

    Joined:
    Aug 31, 2013
    Posts:
    176
    Thanks a lot cloverme for the detailed response, I look into this. I'm going to take a break from the animation for a couple of days (as it was driving me a bit nuts), I will return to it soon with a fresh head, Hopefully then I can solve me issues. :)
     
unityunity