OnCollisionEnter not working in my 2D project

void OnCollisionEnter(Collision collision)
    {
        Debug.Log("Player has collided with an object");
        Die();
    }

void Die()
    {
        SceneManager.LoadScene("Main");
    }

1tuy1e

There’s a snippet of the code, and a video of the problem. I have a player with a rigidbody and a box collider, and objects for the player to collide with (which also have rigidbodies and box colliders). For some reason when the player collides with the objects, OnCollisionEnter is not called. I thought this would be a simple issue to solve but for the life of me I can’t find any solution.

Any help is appreciated :slight_smile:

check if any of your colliders are triggers. in that case ontriggerenter happens

When I set the “Is Trigger” to true on both colliders, they simply pass through one another and no collision/trigger is detected

Replace this with OnCollisionEnter2D

My god, you are a LIFESAVER!

Thank you so much <3