GridAlignment


Declaration

public sealed class GridAlignment : MonoBehaviour

Description

Snaps an object's position, rotation, and scale to grid increments.

Properties

unitSizeThe base unit scale of the grid.
positionIncrementThe amount of units the position is rounded to on the grid.
scaleIncrementThe amount of units the scale is rounded to on the grid.
rotationIncrementThe amount of units the rotation is rounded to on the grid.

Methods

AlignToGridUpdates the transform of the object to align to the grid.
SnapSnaps a vector to the grid at a given increment.