# Multiple enemy collidiers

I currently have an enemy that upon collision kills the player with a kill script, I want to add another collider that acts as the visibility radius for said enemy. However, when adding another colldier with a bigger x radius, the collidier still kills the enemy. Is there any way to assign particular colliders specific methods using

OnTriggerEnter2D (Collider2D var)
{
}


First its good to note the difference between Colliders and Triggers

• Colliders - generally are intended to represent physics interactions, so objects "colliding with them" should not pass through one another. As opposed to...

• *Triggers* - as the name implies, "fire" off an event but don't carry the typical physics body interactions

Triggers and colliders also send different events upon interaction, and the same can be said as well for 2D and 3D objects

OnTriggerEnter: 3D | 2D

OnCollisionEnter: 3D | 2D

Knowing this there are a few ways to approach this problem. First like you suggested you could add a second collider to the enemy, and from that new Collider's Component Inspector on the enemy check the isTrigger box marking it as a "Trigger".

That will allow it to instead respond to the OnTriggerEnter Method (if it is a 2D Collider OnTriggerEnter2D)

You could also organize your Enemy GameObject with a hierarchical structure

Enemy Game Object Parent
- Damage Collider Object Child