@KANIKAMA Thanks for reducing your code down to the minimum, I can now see what is likely the problem. You are disabling and enabling the SkeletonRootMotion
component, however it is not designed for that, It is intended to be always enabled and that all animations are authored with root motion when using the component. While we see a use case and could cover it automatically in OnEnabled and OnDisabled, we can't do that on the 4.2 branch in order not to break existing projects. We would add this functionality on the 4.3-beta branch.
Nevertheless, as a simple workaround you can simply change root motion scale to 0 and to 1 to disable and enable it:
// disable
skeletonRootMotion.rootMotionScaleX = skeletonRootMotion.rootMotionScaleY =
skeletonRootMotion.rootMotionScaleRotation = 0;
// enable
skeletonRootMotion.rootMotionScaleX = skeletonRootMotion.rootMotionScaleY =
skeletonRootMotion.rootMotionScaleRotation = 1;