I have a 2D single screen style game where I have a disabled gameobject. Under this are several children that that are animated. The parent object holds the animator for the children. When I enabled the parent, the animations will not play. The animator looks as thought it's trying to processes the default entry state but does not complete. I've done some research on this and it seems that disabling and then enabling something does not start the animator. I've tried writing some code for it with no luck and setting the sprite renderer false won't work either as there are simply too many sprites. Here's my last attempt: Any ideas?
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class animationState : MonoBehaviour
{
public Animator anim;
private void OnEnable()
{
if (anim.gameObject.activeSelf)
{
anim.Play("pinWheelAnimation");
}
}
}