# Edge Collider 2D

> Aego 0.12.5 · development; docs build `4a32b816933e02930662f6a443cb25abe6050d090c55e237cbff5c44ae9b25f8`. [Build manifest](/docs-build.json).

```
component physics.EdgeCollider2D
```

Polyline for level geometry. OneSided lets bodies pass from below.

## From a script

Turn a platform into a one-way platform at run time.

```aes check
package level

script OneWay {
    var Enabled bool = true

    func Ready() {
        edge := node.Get<EdgeCollider2D>()
        edge.OneSided = Enabled
    }
}
```

## Fields

| Name | Script name | Type | Default | Description |
|---|---|---|---|---|
| Offset | `Offset` | `Vec2` | `(0, 0)` | Position of the shape in node space. |
| Is Trigger | `IsTrigger` | `bool` | `false` | Detects overlaps and sends trigger events without pushing bodies apart. |
| Friction | `Friction` | `float` | `0.6` | Resistance to sliding along other shapes; 0 is ice. Two shapes use the square root of the product. |
| Restitution | `Restitution` | `float` | `0` | Bounciness: 0 stops on impact, 1 bounces back at the same speed. Two shapes use the larger value. |
| Density | `Density` | `float` | `1` | Mass per square unit; gives the body its mass when Mass Mode is auto. |
| Points | `Points` | `[]Vec2` | `[2 items]` | Points of the line in node space, at least 2; edit them in the Scene View. |
| Loop | `Loop` | `bool` | `false` | Joins the last point to the first, for closed outlines; needs at least 3 points. |
| One Sided | `OneSided` | `bool` | `false` | Collides only from above, so bodies can jump through from below, as on a platform. |
