Cant Make C# Use waitforseconds Command

I’m trying to make a little game based off the Roll-A-Ball tutorial game, and I want to make it so that once you’ve collected all the cubes, the game waits 4 seconds and then starts the next scene/level. However, the waitforseconds command just refuses to work. This is the code I’m using:

void SetCountText ()
{
	countText.text = "Count: " + count.ToString();
	if (count >= 12)
	{
		winText.text = "YOU WIN!";
		winSound.GetComponent<AudioSource>().Play ();
		yield return new WaitForSeconds(4);
		SceneManager.LoadScene("Level2");
	}
}

When I run the debug it says that ‘void is not an iterator block’, which I don’t know what it means. The Scripting API appears to say that the ‘IEnumerator’ command has to be in place of the void command, but when I do that it doesn’t work at all either. Some other questions I’ve found say that you have to use a ‘Coroutine’ command, which the Scripting API doesn’t say anything useful about other than having the ‘IEnumerator’ in the example code. Why can’t I just use the WaitForSeconds command normally?

IEnumerator is not a command, it’s a type - if you want to use WaitForSeconds() then you have to call it as a coroutine. change the function to:

IEnumerator SetCountText()

and call it with

StartCoroutine(SetCountText());

You really need to watch this

https://unity3d.com/learn/tutorials/modules/intermediate/scripting/coroutines

IEnumerator changeDelay ()
{
SetCountText ();
yield return new WaitForSeconds (10);
SceneManager.LoadScene (“Level2”);
}

     void SetCountText()
     {
         countText.text = "Score: " + count.ToString();
         if (count >= 1 && !counting)
         {
             counting = true;
             winText.text = "Good Job";
         }
     }
 }

Your whole concept of the code was wrong from the start. What you have to do is start a Corouting of any name in this case it " changeDelay" Get a Void SetCountText put in there the whole code with the score and win text then in the IEnumerator you need to put in the whole Function, THEN wait for 10 seconds and change the whole level. If this does not work then something else in your code is wrong you might want to put in the whole thing.