I am trying to play animation late . I am getting errors. I am doing coroutines on this network health script . When the gameobject deactivates , the animation doesn't play . The gameobject just disappear when I kill the enemy up close to the player and the move animation continues to play during enemy vanishing.
Here is what I got for code .
public void Start()
{
StartCoroutine(Go(5f));
}
IEnumerator Go(float wait)
{
if (m_DeactivateOnDeath)
Scheduler.Schedule(m_DeactivateOnDeathDelay, Deactivate);
yield return new WaitForSeconds(5f);
this.GetComponent().Play("die");
GetComponent().Play();
}
↧