Search Unity

Collisions with terrain not working.

Discussion in 'Editor & General Support' started by wolfgang7913, May 10, 2017.

  1. wolfgang7913

    wolfgang7913

    Joined:
    Apr 25, 2017
    Posts:
    4
    Okay, So I have a rigidbody that consists of many shapes, and I have a trigger where it collides with a cube, which works fine. When I try to get it to collide with the terrain nothing happens - the Rigidbody collides and is stopped by it, but in my script, there is no detection of that.

    void OnCollisionEnter() {
    if (rb.CompareTag ("env")) {
    spd = 0;
    thud.Play ();
    hitter = true;
    }
    }

    None of this code executes when I collide with the terrain. The player is a rigidbody, it moves with force and floats above the ground. Nothing I have found on the forums has helped, so if you have any ideas please let me know ASAP.