P
P
PurgaBot2021-10-03 11:25:18
Unity
PurgaBot, 2021-10-03 11:25:18

How can I create a certain number of objects?

I plan to create a constantly changing number of objects, how can I implement this? (For example, coins for the player or falling drops to replenish life)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
B
BFGunner, 2021-10-05
@BFGunner

Well, the easiest way, as for me, is to create a coroutine.
Algorithm::
1. You prescribe the Quantity variable, where you specify the required number of iterations.
2. You spend the same number of iterations through the loop inside the coroutine.
3. Inside each iteration, using instantiate, you create an object from the prefab

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question