Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How can you clamp a guis position when its dragable?

frame = script.Parent
frame.Draggable = true
frame.Active = true
frame.Selectable = true

math.clamp(UDim2.new(-2), UDim2.new(-2))
math.clamp(UDim2.new(0), UDim2.new(-2))

1 comment

0

Draggable isn't a property of a frame, is it?

1 answer

✓ Accepted answer

Garbage question.

while true do
	wait()
	Frame.Position = Udim2.new(
		math.clamp(Frame.Position.X, MIN, MAX)
		0,
		math.clamp(Frame.Position.Y, MIN2, MAX2)
		0,
	)
end

This discussion is preserved as it was. New answers, comments, and votes are closed.