How Can I Disable box colliders after they are activated?

Im making a fps horror game, and for the jumpscares i use box colliders. I dont want them to keep reactivating if the player was to step back and walk within those boundries again. Any help would be appreciated. Thanks :smiley:

Depending on your collider settings (“Is Trigger” checked or not):

void OnTriggerEnter(Collider other) {
	collider.enabled = false;
}
void OnCollisionEnter(Collision collision) {
	collider.enabled = false;
}