- Home /
how do i create a game object array with gameobjects of multiple tags
Is there a way to create a game object array across gameobjects with multiple tags? I was thinking of putting the objects in a custom layer but how do I get those in that layer out of the collection of all gameobjects? Any Ideas?
Answer by by0log1c · Apr 25, 2011 at 05:23 AM
Woah... first Layers have nothing to do with 'identification' . Tags also doesn't restrict the GameObject to anything else but that tag group ( aka its unrelated, too ;) ).
An array of any kind, either JScript or built-in can hold GameObject of any kind.
Now there's plenty of way to do what you want. Take a look at Unity: Accessing GameObjects
I think id didnt explain it correctly. I know that an array can hold any kind of object Game Object or not but I want to hold a certain group of gameobjects. The only built in ways are ways that allow you to search for tags. But I found a method that could work. Thanks though.