- Home /
Clone Prefab Duplicate Problem
Alright well, I'm making an asteroid field with
Instantiate(asteroid, position, Quaternion.identity);
where asteroid is a gameobject - prefab,
and now by doing that i make about 100 clones give or take, and on the prefab i have a script that has a raycast, and a random given number from 20 to a 100,
now I want each asteroid's script to be valued as individual instead if i select one asteroid all clones get selected, and if i want to destroy an asteroid after some period of time all clones of the same kind gets destroyed,,
anyone know how to help me so the script/clones are valuead as individual gameobjects or whatever,,, show examples if you can please and thanks.
Just make sure you aren't putting static variables on the instantiated gameobjects, or they will all act the same for some things.
Answer by Eric5h5 · Dec 28, 2010 at 08:38 AM
Your example already produces individual game objects; that's what Instantiate does. If the rest of your code is somehow affecting them all at once, then that's a problem with that code, but since you haven't provided it, there's no way to tell what you're doing.
Your answer
![](https://koobas.hobune.stream/wayback/20220613092833im_/https://answers.unity.com/themes/thub/images/avi.jpg)