Hello, im new to unity and I have a problem with collision with my player and terrain. The player just goed through the terrain! I added a box collider to my main character, and the trigger option is unchecked on both I also used a script that checks is collision working but it does not say anything in the debug log. I tried to attach a rigidbody to my character but then I cant controll my player normaly. Does anyone know what is wrong?
function OnCollisionEnter(collision:Collision){
if (collision.gameObject.tag == "Char")
{
print ("yay");
}
Collision signals require a rigidbody on at least one of the objects. If you're not already, you should probably use a Character Controller object (should come with one of the importable unity packages if not loaded by default).
The character controller comes with movement, jumping, and a few tweakable settings to provide a smooth and intuitive movement.
if you can't use a character controller, you'll need a rigidbody to get a CollisionEnter. It might help to adjust the gravity, restrictions, or drag in the inspector.