Can someone help me with my code? This is my first attempt at using the WaitForSeconds command and im not 100% sure what this error means or how to fix it “Script error (Animation Controller): Update() can not be a coroutine.”
#pragma strict
function Update () {
if (Input.GetButtonDown("Fire1")) {
animation.Play("sword", PlayMode.StopAll) ;
yield WaitForSeconds (0.68) ;
animation.Play("Idle") ;
}
if (Input.GetKeyDown(KeyCode.W)) {
animation.Play("Walking", PlayMode.StopAll) ;
}
if (Input.GetKeyUp(KeyCode.W)) {
Debug.Log ("w up is fine") ;
if (Input.GetButtonUp("Fire1")) {
Debug.Log ("Fire 1 up is fine") ;
animation.Play("Idle", PlayMode.StopAll) ;
}
}
}