-
-
Notifications
You must be signed in to change notification settings - Fork 18
move_snap
drewmccluskey edited this page Feb 10, 2019
·
3 revisions
Snaps the GameObject to the nearest grid cell
move_snap(cellSize)
Argument | Description |
---|---|
Vector2 cellSize |
Grid size |
Returns: void
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.
move_snap(new Vector2(32,32));
The above code will snap GameObject
to the nearest 32x32 grid cell.
Back to Movement