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... Code (csharp): 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
CharacterControllers act as static colliders, meaning they won't send collision messages to other static colliders. Add a RigidBody component to your box to make it a Rigid Body Collider. It will then receive collision messages from both the sphere and the CharacterController, and you will be able to test which one it was that hit the box. Alternatively, you could add another collider and a rigidbody to the gameobject that has the CharacterController to make them send collision messages to you static box collider.