Skip to content

Root motion isn't applied to non-humanoid animations via Animator probably due to missing Avatar #872

@XtroTheArctic

Description

@XtroTheArctic

Describe the bug 💬

(See the EDITs below, first)

In this issue (#869) and in this PR (#870) I did set the Root Motion of the created Animator to true but it turns out, Animator requires an avatar to be able to apply root motion to non-humanoid models.

So, the avatar creation for non-humanoids must be added to UnityGLTF importer, making it consistent with FBX importer and compatible with Mecanim Animator.

As seen in this screenshot, the horse moves within its local space without moving the object itself (as shown at the location of Unity's Transform Tool Gizmo):
Image

As seen here, Unity's FBX importer creates an avatar for non-humanoid model so that Animator can apply root motion.
Image

EDIT 1

After working on fixing the non-humanoid avatar creation, I noticed that, to achieve proper root motion for a non-humanoid model, avatar creation alone is not enough. Even when the non-humanoid avatar is created and the animator's applyRootMotion is set to true, the model's gameobject isn't moved by the animator component during play mode. I think the imported animation assets needs to be setup correctly for them to be able to apply their motion to the model gameobject.

EDIT 2

This issue goes hand-in-hand with another issue I reported regarding Humanoid models: #874

Steps to reproduce 🔢

Import the FBX and GLB from this zip and see that FBX model has an avatar and UnityGLTF model doesn't have an avatar.
https://github.com/user-attachments/files/20718763/Horse.zip

Files to reproduce the issue ♻

https://github.com/user-attachments/files/20718763/Horse.zip

Editor Version 🎲

Other (Provide details below)

Render Pipeline and version

Not relevant

UnityGLTF Version

2.17.1

Operating System 👩‍💻

Windows

When does this problem happen?

  • Editor Import
  • Runtime Import
  • Editor Export
  • Runtime Export

Additional Info 📜

No response

Validations 🩹

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions