SmoothCorners(ControlPoint)
-- control point generation up here ^^
ControlPoint.MouseButton1Up:Connect(function()
print('up')
ActiveControlPoint = nil
end)
ControlPoint.MouseButton1Down:Connect(function()
print('down')
if ActiveControlPoint ~= ControlPoint then
ActiveControlPoint = ControlPoint
task.spawn(function()
repeat
local Position = Vector2.new(math.clamp(UserInput:GetMouseLocation().X / X, -1, 1), math.clamp(UserInput:GetMouseLocation().Y / Y, -1, 1))
ControlPoint.Position = UDim2.fromScale(Position.X, Position.Y)
----p1 = GetControlPointRelativePosition(p1)
task.wait()
until ActiveControlPoint ~= ControlPoint
end)
end
end)
end
why does the repeat until throttle the script?