Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


Edge Collider 2D component reference

Refer to the Edge Collider 2D component properties to create freeform and open path collision areas.
Read time 2 minutesLast updated 20 days ago

The Edge Collider 2D component is a Collider 2D that interacts with the 2D physics system. The collider's shape is an edge made of line segments that you can adjust to fit the shape of a sprite or any other shape. The collider’s start and end points don't need to meet or enclose an area to function. Unlike the Polygon Collider 2D, they can form a straight line or other single edge shapes.
Note
Edge colliders can't collide with other edge colliders, whatever their body type and trigger settings.

Property

Function

Edit ColliderSelect Edit Collider

Edit Collider icon

to make the collider outline editable. Refer to Edit Collider mode reference for the actions and shortcuts available when you enable Edit Collider.
MaterialSelect the Physics Material 2D that determines properties of collisions, such as friction and bounce.
Is TriggerEnable this if you want the collider to behave as a trigger. The physics system ignores the collider when you enable this option.
Used By EffectorEnable this if you want an attached Effector 2D component to use the collider.
OffsetSet the local offset values of the collider geometry.
Edge RadiusSet a value that forms a radius around the edge of the collider. This results in a larger collider with rounded convex corners. The default value is 0 (no radius).
PointsExpand to view read-only information about the complexity of the generated Collider.
Use Adjacent Start PointEnable this property to calculate the collision response using the Adjacent Start Point to form the collision normal when a collision occurs at the Edge Collider’s start point.
    Adjacent Start Point X/YSet the x and y-coordinates of the Adjacent Start Point.
Use Adjacent End PointEnable this property to calculate the collision response using the Adjacent End Point to form the collision normal when a collision occurs at the Edge Collider's end point.
    Adjacent End Point X/YSet the x and y-coordinates of the Adjacent End Point.
Layer OverridesExpand for the layer override settings.
    Layer Override PrioritySets the decision priority when this collision shape collides with another collision shape. Refer to its API documentation for more information.
    Include LayersSets the layers this collision shape collides with. Refer to
Collider2D-includeLayers
.
    Exclude LayersSets the layers this collision shape doesn't collide with. Refer to
Collider2D-excludeLayers
.
    Force Send LayersSets the layers this collision shape sends forces to during collisions. Refer to
Collider2D-forceSendLayers
.
    Force Receive LayersSets the layers this collision shape can receive forces from during collisions. Refer to
Collider2D-forceReceiveLayers
.
    Contact Capture LayersSets the layers of other Collider 2D components to capture during collisions. Refer to
Collider2D-contactCaptureLayers
.
    Callback LayersSets the layers to report collisions or triggers with. Refer to
Collider2D-callbackLayers
.

Additional resources