if you look at that the circle passes over the grey line
if you cant understand it here
here is the code
Slider.MouseButton1Up:Connect(function()
MovingSlider = true
end)
Slider.MouseButton1Up:Connect(function()
MovingSlider = true
end)
-- Button Functions
Mouse.Button1Up:Connect(function()
MovingSlider = true
end)
Mouse.Move:Connect(function()
if MovingSlider then
local offsetY = math.floor((Mouse.X - Circle.AbsolutePosition.Y) / snapAmount + .5) * snapAmount
local offsetYclamped = math.clamp(offsetY, pixelsfromEdge, Slider.AbsoluteSize.Y - pixelsfromEdge)
local CircleNewPos = UDim2.new(-1.485,0,Circle.Position.Y, offsetY)
Circle.Position = CircleNewPos
end
end)
i got it from a tutorial but the tutorial was different so i tried making my own one but it didnt work well
and how can i make sure that dragging only works when the mouse is touching the button