Skip to main content

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:

  1. Go to the Hierarchy panel
  2. Add or select a 2D object and locate its components in the Inspector panel
  3. Click Add component
  4. Go to 2D Physics
  5. Select Edge Collider 2D
add collider

Properties

collider prop
PropertyDescription
Enable EditingWhen checked, allows you to edit the collider directly in the Scene panel
Point 0Position information of the first two-dimensional point
Point 1Position information of the second two-dimensional point
Add PointButton to add additional two-dimensional points
CategoryThe layer in the physical world
MaskLayers where collisions can occur
Physics MatterDefines the physical properties of a rigid body, such as its friction and bounciness
Is TangibleWhen 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 ColliderWhen 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