Hi there! I'm trying to find a way to reload the SkeletonDataAsset from my script.
When I press the Reload button I can solve the issue I'm having after to use the SkeletonRagdoll.

I'm calling the Remove() to back to the previous behaviour of my character, but in some cases the rotation of the mesh is wrong after removing the ragdoll. The only way I found to fix it was reloading the SkeletonDataAsset, but I can't find a way to call it from script.
There's some way to call it or there's some better way to fix my problem?

Thank you!

Related Discussions
...

To reload the SkeletonDataAsset at runtime, you can use the following approach in your script:

  1. Assign the new SkeletonDataAsset to your SkeletonAnimation or SkeletonGraphic component.
  2. Call the Initialize(true) method to reinitialize the skeleton with the new data.

Here is an example of how you can do this:

public SkeletonDataAsset newSkeletonDataAsset;

void ReloadSkeletonDataAsset() {
    SkeletonAnimation skeletonAnimation = this.GetComponent<SkeletonAnimation>();
    skeletonAnimation.skeletonDataAsset = newSkeletonDataAsset;
    skeletonAnimation.Initialize(true);
}

In this example, newSkeletonDataAsset is the new SkeletonDataAsset you want to load. The Initialize(true) method will reinitialize the skeleton with the new data, effectively reloading it.

Additionally, make sure to set the initialSkinName and AnimationName to values that exist in the new SkeletonDataAsset before calling Initialize(true) if necessary.

If you are encountering issues with the rotation of the mesh after removing the ragdoll, reinitializing the skeleton as shown above should help reset the skeleton to its default state.

If you continue to experience issues, please ensure that the new SkeletonDataAsset is correctly set up and that all necessary references are updated.