Hello, i'm having a random problem with animations that uses path (at least when i remove the path the problem disappears)

I created a script to randomize the TimeScale, TrackTime and Skin at the start of the scene.
When animations don't have a path, it workds perect, but when i add it, randomly when i put some copies of the same GameObject, some of them are in pause with no reason.

There isn't an error message, just it happens.

I put here the code, if someone knows why some animations randomly are paused in execution when the animation has a path, i would be really greatful.

If need more info just ask for it.

[Header("Time Scale")]
public bool randomTimeScale = true;
[Range(0.5f, 1f)]
public float minTimeScale = 0.8f;
[Range(1f, 1.5f)]
public float maxTimeScale = 1.2f;

[Space(10)]

[Header("Start Time")]
public bool randomStart = true;
private float minStartTime = 0f;
[Range(0f, 1f)]
public float maxStartTime = 1f;

[Space(10)]

[Header("Animation")]
[SpineAnimation]
public string idle;

public SkeletonAnimation skeletonAnimation;
private Spine.AnimationState spineAnimationState;
[Space(10)]

[Header("Skin")]
public bool randomSkin = true;
public ExposedList<Skin> skins;
public Skin[] skinArray;

// Start is called before the first frame update
void Start()
{

    skins = skeletonAnimation.skeleton.Data.Skins;
    skinArray = new Skin[skins.Count];
    skins.CopyTo(skinArray);

    spineAnimationState = skeletonAnimation.AnimationState;
    TrackEntry track = spineAnimationState.SetAnimation(0, idle, true);
    if (randomTimeScale)
        track.TimeScale = Random.Range(minTimeScale, maxTimeScale);
    if (randomStart)
        track.TrackTime = Random.Range(minStartTime, maxStartTime);
    if (randomSkin)
        skeletonAnimation.Skeleton.SetSkin(skinArray[Random.Range(0, skinArray.Length)].Name);


}
Related Discussions
...

Can you capture the random values that cause the problem? Then you'd have reproduction that occurs every time.

The next step is to debug it, to see why the animation doesn't advance when it should.

It could be that the animation does advance, but a bug in the path computations causes an division by zero. That can cause subsequent math to be invalid and not render correctly.

    Nate

    Of course:

    (the min value in random start is always zero)

    But i don't know if that is the reason, because it only fails when the anim have a path, never fails when the animaiton hasn't a path, but if if is possible i didn't see the possible division by zero let's check it, thank you for the response.

    Nate I did what you told me, and it seems when skin is 0 (default) is when the animation stops. But still i don't know why only it has the path, i will continue investigating to confirm if it works, thank you!

    Nate Yes, it seems is caused by the "default" skin, there wasn't a default skin in the initial version of the animation. The problem is totally solved (at least for now) so thank you a lot!