# rmp::behavior::GridSnap

> Squares the position with a grid, AFTER everything that moves it.

Source: https://omardev29.github.io/rmp-docs/reference/behaviors/GridSnap.html

behavior `#include <rmp/behavior.h>` [include/rmp/behavior.h:337](https://github.com/omardev29/raylib_multiplatform/blob/982bf2a1e307c49776bff84211260703b8de6895/include/rmp/behavior.h#L337-L342)

struct GridSnap

Squares the position with a grid, AFTER everything that moves it. That is what keeps a puzzle piece from sitting on half a pixel when it rotates or falls, and it is why this declares _late_update and not _update.

Added to an object with `add<rmp::behavior::GridSnap>()`; the framework calls its `_late_update` with the object it is on.

## Fields

| Field | Type | Default | What it is |
|---|---|---|---|
| `cell` | `Vector2` | `{ 32, 32 }` | The grid's spacing per axis; 0 = that axis is left alone |
| `offset` | `Vector2` | `{}` | Where the grid's origin is |
