@fshakhverdiyev Thanks for sending the reduced reproduction project.
To fix the issue you need to call skeletonAnimation.Update(0);
after skeleton.SetSkin()
when the call is followed by_skeletonRagdoll2D.Apply();
. This is necessary because the world transform values need to be updated before SkeletonRagdoll2D.Apply
, and they are only updated for active bones.
So to fix your code, modify it as follows:
private static void ChangeSkin(SkeletonAnimation skeletonAnimation, Skin newSkin, bool updateWorldTransforms = false)
{
Skeleton skeleton = skeletonAnimation.skeleton;
skeleton.SetSkin(newSkin);
skeleton.SetSlotsToSetupPose();
if (updateWorldTransforms)
skeletonAnimation.Update(0);
else
skeletonAnimation.state.Apply(skeleton);
}
...
if (_isEnable)
{
ChangeSkin(_skeletonAnimation, _skeletonAnimation.skeleton.Data.FindSkin(_skinName), true);
_skeletonRagdoll2D.Apply();
}