So I want this script to turn a door into a trigger so the player can go through it, then become a non-trigger when another door is opened, but the “().isTrigger = true;” won’t work
if (isYellow == true)
{
foreach(GameObject Thingy in YellowDoors)
{
Thingy.GetComponent<Renderer>().sharedMaterial.color = new Color(1, 1, 0, 0.25f);
Thingy.GetComponent<Collider>().isTrigger = true;
}
}
The line up the isTrigger line works, meaning that the foreach function is working, just not for the trigger.