Circle Collider 2D
Colliders play a crucial role in creating interactive AR experiences by defining the physical boundaries and properties of objects within the scene. The Circle Collider 2D is a collider component used to define a circular volume around a 2D object. It is ideal for objects with a round shape.
For 3D objects, check out the Sphere Collider component.
Add a Circle Collider 2D Component
To add a Circle Collider 2D component:
- Go to the Hierarchy panel
- Add or select a 2D object and locate its components in the Inspector panel
- Click Add component
- Go to 2D Physics
- Select Circle Collider 2D
Properties
Property | Description |
---|---|
Enable Editing | When checked, allows you to edit the collider directly in the Scene panel |
Offset | Determines the position of the center of the collider in local space. By modifying the offset, you can change the position of the collider relative to the object it is attached to. |
Radius | The radius of the collider, measured from the center to the edge of the circle. Adjusting this parameter allows you to control the size of the collider. |
Category | The layer in the physical world |
Mask | Layers where collisions can occur |
Physics Matter | Defines the physical properties of a rigid body, such as its friction and bounciness |
Is Tangible | When unchecked, the collider will not physically affect other colliders, but will still generate trigger events when another collider enters or exits its bounds. When checked, the collider will physically interact with other colliders, blocking their movement and generating collisions. This property is checked by default. |
Show Collider | When checked, this option allows the collider to become visible in the scene view, making it easier to visualize and adjust its position and size during the editing process |