environnement perseption probleme

hello,

for a combat game projet, i try code a environnement perception for character. i have create a trigger around player and i would like use tag for authorize or not a action. for test my trigger, i use this simple script:

function OnTriggerEnter(other:Collider) {
Destroy(other.gameObject);
}

and, i d’ont understand why, this script work for kill other character, but it doesn’t work for other object :confused:

have you a idea for this probleme?

(sorry for my english ^^)

else, have you a other solution for get what is around the player?

it’s work with character controller, but isn’t a good solution for every object. exist other solution?

OnTriggerEnter only gets called on objects that have a Collider component attached.

my object have box collider or mesh collider.

other idea?

Do the colliders or a parent object of them have a rigidbody?

i have try with rigidbody and without.

Are you mixing 2d and 3d colliders?

3D, i have try with mesh collider and box collider

Has your player a rigidbody?

my player have a rigidbody and collider.