-
Notifications
You must be signed in to change notification settings - Fork 522
Description
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):

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

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 🩹
- I have searched existing issues: no issue already exist that reports the same problem.
- I follow the Code of Conduct
- I provided a minimal reproducible example, including files when necessary.