# Smoothly follow grid

**URL:** <https://forum.kirupa.com/t/smoothly-follow-grid/297010>\
**Category:** Uncategorized\
**Created:** [September 24, 2009, 2:53am UTC](https://forum.kirupa.com/t/smoothly-follow-grid/297010 "2009-09-24T02:53:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![pi3rc3](https://avatars.discourse-cdn.com/v4/letter/p/dfb087/32.png) [@pi3rc3](https://forum.kirupa.com/u/pi3rc3)\
**Post date:** [September 24, 2009, 2:53am UTC](https://forum.kirupa.com/t/smoothly-follow-grid/297010/1 "2009-09-24T02:53:50Z")

</div>

im using

```auto
var gridsize:int = 33;
			
this.x = int((game.theMouse.x)/ gridsize) *(gridsize)+4;
this.y = int((game.theMouse.y)/ gridsize) *(gridsize)-4;

```

to make a block follow grid but it moves really ruggedly especially if your trying to move horizontally. is there a way i can add some type of smoothing to its movements?
