Problem to detect collision

Hi,
i’m trying to use this script:
void OnCollisionEnter(Collision theCollision)
{

        print(theCollision.gameObject.name);

    }

and added it to 3d Person Controller, but when i walk into level and collide with something in the consol view there isn’t nothing

can you help me?

You have to make sure that when a collision occurs, one of the 2 colliders has a rigidbody in order to get OnCollisionEnter working. I would suggest you use a rigidbody on your 3rd Person Controller, because that way it should work with any collider in your scene.

Please let me know if you got it working and mark as answered if it did :wink:

Cheers

Hi,
thanks for the help.
i try in this way to solve the problem:

void OnControllerColliderHit(ControllerColliderHit ccHit)
    {
print(ccHit.gameObject.name);
}

and for gameObject a mash collider or box collider

many thanks the same :wink: