Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- using System.Collections;
- [ExecuteInEditMode]
- public class GridLockedObject : MonoBehaviour {
- void Update() {
- Vector3 position = transform.position;
- position.x = Mathf.Round(position.x);
- position.y = Mathf.Round(position.y);
- position.z = Mathf.Round(position.z);
- transform.position = position;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement