- Home /
cant disable more than one box collider on a game object through script.
void EnemyDies()
{
Enemy1.GetComponent<MeshRenderer>().enabled = false;
Enemy1.GetComponent<BoxCollider>().enabled = false;
Enemy1.GetComponent<BoxCollider>().enabled = false;
GetComponent<MeshRenderer>().enabled = false;
GetComponent<BoxCollider>().enabled = false;
}
When this runs, it disables the first box collider that is just a collider, but doesn't disable the second one that acts as a trigger.
Comment