Making stopping points for mesh with movement

I need to know how to get a mesh to stop when it gets to a specific point like a stopper. Like when i have a mesh that moves up and down with the arrow key it stops at a point and isn’t able to do a complete circle when i hold down the arrow key.

I can’t say for sure, but sounds like you need some motion constraints???