Skip to content

Commit 3822148

Browse files
committed
Change: enabled applyRootMotion for humanoid animator to make it consistent with FBX importer.
commit 8194a10 Author: Onur Er <[email protected]> Date: Wed Jun 11 19:21:18 2025 -0700 Enabled applyRootMotion for non-humanoid animator too to make it consistent with FBX importer. commit 9c9799d Author: Onur Er <[email protected]> Date: Wed Jun 11 16:28:41 2025 -0700 Enabled applyRootMotion for humanoid animator to make it consistent with FBX importer.
1 parent 582af27 commit 3822148

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

Runtime/Scripts/GLTFSceneImporter.cs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1393,10 +1393,12 @@ protected virtual async Task ConstructScene(GLTFScene scene, bool showSceneObj,
13931393
}
13941394

13951395
if (_options.AnimationMethod == AnimationMethod.MecanimHumanoid)
1396-
{
1397-
if (!sceneObj.GetComponent<Animator>())
1398-
sceneObj.AddComponent<Animator>();
1399-
}
1396+
{
1397+
var animator = sceneObj.GetComponent<Animator>();
1398+
if (!animator) animator = sceneObj.AddComponent<Animator>();
1399+
1400+
animator.applyRootMotion = true;
1401+
}
14001402

14011403
CreatedObject = sceneObj;
14021404
InitializeGltfTopLevelObject();

0 commit comments

Comments
 (0)