T.Hijd
T.Hijd

Reputation: 15

Unity: Basic 2D rigidbody doesn't detect collisions

While playing with the Unity engine I tried to add a basic collision detection in my game. I've created two simple objects which both move in a different directions, towards each other (so they collide). In the OnCollisionEnter2D(Collision2D col) method I placed a Debug.Log() to test if the collision works.

I followed the tutorials from the official Unity channel and followed the exact steps as provided. But it still doesn't work! I read almost every post on Google with the same problem, but still didn't find any solution

What did I try?

Here are two screenshots of the Gameobjects I would like to collide. (Sorry cant post images, because I got too low reputation)

enter image description here enter image description here

Upvotes: 0

Views: 3267

Answers (1)

Maifee Ul Asad
Maifee Ul Asad

Reputation: 4607

Try changing BodyType to Kinemetic

And use Debug.Log() for OnCollisionExit2D as well as OnCollisionStay2D

Upvotes: 2

Related Questions