Instantiate game objetcs based on a multi tag system
Hi everyone,
I'm trying to understand how can I instantiate game objects based on a multi-tag system, and I have some questions that hopefully someone could help me with.
My goal is to create a game with more than 100 gameObjects, where each one is labbeled with several different tags and will be spawned into the game throughout time following in ways like, for example, "instantiate next object randomly from a list of gameObjects that have tag 'a' AND tag 'b' ".
For this, I'm still trying to understand:
Shall I instantiate from Prefabs or shall I have all the GameObjects already on the GameScene (while invisible/far from player's field of sight/render)?
How to create a Multi tag system? I'm currently trying to use this one https://answers.unity.com/questions/1470694/multiple-tags-for-one-gameobject.html but I can't get the GetComponent().HasTag("Player") to work. What's a usual way to implement a multi tag system?
How to instantiate game objects randomly from a list which is the result of intersecting various lists? Like, List 1 (of objects with tag A) and list 2 (of objects with tag B) become List 3, and its from this list that one of its objects will be randomly instantiated.
I hope I was not too confusing with my questions.
Thanks everyone in advance for the help!
Looking for
Your answer
