Комментарии:
Thank you a lot man!
Ответитьhow to make one by one array obj instantiate clicking button
Ответитьthanks a lot it was helpful. How about creating new clones from a specific prefab and putting them in one array so that you can access them individually (e.g i want to create coins in my scene and destroy some of them not others ) ? do you have a solution? thanks a gain.
Ответитьthank you very much. Nice and simple, I was making a very small mistake all cleared up.
Ответитьnice and short which is good but in future no back ground music
Ответитьis there any way I can mess with the properties of the objects in the array
Ответитьmusic louder than your voice...
Also, I can see that when you make an array, you have to drag and drop the prefab, is there another way to do it? by coding only?
Something that helped me just create an empty gameobject and paste this into your script: public GameObject[] cubes;
public int numObjectsToSpawn;
public float PlaceX;
public float PlaceZ;
// Use this for initialization
void Start () {
for (int i = 0; i < numObjectsToSpawn; i++) {
PlaceX = Random.Range (130, 154);
PlaceZ = Random.Range (112, 125);
Instantiate(cubes[i], new Vector3(PlaceX, 1.4f, PlaceZ), Quaternion.identity);
}
}