dragging objects horizontally in a grid or in increments

Hi
Just to clarify… I am a complete rookie at programming. I want to make a simple puzzle. For this I need the player to be able to click and drag a gameobject horizontally. It is important that the gameobject (which is a cube in this case) moves in a grid… or in increments so it seems like a grid. I found the script below… however I cant seem to get it to move in increments.
How should I go about doing this? Pseudo-code or actual code will be greatly appreciated!

Really no one? Hmm

Use the search feature…
This has been asked many times…

I have used it. And i havnt a answer that i could use…so therefor i post this question.