- Home /
Using similar to GameObject.FindObjectsWithTag but for tag.contains.
Hey,
So in my game I have several items that need categorizing in Lists. My tag naming conventions are "PlayableCardDark", "PlayableCardLight" etc.
I need to be able to collect a list of all cards that contain "Playable" and those that contain "Dark". So all of my playable cards are in one list and all of my Dark cards are in another and there might be some that are playable and dark and some that are only playable etc.
I know I can use GameObject.FindObjectsWithTag to get the entire tags and Tag.Contains for splitting tags into elements I'd need.
But I can't seem to find a way of populating a list with all objects that contain part of a tag. Any ideas on if that exists?
Thanks in advance!
Your answer
Follow this Question
Related Questions
using Contains(gameObject) to find and destroy a gameObject from a list 2 Answers
How to not have a function affect a prefab? 2 Answers
Finding all Game Objects with multiple Tags 4 Answers
How to check a collided gameobject for valid tags? 2 Answers
Will a large array of game objects slow my game down? 2 Answers