Exactly what it says in the title. The following script is giving me all kinds of headaches. The "update works" log stops working after the co-routine "works." Any ideas?
void Update()
{
if (couch.couchClicked == true && animation.isPlaying == false)
{
animation.Play("Spring");
couch.couchClicked = false;
StartCoroutine("SpringReset");
Debug.Log("If statement works");
}
Debug.Log("update works");
}
IEnumerator SpringReset()
{
yield return new WaitForSeconds(3f);
animation.Rewind("Spring");
Debug.Log("coroutine works");
}
↧