Why adding RigidBody2D to moving object with collider is recommended

At around 11:50 in the video Brice mentions that adding RigidBody2D to moving object with collider is recommended.

For those who are interested this post has several answers that explain why.
http://answers.unity3d.com/questions/129796/rigidbodoy-vs-collider.html

Phil

4 Likes

Thank you for sharing the info…!

Just what I came here looking for, because it clearly worked without a RigidBody2D. Thank you.

If there’s no rigidbody then Unity assumes the object is static, non-moving. Unity does not bother testing for collisions BETWEEN static objects. As you can imagine, this is very efficient if you have lots of scenery the player can bump into. So the purpose of having a kinematic rigidbody, rather than no rigidbody, is to turn on collision detection between this object and all other colliders in the scene (even the static ones.) Effectively you are letting Unity know that this object moves around, so Unity will then do collision-detection between it and everything else.

This is strange because actually when I add both the collider and the rigidbody, the collisions do not detect. If I remove the rigidbody from the enemy prefab, they do detect.