Harald Sorry for late response. We have many issues.
public static void ChangeSkin(SkeletonAnimation skeletonAnimation, Skin newSkin)
This is Skin change code part. I just call this method change my skin to another one after call skeletonRagdoll.Apply(). Everything is good at firstTime but second.....
{
Skeleton skeleton = skeletonAnimation.skeleton;
skeleton.SetSkin(newSkin);
skeleton.SetSlotsToSetupPose();
skeletonAnimation.state.Apply(skeleton);
}
This situation happened on only skin change procedure.
` public void Die(Vector2 damageComeFrom)
{
SlowMotionManager.Instance.ResetSlowMotion();
isTriggered = false;
SkeletonSkinUtil.ChangeSkin(skeletonAnimation, _skeletonAnimation.skeleton.Data.FindSkin("Exploded"));
_skeletonRagdoll2D.Apply();
_capsuleCollider2D.enabled = false;
_rigidbody2D.velocity = Vector2.zero;
_rigidbody2D.angularVelocity = 0;
enabled = false;
}
public void OnRestart()
{
enabled = true;
if (_skeletonRagdoll2D.IsActive)
{
_skeletonRagdoll2D.Remove();
}
_skeletonAnimation.ClearState();
SkeletonSkinUtil.ChangeSkin(_skeletonAnimation, _skeletonAnimation.skeleton.Data.FindSkin("Normal"));
_skeletonAnimation.skeleton.SetBonesToSetupPose();
transform.position = _wakeUpPosition;
_isTriggered = false;
_rigidbody2D.isKinematic = false;
_rigidbody2D.velocity = Vector2.zero;
_capsuleCollider2D.enabled = true;
_isJumped = false;
_skeletonAnimation.state.SetAnimation(0, "Idle", true);
}`
Die method called when character die and after Restart called everthing go to start position. First time everthing works fine (Ragdoll functionality). But second time when Die called (After restart) character exploded