WaitForSeconds not working? C#

So basically I just call the WaitForSeconds, and I always get the error

		if(Input.GetKey("q")) {
			anim.SetBool("Action1", true);
			yield WaitForSeconds(5);
			anim.SetBool("Action1", false);
		}

This is the error:
Assets/Game/Player/Scripts/PlayerMovement.cs(30,45): error CS1525: Unexpected symbol (', expecting )‘, ,', ;’, [', or =’

I am not sure how to fix this.

You can’t use yield like that in C#; see the docs. Also it’s unlikely you want to use GetKey. Use GetKeyDown instead.

–Eric

That reference guide is telling me to do exactly what I just did.

It’s really not. Make sure you have the scripting set to C#, not Unityscript.

–Eric

yield return new WaitForSeconds(5);