Collider 2D コンポーネントは、物理衝突用に 2D ゲームオブジェクトの形状を定義します。コライダーは不可視なので、ゲームオブジェクトのメッシュと完全に同じ形状である必要はありません。通常は、おおまかに一致させる方がより効率が良く、ゲームプレイで目に見えた違いが出ることもありません。
2D ゲームオブジェクトの全てのコライダーの名前は “2D” で終わります。名称に “2D” が含まれないコライダーは 3D ゲームオブジェクトにしか使用できません。3D ゲームオブジェクトに 2D コライダーを設定したり、2D ゲームオブジェクトに 3D コライダーを設定することはできません。
ノート: Rigidbody 2D コンポーネントの Use Auto Mass チェックボックスを選択すると、Rigidbody 2D の質量が自動的に Collider 2D の質量と同じ値に設定されます。これは Buoyancy Effector 2D と組み合わせて使用できます。
Rigidbody 2D には以下の Collider 2D タイプが使用できます。
トピック | 説明 |
---|---|
Circle Collider 2D | Circle Collider 2D は円形の衝突領域に使用します。 |
Box Collider 2D | Box Collider 2D は正方形および長方形の衝突領域に使用します。 |
Polygon Collider 2D | Polygon Collider 2D はフリーフォームの衝突領域に使用します。 |
Edge Collider 2D | Edge Collider 2D は、フリーフォームの衝突領域と、完全に取り囲まれていない (閉じられていない) 領域 (丸みのある凸状の角など) に使用します。 |
Capsule Collider 2D | Capsule Collider 2D は、円形またはひし形の衝突領域に使用します。 |
Composite Collider 2D | Composite Collider 2D は、Box Collider 2D と Polygon Collider 2D をマージさせるために使用します。 |
Custom Collider 2D | Custom Collider 2D は、カスタマイズ可能なジオメトリを持つ衝突領域に使用します。 |
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.