Avatar SDK Local Compute Unity plugin  3.1.0
Realistic avatar generation toolset for Unity3D
How To Animate Full Body Avatars

Humanoid animations (like a Mixamo) can be applied to the fullbody avatars.

Importing Animation Into Unity

1. Add FBX with animation into the Unity project.
2. Select this FBX and open Rig tab in the Inspector window.
3. Change Animation Type to Humanoid and press Apply.

set_animation_type.jpg


4. Press Configure to verify configuration. Make sure that the skeleton is in the T-Pose and all bones are mapped.

configure_skeleton.jpg


5. Open Animation type and set required parameters. For the Mixamo animation we recommend using parameters as on the picture below:

animation_parameters.jpg


6. Create Animator Controller, add the imported animation into it and enable Foot IK option.

configure_animator_controller.jpg

Animating Avatar Imported From FBX

1. Run Fullbody Export Sample and generate an avatar in the FBX format.
2. Import the FBX file and textures into the unity project.
3. Select this FBX and open Rig tab in the Inspector window.
4. Change Animation Type to Humanoid and press Apply.

set_model_animation_type.jpg


5. Press Configure to verify configuration. Make sure that the skeleton is in the T-Pose and all bones are mapped.

configure_model_skeleton.jpg


6. Add the model to the scene and set animator controller.

set_animator_controller.jpg


7. Play the scene, the character should be animated.

Animating Runtime Generated Avatar

We provide an AnimationManager object to animate the runtime generated avatar.
You can create the AnimationManager on the scene and assign the animator controller.


Once the avatar is loaded on the scene you can call AnimationManager.CreateHumanoidAnimator method to create an animator.

IEnumerator LoadModelAndCreateAnimator(string avatarCode, AnimationManager animationManager)
{
FullbodyAvatarLoader avatarLoader = new FullbodyAvatarLoader(AvatarSdkMgr.GetFullbodyAvatarProvider());
yield return avatarLoader.LoadAvatarAsync(avatarCode);
animationManager.CreateHumanoidAnimator(avatarLoader.AvatarGameObject, avatarLoader.GetBodyMeshObject().GetComponentInChildren<SkinnedMeshRenderer>());
}

The code bellow also creates an animator without using AnimationManager object.

void CreateHumanoidAnimator(GameObject avatarObject, SkinnedMeshRenderer bodyMeshRenderer)
{
Animator animator = avatarObject.AddComponent<Animator>();
animator.applyRootMotion = true;
animator.runtimeAnimatorController = animatorController;
animator.avatar = AvatarBuilder.BuildHumanAvatar(avatarObject, BuildHumanDescription(bodyMeshRenderer));
}