how can My Player (with a character Controller) be destroyed if it hits a Box Collider??

i tried this but it’s doing vice-versa :frowning:

function OnControllerColliderHit(hit: ControllerColliderHit){
if (hit.transform.CompareTag(“Player”)){
Destroy(hit.gameObject);
}
}

help pls?:frowning:

OnControllerColliderHit() must be on the object with the CharacterController scirpt. So you have to do it in reverse, and have a script on the CC that check the object it collides with. So the script above should work if you 1) place in the CC and 2) check for a tag on the object with the box collider.