How do I find tags in my script?
Thank you, koramere
May 21 '12 at 08:46 PM
You mean, how to find objects with a tag? If so, you can use FindObjectWithTag and create an array of the objects you've tagged: GameObject yourGameObject = GameObject.FindObjectWithTag("TheTag");
I suggest you take a look at this: http://unity3d.com/support/documentation/ScriptReference/GameObject.FindGameObjectsWithTag.html
Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.
Once you sign in you will be able to subscribe for any updates here
Answers and Comments
The best place to ask and answer questions about development with Unity. Check out our FAQ for more information.
To help users post good questions and use the site effectively we have posted a tutorial video. Please check it out.
asked: May 21 '12 at 08:46 PM
Seen: 303 times
Last Updated: May 21 '12 at 08:55 PM
Is it possible to create a new Tag by script ?
Enabling/Disabling Multiple Tagged objects
Creating tags via code
How can I access other scripts and their functions?
How do I access information (eg, variables, functions, properties) on other objects from inside a script?
Find all instances of "Missing Script"
Help needed: repairing the Spline Controller Script
Character Loading Location
Editor Wizard: Copy Existing Components to Another GameObject