how can I find gameobjects on the scene which owners is not me?

62 Views Asked by At

The method GameObject.FindGameObjectsWithTag("name") is only searches current player(owner)'s objects, but I need all gameobjects with one tag no matter whose those gameobjects. Thanks in advance!

enter image description here

2

There are 2 best solutions below

2
robotrage On

Actually GameObject.FindGameObjectsWithTag("name") should search the whole scene for the Tag, are you sure those objects in question have the tags assigned to them?

1
Minzhur On

Actually the reason that I couldn’t find all gameobjects is I checked objects before the other player’s objects appearing on my scene (the checking method was in method Start(), so I need to put the checking method in method Update(). Lol)