- Home /
Question by
mustang4484 · Dec 17, 2018 at 03:28 PM ·
gameobjectarraylist
Enabled all gameobjects in array
Hi guys I've an array of gameobject and i would you like that when i call a function all gameobject set active(true) or false. With this code only the first gameobject is active.
public GameObject[] posizioni; for (int i = 0; i < posizioni.Length; i++) { posizioni[i].SetActive(true); }
Comment
Are you sure you filled the array with multiple gameObjects?
Answer by mustang4484 · Dec 17, 2018 at 03:54 PM
Yes but i have in another line this " posizioni[i].SetActive(false)". So it doesn't work;
Thank You;