When you attach a collider 2D component to a GameObject, the collider 2D defines which area of the GameObject has collision and can interact with other colliders in the scene. The collider 2D is invisible, and it’s shape is about the same shape as the GameObject for more accurate collisions. You can adjust a collider’s shape and other properties in its Inspector window properties.
Colliders for 2D GameObjects all have names ending with 2D. You can’t use 3D GameObjects with 2D colliders, or 2D GameObjects with 3D colliders.
You can use the following types of collider 2Ds with Rigidbody 2D:
| Page | Description |
|---|---|
| Circle Collider 2D component reference | Refer to the Circle Collider 2D component properties to create circular colliders. |
| Box Collider 2D component reference | Refer to the Box Collider 2D component properties to create rectangular or square colliders. |
| Polygon Collider 2D component reference | Refer to the Polygon Collider 2D component properties to create freeform colliders. |
| Edge Collider 2D component reference | Refer to the Edge Collider 2D component properties to create freeform and open path collision areas. |
| Capsule Collider 2D | Techniques and resources for working with and configuring a Capsule Collider 2D. |
| Composite Collider 2D | Techniques and resources for working with and configuring a Composite Collider 2D. |
| Custom Collider 2D | Techniques and resources for working with and configuring a Custom Collider 2D. |
| Edit the collider’s geometry | Edit the geometry of a Collider 2D component. |
| Edit Collider mode reference | Explore the controls and keyboard shortcuts available when you edit a Collider 2D component. |