How to limit dragging

initially it was like this

after i drag it will be like

i need to stop this dragging how to achieve that

Could you please be more specific about how you want the dragging to be limited?

Many properties affect dragging, including: Part.maxLocation, Part.minLocation, Part.dragComputation, and DraggingTool.isGridSnapEnabled.