Weird! Help!

Hey, all,

I’m trying to use a yield instruction in my code as follows:

	void OnCollisionEnter (Collision col)
	{
		foreach ( ContactPoint Contact in col.contacts )
		{
		        yield WaitForSeconds (5);
		}
	}

(simplified, as it keeps going wrong, so I’ve stripped it down to just this!)

Anyway, Unity keeps reporting the following error:

Error CS1002: Expecting ‘;’

But everything looks OK to me!?

I’m using C# - am I doing something wrong??

Help!! :frowning:

http://unity3d.com/support/documentation/ScriptReference/index.Writing_Scripts_in_Csharp.html

state 4.

Ah! Nice - thanks for letting me know! :slight_smile: