The script has no complier errors before the game starts. However, once the game starts, I get an error that says “Update () cannot be used as a coroutine”. I’ve searched the web for a couple hours now, but I can’t seem to find a way to re-write my script, and make it work. I’ve re-written it a couple times, but I’m stuck as to what to do right now. If anybody could help me solve this, it would be much appreciated. Thanks in advance.
var jumpslash : AnimationClip;
var doingsomethingelse : boolean = false;
function Update ()
{
if(doingsomethingelse==true)
{
yield WaitForSeconds (2.0);
doingsomethingelse = false;
}
if(Input.GetKeyUp(KeyCode.F))
{
if(doingsomethingelse==false)
{
animation.Play("jumpslash", PlayMode.StopAll);
doingsomethingelse = true;
}
}
}