Unity find all game objects with certain main tag, not having to specify the sub tag?
07:32 04 Dec 2024

I'm making a simple Unity 2D Idle game with a lot of balls jumping around and making money. I am currently using subtags to declare them (for everyone who doesn't know that, you can make subtags, for example "Ball/Standard Ball"). Is there anyway to get all the source for the "ball" tag and return also "Ball/Standard Ball", "Ball/Strong Ball" and "Ball/Laser Ball" ?

I can't find anything on that topic and even subtags are so rarely talked about. Or is there another way to source for all game objects containing "Ball" in there name. They are all children of an Object, but not all last children.

Right now I have to search every tag one for one and add them to a list if I reference them all.

Thanks in advance:)

c# unity-game-engine tags 2d