|
Here's my situation. I'm coding scripts for a turn-based game that has an initiative system. Sometimes I need all of the planes to go first, sometimes the ground units, sometimes all the enemies, etc. The FindObjectsWithTag has such good functionality, but tagging an object based on its vehicle type means I can't tag it "player" or "enemy" (which makes things harder in other areas). Is there any way to have more than one tag so that I can iterate through my objects easily? Or is there another strategy in Unity that will get me what I want (simply iterating through planes[].Move() after defining "planes" with FindObjectsWithTag is sooo convenient...). Thanks!
(comments are locked)
|
|
It is not currently possible, but i use a work-around. On gameObjects that i need more than one tag on, i add an empty game objects as a child for each tag i need, and give each of these separate tags.. Then you can still search for tags using FindGameObjectsWithTag then just reference the parent object.. as an example in C# That's a really good idea! I'll give it a shot. Thanks!
Jul 06 '10 at 11:53 PM
The_r0nin
Brilliant! :D That will help me a lot! :D
Apr 15 '11 at 03:26 PM
FrHaYwOrKs
awesome idea dude...i'll implement this...
Sep 28 '12 at 06:42 AM
kgmr333
(comments are locked)
|
|
i have a strange solution for you, check here:- http://blockmonkey.com/my-work/unity-3d-work/ it's a script that allows you to put in Multiple tags on an object... Amazing solution i'm going to use this idea and write my own meta-tagging solution, inspired. Thank you.
Nov 16 '11 at 08:10 AM
sacredgeometry
Angad do you still have that script, the website is tits up. Can you post it here for records?
Oct 04 '12 at 07:32 PM
ZoomDomain
dead link. Please remove the answer or reupload.
Apr 11 at 06:55 PM
Dávid Debnár
(comments are locked)
|
|
Is "http://blockmonkey.com/my-work/unity-3d-work/" a dead link? Looks like it
May 02 '12 at 12:12 PM
Bluntweapon
(comments are locked)
|
