instantiate same object multiple time at different positions unity2d
Hi im working on 2d project I have a prefab which has a dot image attached. i want to create 10-20 instances of this at same time but different vector positions, but before that...it should blink 3 times then stop and ready for action... similar to attached...green dots to be instantiated.
whats exactly yoour issue? if you have already dont it with the green dots?
Hi Above is just a example, how can i blink blink gameobject 3 times and start the movement
using a coroutine, what have you tried? why it doesnt work? you cant simply ask for people to code for you
I have tried using animation-scaling...wanted to perform using script with some functions that needs to be executed at the same time. script i have tried using "sort order"..
please post it as comments not answers, you should do something like this
public IEnumerator Spawn()
{
float waitTime = 2;
for(int i = 0; i < 3; i++)
{
yield return new WaitForSeconds(waitTime);
//here you post the blink code that might be changing the sprite color for example
}
float sizeX = 5;
float sizeY = 5;
float numberOfItems = 20;
for(int i = 0; i < numberOfItems)
{
Instantiate(yourPrefab, new Vector3(Random.Range(-sizeX, sizeX), 0, Random.Range(-sizeY, sizeY)):
}
}
Your answer
Follow this Question
Related Questions
Instantiating at a specific location? 0 Answers
How to Instantiate platforms with certain space inbetween each platform (Endless Runner) 0 Answers
turret shoot in direction and hit my health (scripts attached,i need to know how to put it together) 0 Answers
Instantiated Prefab not Moving 1 Answer
Why do my first 50 instances of a prefab have the same properties? 1 Answer