Yield aint working in C# code.

Hi, i have a JS script amd im converting it to C# but the yield part aint working. Any sugestions to this code?

```

void Start() {
if (secondsDelayStart > 0) {
started = false;
new WaitForSeconds(secondsDelayStart);
}

`    started = true;
    startRunning = Time.timeSinceLevelLoad;
}

```

`

1 Answer

1

I suggest read this: http://unity3d.com/support/documentation/ScriptReference/Coroutine.html

I changed the code to this: void Start() { if (secondsDelayStart > 0) { started = false; StartCoroutine(YieldWait()); } started = true; startRunning = Time.timeSinceLevelLoad; } public IEnumerator YieldWait() { yield return new WaitForSeconds(secondsDelayStart); } and still doesnt work