W
W
WeBBeW2020-04-16 20:32:00
C++ / C#
WeBBeW, 2020-04-16 20:32:00

Will the code work like this?

There is this code

IEnumerator instObj ()
    {
          (1)  yield return new WaitForSeconds(1.5f);
          (2)  Instantiate(obj, new Vector3(Random.Range(-10f, 10f), 0, Random.Range(-10f, 10f)), Quaternion.identity);
    }


Will it work if you swap (1) and (2)
IEnumerator instObj ()
    {
          (2)Instantiate(obj, new Vector3(Random.Range(-10f, 10f), 0, Random.Range(-10f, 10f)), Quaternion.identity);
           (1) yield return new WaitForSeconds(1.5f);
    }

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
GavriKos, 2020-04-16
@WeBBeW

Will. But the logic will change a bit too

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question