Edge Collider 2D
Colliders play a crucial role in creating interactive AR experiences by defining the physical boundaries and properties of objects within the scene. Edge Collider 2D is a collider component specialized for objects that require custom shapes for collision detection.
Add Edge Collider 2D
To add an Edge 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 Edge Collider 2D
Properties
Property | Description |
---|---|
Enable Editing | When checked, allows you to edit the collider directly in the Scene panel |
Point 0 | Position information of the first two-dimensional point |
Point 1 | Position information of the second two-dimensional point |
Add Point | Button to add additional two-dimensional points |
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 |