Hello there!
Ive got a specific question maybe its a simple one, i dont know. Ive got different Objects with different tags, and i want to put them all into one array.
later - on the one hand - i want to check if there is a velocity on this objects. On the other hand i want to remove them from array, if they pass a collider. If i set up an array for all GameObjects by their own it works very well, but i want to put all the different GameObjects into one array.
Here are all the different Array i got.
arrayGood = GameObject.FindGameObjectsWithTag("Sort_1");
arrayBad = GameObject.FindGameObjectsWithTag("Sort_2");
arrayClick = GameObject.FindGameObjectsWithTag("Sort_3");
arrayRollOn = GameObject.FindGameObjectsWithTag("Sort_4");
arrayPillow = GameObject.FindGameObjectsWithTag("Sort_5");
I want to put them all into one “large” array like this:
arrayAllObjects = GameObject.FindGameObjectsWithTag(“Sort_1”)&& GameObject.FindGameObjectsWithTag(“Sort_2”) && GameObject.FindGameObjectsWithTag(“Sort_3”) && GameObject.FindGameObjectsWithTag(“Sort_4”) && GameObject.FindGameObjectsWithTag(“Sort_5”)
But if i do it like that only the last object/array (“Sort_5”) will be loaded into this array.
Can someone please tell me how i can set up this kind of array? Thank you so much!