This example demonstrates how to play animations from other models in the Galacean editor. Through simple steps, you will learn how to let one model reuse the animations of another model. This guide is suitable for beginners to understand the animation system of the Galacean editor and lays the foundation for more complex animation applications. If this is your first time using the animation editor, it is recommended to read this document first:
Before starting, we need a model without animations and a model with only animations (the character model must contain entities with the same names as the animation model). If you don't have models, you can download one from mixamo.
Click download directly
Select the Without Skin
option, then click download
It is strongly recommended to convert FBX models to GLB/GLTF format using third-party tools such as Blender in actual projects. Galacean currently only supports parsing GLB/GLTF models. Although you can directly drag FBX into the editor for automatic conversion, this method may result in excessively large animation data in the converted model and may cause restoration issues. Using professional tools for conversion allows better control over conversion quality and file size.
If you don't know how to import models, please refer to: Import Model
Import the character model and animation model into the editor.
To play animations from other models, we need to edit the content of the AnimatorController
. The AnimatorController
in the model is read-only, so we need to create an AnimatorController
ourselves.
If you don't know how to create an AnimatorController
, please refer to: Create AnimatorController
Add Animation State
button to add an AnimatorState
AnimatorState
(for an introduction to the properties of the Animation State, please refer to the AnimatorState document), and bind the AnimationClip
from the animation model.entry
to this AnimatorState
and click the connection line to change the Duration
to 0 (for a detailed introduction to AnimatorState
and Animation Transition, please refer to the AnimatorStateMachine document). This way, when this AnimatorController is applied, it will immediately play this AnimatorState
.Animator
component (detailed introduction) of the animation model. The component is generally on the root entity of the model instance, which is the first child entity under the model entity in the editor. Therefore, we need to drag the model containing the animation into the node tree as well.We find that the Animator
component is on the mixamorig:Hips
entity of the animation model, so we need to add the Animator
component to the mixamorig:Hips
entity of the character model.
AnimatorController
we just created