# Polygon Collider 2D

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

```
component physics.PolygonCollider2D
```

Convex polygon of 3 to 8 points.

## From a script

`Points` is read-only in scripts; the shape is edited in the Inspector. Scripts change the surface instead.

```aes check
package game

script Ice {
    func Ready() {
        poly := node.Get<PolygonCollider2D>()
        poly.Friction = 0.02
        poly.Restitution = 0
    }
}
```

## 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` | `[4 items]` | Corners in node space, 3 to 8, forming a convex shape; edit them in the Scene View. |
