- Home /
How to affect a group of objects.
I whant to refer to many or a group of objects so that i dont need code for each object. Can i use tags if so how do i refer to that tag becaquse i have pared the objects using a tag.
Comment
Answer by Blazor Ramone · Feb 25, 2012 at 09:16 PM
http://unity3d.com/support/documentation/ScriptReference/GameObject.FindGameObjectsWithTag.html
you can use this to get a list of objects that have the same tag. Then when needed you can loop through this list and do whatever to each object.
I would if possible save the list to a variable in start()
so you don't have to call the find repeatedly in code.