Mixamo animations with Blender character in Unity
If you already have a rigged character or want to use one from Mixamo you can skip the first part about Rigging in Blender and Exporting from Blender and go directly to Importing Character to Unity.
Rigging in Blender
First off, we will set up a simple rigged character in Blender. A good practice when modelling humanoid characters is to make sure the character is modelled in a T-Pose, i.e. arms out to the side and legs down:
Now we can start rigging. A good way to save some time on humanoid characters in Blender is to use the Meta-rig that comes with the Rigify add-on. To enable this add-on, go to File -> User Preferences -> Add-ons -> Rigging (or search for rigify) then apply the check-box and press Save User Settings:
It is good practice in Blender to keep the pivot point centered, so press Shift+S, then Cursor to Center (new objects in Blender get the pivot point from the cursor position):
Now go to Add -> Armature -> Human (Meta-rig). This places basic human skeleton in the scene, with pre-named bones positioned roughly where we want it (press Z to toggle wireframe view):
However basic it may be, this rig is way more complex than we need. For this example we will remove all the face and finger bones, as well as the breast. :
With unnecessary bones out of the way, we can start positioning the bones to fit our character. A good tip here is to use orthographic camera (num 5) and switch between front view (num 1), right/left view (num 3 / ctrl + num 3 ) and top view (num 7) as needed. Make sure to have a little bend on the arms and legs, as this will make it easier to extend the rig later or make a ragdoll in Unity (I mean, why wouldn’t you! Ragdolls are awesome!). A tip before you begin is to apply X-Axis mirror in Options. Also make sure to zero out any bone “Roll” in the arm bones:
When the bones are positioned correctly, it can be worth your while to run through the bone chains and check the names. This is not strictly necessary, but the Meta-rig name the hip-, neck- and head-bones are all called “Spine”, which is not ideal:
Now that the bones are correctly placed and named, we can start skinning. This can be a bit tedious if you have a high-poly, complex character (pro-tip: unless you are part of a AAA game studio, go low poly!), but luckily the character in this example is super easy to skin!
Start with parenting the character mesh to the armature: First select the character, then select the armature, then press ctrl + p and choose one of the three autoskinning options under Armature Deform: with Empty groups, with Envelope weights or with Automatic weights.
Generally, I recommend Empty groups or Automatic weights. Empty groups makes vertex groups for each bone but leaves all the vertex weights at zero, i.e. nothing moves with the bones. Automatic weighting also makes vertex groups, but automatically applies weights to the vertexes.
Automatic is good for organic characters, but for this simple blocky character it is better to go for Empty and apply all the weights manually:
When the character and armature are related, we can now select the character and see that the Vertex Groups list has been populated with the bone names. I like to start at the top of the list and move down. With the character selected, go into edit mode, then select the hips vertex group. Then select all the vertices that should move with the hips and press the Assign button. Repeat these steps for all the body parts:
Exporting from Blender
When the skinning is done it is time to export the rigged character into Unity. Make sure to select both the Armature and the character mesh, then File-Export-FBX(.fbx). Match these export settings:
Leave the animation settings as is.
Importing Character to Unity
Unity needs to know that this is a humanoid rig. To do this, simply select the fbx character in the Project view, then in the inspector choose Rig, then Animation Type Humanoid and hit Apply:
Mixamo animations in Unity
Getting animations from Mixamo is pretty easy, but to make them work on a Blender armature you have to do a little bit of trickery. First off, make an Adobe account (if you do not already have one) and log in to Mixamo.
Then, choose a character. I’ve chosen the Y-bot character for this example, but doesn’t really matter. Go to animations and select the T-pose animation. This will serve as a kind of “bridge” to get animations from Mixamo to work on a Blender rig in Unity. Then press the download button and in the download settings choose Format: Fbx for Unity, Skin: with skin, leave the rest as is then Download:
Import the fbx file into Unity. In the Rig settings do the same as you did with the Blender Character:
Now you can download an actual animation from Mixamo. Find a suitable animation and download, but this time, choose Skin: without Skin:
In Unity, select the fbx-file, under Rig select Humanoid. Then Avatar Definition: Copy from other avatar. In Source select the Avatar from the T-posed character you downloaded from Mixamo:
Then, depending on the type of animation, you will most likely spend a little time tweaking the result in the Inspector Animation tab (see the section on LoopingAnimationClips in the Unity Manual for more explanation on these settings):
Finally, put the animation in an Animator and play away: