Give names to colliders(triggers) to refer them in script

I have a collider on enemy to check distance from enemy to player (that’s begin chase distance), but I need one more collider, I guess, for begin attack. But if I’ll add two colliders with different radiuses and set them as triggers (checkboxes), then script would not know which collider-trigger I refer to…

so is it posssible to give names to collider-triggers for scripting purposes?

I also wanted to deactivate all colliders/triggers on enemy kill (when enemy becomes enemy corpse, I deactivate collider so I can walk over them without colliding corpses). But I can only getcomponent() of some kind, but if there are two of same kind - that’s a problem…

or there’s other way?

I would use Vector3.Distance(), but for your case I think you’ll have to separate these colliders by adding them to different game objects as children, then you can use transforms’ names or tags check in if statements of your OnTriggerEnter() and etc. functions.

To deactivate all colliders you can get corpse root object and get all its colliders and just, well:

foreach (Collider collider in corpse.GetComponentsInChildren()) { collider.enable = false; }