I have a script where Im trying to have two Animator objects having 1 to run the fade in and fade out states for the text and when the text is on the idle/finished state it then should have the other animator run the animations for the logos fade in/out but it returns the error above and I'm not sure why as both of my Animator objects are defined in the unity editor?
Can someone please help me understand what I'm doing wrong >~< snif
public Animator animText;
public Animator animLogo;
public GameObject Logo;
// Start is called before the first frame update
void Start()
{
animText = GetComponent<Animator>();
Logo.SetActive(false);
}
// Update is called once per frame
void Update()
{
if(this.animText.GetCurrentAnimatorStateInfo(0).IsName("GWSTxtIdleFin"))
{
animLogo = GetComponent<Animator>();
animLogo.Play("LogoFadeIn");
}
}
}
EDIT: I did notice i didnt re-make it visible as well btw
Because animtor is already in animLogo and animText then remove these lines: animLogo = GetComponent<Animator>();
and animText = GetComponent<Animator>();