- Home /
OnCollisionEnter in 2D?
I'm sorry for the really simplistic question but I've been beating my head against this for awhile and searched through numerous solutions. This is a standard 2D platformer.
void OnCollisionEnter (Collision col) {
Debug.Log("Hello");
}
This is part of the script attached to the player object which has a rigidbody2D, both the player and scenery being collided with have box colliders. Does this just not work in 2D or am I missing something totally obvious?
And as soon as I give up on myself and post this I found OnCollisionEnter2D exists, sorry for wasting your time but hopefully someone who misses that function like me might find this useful!
please mark your question as closed or at least answered :)
I think you can't for now, you need more karma to close it.
Your answer
Follow this Question
Related Questions
Object following a path and colliding with other objects with physics. 1 Answer
How to use `Physics2D.IgnoreCollision()` to implement a one-way platform? 0 Answers
Moving a player smoothly without breaking collisions? 2 Answers
Having an array of points(vector2), how do I create a 2d terrain? (new to unity) 2 Answers