# Unity3D: Rigidbody2D not colliding with BoxCollider2D

In Unity3D (Version 5.3.1f1 Personal) I have a scene with a sprite with a Rigidbody2D and some sprites with a BoxCollider2D. The BoxColliders don't have the Is Trigger enabled and the RigidBody is not Kinematic, but they are not colliding. What am I doing wrong?

• The RigidBody gameobject also requires a Collider in order for collisions to work – jgallant Aug 9 '16 at 17:02

Rigidbody2D is a component that gives the GameObject physics properties like gravity, mass, drag etc in a 2D environment.

BoxCollider2D is component that gives the GameObject a box shaped collision detector with certain surface properties in a 2D environment.

When you simulate physics in your game like object falling with gravitational acceleration, stop moving when in contact with another collision detector, having force applied etc you need both BoxCollider2D and Rigidbody2D.

In some case like non moving obstacles where we usually don't want physics simulation but just collision detection or trigger detection, Rigidbody2D can be ignored. But one of the collides must have Rigidbody2D in it for collision or trigger detection.

There is also layer based collision detection if you want work with layers of collision detection or ignorance.

• The collision now works, but the player tilts when it touches a wall (see this GIF: i.imgur.com/llVGNPy.gif) – Jonas Kohl Aug 9 '16 at 18:53
• try freezing Z rotation on the Rigidbody – spectacularbob Aug 9 '16 at 19:05
• mark as right answer if things work for you. – Sourav Paul Roman Aug 9 '16 at 19:35