Problems with a scale tool

Hello! I am making an Obby Creator type game, but I have a problem with the scale tool.

When dragging a handle the opposite way it is, it goes two times further than my increment.

Video:

Script:

Handles.MouseButton1Down:Connect(function(normal)
		prev = 0
		oldSize = selectedPart.Size
	end)

	Handles.MouseDrag:Connect(function(id,distance)

		local delta = distance - prev
		local delta2 = math.abs(delta)
		if delta2 >= 1 then

			local oldPosition = selectedPart.Position
			local sizD = math.floor(delta / 1) * moveIncrement

			local canCollide = Handles.Adornee.CanCollide
			Handles.Adornee.CanCollide = false

			if Handles.Adornee:Resize(id, sizD) then
				prev = distance

			end

			if id.Name == "Left" or id.Name == "Right" then
				if selectedPart.Size.X < moveIncrement then
					selectedPart.Size = Vector3.new(moveIncrement, selectedPart.Size.Y, selectedPart.Size.Z)
					selectedPart.Position = oldPosition
					Handles.Adornee.CanCollide = canCollide
					return
				end
			elseif id.Name == "Back" or id.Name == "Front" then
				if selectedPart.Size.Z < moveIncrement then
					selectedPart.Size = Vector3.new(selectedPart.Size.X, selectedPart.Size.Y, moveIncrement)
					selectedPart.Position = oldPosition
					Handles.Adornee.CanCollide = canCollide
					return
				end
			elseif id.Name == "Top" or id.Name == "Bottom" then
				if selectedPart.Size.Y < moveIncrement then
					selectedPart.Size = Vector3.new(selectedPart.Size.X, moveIncrement, selectedPart.Size.Z)
					selectedPart.Position = oldPosition
					Handles.Adornee.CanCollide = canCollide
					return
				end
			end

			Handles.Adornee.CanCollide = canCollide
		end
	end)

How can I fix this?

Handles.MouseButton1Down:Connect(function(normal)
		prev = 0
		oldSize = selectedPart.Size
	end)

	Handles.MouseDrag:Connect(function(id,distance)

		local delta = Handles.DragFrame.Position - prev
		local delta2 = math.abs(delta)
		if delta2 >= 1 then

			local oldPosition = selectedPart.Position
			local sizD = math.floor(delta / 1) * moveIncrement

			local canCollide = Handles.Adornee.CanCollide
			Handles.Adornee.CanCollide = false

			if Handles.Adornee:Resize(id, sizD) then
				prev = Handles.DragFrame.Position

			end

			if id.Name == "Left" or id.Name == "Right" then
				if selectedPart.Size.X < moveIncrement then
					selectedPart.Size = oldSize + Handles.DragFrame.Position
					selectedPart.Position = oldPosition
					Handles.Adornee.CanCollide = canCollide
					return
				end
			elseif id.Name == "Back" or id.Name == "Front" then
				if selectedPart.Size.Z < moveIncrement then
					selectedPart.Size = oldSize + Handles.DragFrame.Position
					selectedPart.Position = oldPosition
					Handles.Adornee.CanCollide = canCollide
					return
				end
			elseif id.Name == "Top" or id.Name == "Bottom" then
				if selectedPart.Size.Y < moveIncrement then
					selectedPart.Size = oldSize + Handles.DragFrame.Position
					selectedPart.Position = oldPosition
					Handles.Adornee.CanCollide = canCollide
					return
				end
			end

			Handles.Adornee.CanCollide = canCollide
		end
	end)

This is what i would do and utilize the drag frame property of it

Hello! I got an error:

DragFrame is not a valid member of Handles "Players.TehEpikNoobKing.PlayerGui.MainGui.MainBuildingScript.ScaleHandles"

Are you using a drag detector?

No, I am not using a DragDetector, I am using Handles.

Drag detectors don’t have that property sorry never mind. Thought you were using that

Nah, I’m using Handles, I probably should have specified :sweat_smile: