yield WaitForSeconds (3); ON .CS

hi
just toknow
i use on java script
yield WaitForSeconds (0.7);

but i am trying touse on .cs
how can i Do please ?

thanks a lot !

The WaitForSeconds documentation includes a C# example.

1 Like

thanks a lot … but they use

IEnumerator Example()
{

how can i use only with void ?
for example:

void Example()
{

in other words …
how can I use without IEnumerator

You can’t use it without an IEnumerator in C#.

In UnityScript the compiler put the IEnumerator in for you in the background. In C# you have to write it yourself.

You also want to use StartCoroutine to launch your coroutine, instead of just calling the method directly.

thanks so much … is working now