The question is the title, I have multiple objects with multiple animations and I need a code to stop them all at once. Not sure how to do that, would like some light on the topic, thanks.
This should work:
Animator.Stop();
I know this an old post but someone might find this answer useful
I believe this would work:
Animator[] animatorsInTheScene = FindObjectsOfType(typeof(Animator)) as Animator[];
foreach (Animator animatorItem in animatorsInTheScene)
{
animatorItem.SetBool("IsIdle", true);
}
You need to add a condition in the Animator called IsIdle for the animators you have and have it transition from any state to the idle state of your animation
if you just want them to stop and freeze, substitute “animatorItem.SetBool(“IsIdle”, true);” for animatorItem.enabled = false;