- Home /
Question by
ThiagoTejo · Dec 20, 2013 at 01:47 AM ·
colliderarrayobject
Find all objects with the name: "object name" and disable their colliders
Hello guys, a super simple question, I'm trying to disable all colliders for objects with a certain name, how can I do this? Thanks in Advance!
Comment
Best Answer
Answer by clunk47 · Dec 20, 2013 at 01:58 AM
foreach(GameObject go in GameObject.FindObjectsOfType(typeof(GameObject)))
{
if(go.name == "objectName")
go.collider.enabled = false;
}