FindGameObjectsWithTag and BoxCollider

Hello,

i have trouble with FindGameObjectsWithTag in Combination with a BoxCollider.

currently i have at least 6 GameObjects(Prefab clone), which have all BoxColliders and NavMeshes. They have all the same Tag and some of them have different Layers (Waypoints).

If the Scene starts, i get an Debug.Log output of all, after a while i disable the Box Collider in the Inspector/Script of a random GameObject. Instead of getting still all 6 GameObjects i just get 2,3,4 GameObjects. All of them are still active and have a Tag, no Unity Exception.

I tried to access one of the missing GameObjects with GameObject.Find(“xxx”) and “xxx” had still the same Tag.

Im rly confused, but to top that, if i disable different BoxColliders different GameObjects are missing from FindGameObjectsWithTag.

The whole runs in Unity 4.6.1 and Windows.

Okay i found the solution, i’m retarded, maybe 1 am was too late for this stuff.

I had a return instead of continue and because of the ordering of the Objects returned by FindGameObjectsWithTag, it had different results :smiley:

So this hint with “Show RELEVANT code” was indeed a valid solution :smiley: