Hi all, i have a problem with a yield waitforseconds, its give this error: The body of ‘TriggerAndLoadLevel1.TriggerHole(int)’ cannot be an iterator block because “void is not an iterator interface type”.
This is my script:
public void TriggerHole(int index) {
holeTrigger[index] = true; //Set the hole trigger to true
//Check if all holes have been triggered
if (AllTriggered) {
UnlockLevels (); //unlock next level funxtion
yield return new WaitForSeconds(2);
Application.LoadLevel ("fLevel1");
}
}
What is the problem?