How can I make a draggable part locked between two parts?

dragdetector:

or use the method above but surround everything and use collisiongroup: