Legacy Documentation: Version 5.5
Circle Collider 2D
Polygon Collider 2D

Box Collider 2D

Switch to Scripting

The Box Collider 2D component is a collider for use with 2D physics. Its shape is a rectangle with a defined position, width and height in the local coordinate space of a Sprite. Note that the rectangle is axis-aligned - that is, its edges are parallel to the x or y axes of local space.

Property: Function:
Density Changing the density here affects the mass of the GameObject’s associated Rigidbody 2D. Set the value to zero and its associated Rigidbody 2D ignores the Collider 2D for all mass calculations, including centre of mass calculations. Note that this option is only available if you have selected Use Auto Mass in an associated Rigidbody 2D component.
Material A physics Material that determines properties of collisions, such as friction and bounce.
Is Trigger Check this box if you want the Box Collider 2D to behave as a trigger.
Used by Effector Check this box if you want the Box Collider 2D to be used by an attached Effector 2D component.
Offset Set the local offset of the Collider 2D geometry.
Size Set the size of the box in local space units.
Circle Collider 2D
Polygon Collider 2D
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961