- Home /
Collision isn't detected between two obects
I have two 2D objects that I have given a rigid body 2D and box collider 2D. When I play the scene I can see the two objects collide but the collision isn't seen in the console when I have
function OnCollisionEnter(collision) {
Debug.Log("colliding");
}
Even though the collision is working, I need one of the object's script to be able to tell if the objects are colliding because I want the collision to trigger something such as health decreasing.
Comment
Answer by hbalint1 · Apr 24, 2015 at 05:30 PM
That's because you used the 3D method. Use OnCollisionEnter2D() instead.
Your answer
Follow this Question
Related Questions
2D Collision 1 Answer
My Javascript collision isn't being detected, please help. 0 Answers
2D Attacking help 1 Answer
2D Polygon Convex Decomposition Code 1 Answer