Here is a script that I’ve made. I want the light to turn on when I press “e” then turn back off in 1 second by itself but I keep getting this error: “Update() cannot be courotine.”
What is the problem?
function Update () {
if (Input.GetKeyDown("e")) {
if (light.enabled == false)
light.enabled = true;
yield WaitForSeconds(1);
light.enabled = false;
}
}