Next: , Previous: , Up: Motion   [Contents][Index]


12.5 GridSnap

Component: GridSnap

Grid Snap allows you to define a custom grid per-object. To use the same grid, simply right-click this component’s header (the line at the top with the component name and collapse triangle) and click ’Copy Component’ and you can then paste it as a new component or paste it’s values into another Grid Snap. This component works both during edit and runtime, so it can be used to make a grid-based game or just to help out while snapping prefabs in the Editor.

Field of GridSnap: bool snapEachFrame

Snaps the object to the grid every single frame while the game is running? Occurs in LateUpdate.

Default value: false

Message on GridSnap: SnapToGrid ()

Immediately snaps this object to the grid. Grid snap occurs in global coordinates.

Message on GridSnap: SnapToRotGrid ()

Snaps the object’s rotation in local space to the Rotation Setting defined above.

Field of GridSnap: bool snapEachFrame

Snaps the object to the grid every single frame while the game is running? Occurs in LateUpdate.

Default value: false

Message on GridSnap: SnapToGrid ()

Immediately snaps this object to the grid. Grid snap occurs in global coordinates.

Message on GridSnap: SnapToRotGrid ()

Snaps the object’s rotation in local space to the Rotation Setting defined above.