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:
トピック | 説明 |
---|---|
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 component reference | Refer to the Capsule Collider 2D component properties to create cylindrical shaped collision areas with round ends. |
Composite Collider 2D component reference | Refer to the Composite Collider 2D properties to merge other collider shapes into a single collider. |
Custom Collider 2D component reference | Refer to the Custom Collider 2D properties to create customizable collision geometry. |
Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
Provide more information
You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:
You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:
You've told us there is information missing from this page. Please tell us more about what's missing:
You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:
You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:
You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:
You've told us this page has a problem. Please tell us more about what's wrong:
Thank you for helping to make the Unity documentation better!
Your feedback has been submitted as a ticket for our documentation team to review.
We are not able to reply to every ticket submitted.