Reputation: 97
I created two GameObjects.
One is box and the other one is a ball. Then I added colliders to them (BoxCollider
and CircleCollider2D
, respectively) to enable collision between them, but it's not working. When I hit play button, the ball just falling to eternity.
I searched on the internet and looked for possible solutions and they didn't work.
I've already made sure that:
RigidBody2D
to the ball.Upvotes: 0
Views: 1370
Reputation: 36
The BoxCollider and CircleCollider2D interact with physics in different dimensions, box collider physics are calculated in 3D while circle collider physics are calculated in 2D. In Unity, 3D physics and 2D physics are calculated separately so collisions between 2D and 3D colliders isn't possible. You will have to replace your box collider with a BoxCollider2D or replace your circle collider with a SphereCollider. Best of luck!
Upvotes: 2