How do i make in-game resizing gui like a window in windows?

I am making a window like gui and right now im making resizing gui frame but the resizing looks terrible
can anyone help here is my code:

local LP = UIS:GetMouseLocation().X --Last position of mouse

game:GetService("RunService").RenderStepped:Connect(function()
	if D then
		local Delta = UIS:GetMouseLocation().X - LP
		
		script.Parent.Parent.Parent.Size = script.Parent.Parent.Parent.Size + UDim2.new(0,Delta,0,0)
		
		LP = UIS:GetMouseLocation().X
	end
end)

the problem i have is it slide so much with a simple move

thanks

I would recommend using :TweenSize and making sure you have an anchor point so it doesn’t resize tilted.

1 Like