# OnCollisionEnter not called when two colliders collide

In my 2D game, there is a ball with a circle collider ,and a platform with a box collider.

The ball has a material for bounciness and a rigidbody2D. The platform only has the box collider.

I find it to be as simple as could be, but it's not working for some reason, so apparently it's not that simple. Here's the C# code snippet found in the ball class which is attached to the ball game object:

void OnCollisionEnter(Collision other)
{
Debug.Log("Hit");
animator.Play("Bounce");
}


Why isn't the function being called on collision? Any idea would be appreciated.

• Set the isTrigger property to True in the collider you want to trigger this event – Luis Masuelli Aug 21 '16 at 2:20
• there's a problem with that, the ball then goes through the gameobject, I want it to bounce off the platform, not go through it. – Alox Aug 21 '16 at 2:25
• Can you confirm that when you say "box collider", you mean "box collider 2D"? Don't be confused by the comment made by @LuisMasuelli; you only want your collider to be set as a trigger if it actually acts as a trigger. Setting it to isTrigger = true will not likely fix your problem, but rather cause more problems. – Gnemlock Aug 21 '16 at 2:37
• yes, everything is the 2d ones. Box Collider 2D, Rigidbody 2D, Circle Collider 2D – Alox Aug 21 '16 at 3:05

void OnCollisionEnter2D(Collision2D other)