# Box Collider 2D

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

```
component physics.BoxCollider2D
```

Box shape in node space.

## From a script

Grow the collider together with the sprite, for a power-up.

```aes check
package player

script Grow {
    func Apply(factor float) {
        box := node.Get<BoxCollider2D>()
        box.Size = box.Size * factor
        sr := node.Get<SpriteRenderer>()
        sr.Size = sr.Size * factor
    }
}
```

## 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. |
| Size | `Size` | `Vec2` | `(1, 1)` | Width and height in units, before the node scale. |
