How do I make the middle part (white one) draggable inside of the green and red parts? For example, I want the only allowed space for it to be inside of them, so it shouldn’t exit the left side of the green part and the right side of the red part.
UMMmmmm, turn collision off on the green and red parts (or create a custom collision group for the white part… )
then put a smaller parts in each of the edges with collision on , make them the same color… then when the white part hits the edges parts (which are inside of the green and red and cannot be seen…). it stops…
and or make the edges transparent
should be simple…
and if you do not want it to go up them put a top part collision trans on… which might mess up how ur mouse detects the white part to drag it…
it that does not work then add rails to the side, and weld them to the white , trans on for and the rails hit a part above them, so the white part cannot be moved up…
dragdetector:
- DragDetector | Documentation - Roblox Creator Hub
- use axis for what axis you want (x for length, z for depth and y for height).
- max drag translation ( just do part size * 1.5 and put it in a vector 3 depending on what axis you choose)
or use the method above but surround everything and use collisiongroup:



