Trying to find all the same objects and turn of their triggers

Does anyone know why this code not working?

GameObject[] others = GameObject.FindGameObjectsWithTag("Pick Up A"); foreach (GameObject go in others) { gameObject.GetComponent<Collider> ().isTrigger = false; }

What you would need is to reference your ‘go’ object you’re using to iterate in your foreach loop.

foreach(GameObject go in others) { go.collider.dothing; }

Yea, in your last sentence, you have to refer the nave you gave to the coliider that is coliiding, in your case “go”. So, last line must be:

go.GetComponent<Collider> ().isTrigger = false;

Enjoy :smiley: and upvote!