Hello
I have a box collider that I need to destroy when it collides with the CharacterController but not with another objet, let’s say a Sphere.
I use…
function OnCollisionEnter (collision : Collision) {
if (collision.gameObject.name == "MyChar") {
Destroy (gameObject);
}
But it does not work. However, if I change “MyChar” for the name of the sphere it works the other way around, destroying itself when colliding with the sphere.
In other words, how can I make a CharacterController generate the OnCollisionEnter message in a box collider?
Thanks
Andres