hey guys if have a problem i want to use multiple tags at once
this is to find my enemy with a tag but i want to know how i could do this
GameObject.FindWithTag("Player""Spartan_enemy"))
First tag = Player
Second tag =Spartan_enemy
i traid it but it does not work i alreddy ecpected it but dont know how to fix it the problem is in the Tag “” but i dont know if i need a . or , So how do i do this??
are you trying to get 2 different tagged objects at once. or an object with 2 tags?
As liszto said, the latter is not possible without a workaround.
However…
If your problem is the former, then perhaps I can help.
`
GameObject[] a1 = GameObject.FindGameObjectsWithTag("Spartan_enemy");
GameObject[] a2 = GameObject.FindGameObjectsWithTag("Player");
GameObject[] a3 = new GameObject[a1.Length+a2.Length];
for(int i = 0; i < a1.Length; i++)
{
a3 _= a1*; *_
* }*
* for (int j = 0; j < a2.Length; j++)* * {* _ a3[j+a1.Length] = a2*; } `*_ This is not the optimal method, especially if you only have 1 player. But it should work. “a3” will be an array containing all Spartan_enemy tagged objects and all Player tagged objects.