How to make some thing snap to a axis?

How to make some thing snap to a axis for a 2D game so it can still move?

Have a look at this: http://unity3d.com/support/documentation/ScriptReference/ConfigurableJoint.html

Specifically xMotion, yMotion, and zMotion.

For more information on creating a 2D game: http://unity3d.com/support/resources/tutorials/2d-gameplay-tutorial.html

Thanks