You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
drewmccluskey edited this page Feb 10, 2019
·
3 revisions
move_snap
Snaps the GameObject to the nearest grid cell
Syntax:
move_snap(cellSize)
Argument
Description
Vector2 cellSize
Grid size
Returns:void
Description:
Snaps the GameObject to the nearest specified grid cell. It is commonly used to keep objects within set positions to avoid improper collisions or for placing items to ensure they do not get stuck in another object.
Example:
move_snap(newVector2(32,32));
The above code will snap GameObject to the nearest 32x32 grid cell.