The gui for my new slider UI is needing more mouse movement than it should, making it out of sync with the slider visuables.
As you can see here, the mouse is dispositioned from the end of the slider, giving an unsatisfying feel to the interface.
I think this has something to do with the size, as the gap increases as the speed increases.
Slider Code
local UserInputService = game:GetService("UserInputService")
local Dragging = false
Domain.Speed.Amount.Action.MouseButton1Down:Connect(function()
Dragging = true
end)
UserInputService.InputChanged:Connect(function()
if Dragging then
local MousePos = UserInputService:GetMouseLocation()+Vector2.new(0,32)
local RelPos = MousePos-Domain.Speed.Amount.AbsolutePosition
local Precent = math.clamp(RelPos.X/Domain.Speed.Amount.AbsolutePosition.X,0.014444,1)
wait(0.01)
local transitionInfo = TweenInfo.new(0.4, Enum.EasingStyle.Quint)
local tween = TweenService:Create(Domain.Speed.Amount, transitionInfo, {Size = UDim2.new(Precent,0,1,0)})
tween:Play()
game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = Precent*100
Domain.Speed.Title.Text = tostring(math.floor(game.Players.LocalPlayer.Character.Humanoid.WalkSpeed)).." walkspeed"
end
end)
UserInputService.InputEnded:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseButton1 then
Dragging = false
end
end)
Since I don’t understand what you were doing in your code, I made my own slider system just for you (which works well I guess). I also labelled things in the script so hopefully you can understand what it does. SliderTest.rbxl (35.0 KB)
Appreciate the help, but the problem with this method, is the clipdescendants part. As I’m using UICorner, the edges on the left, will look square as for some reason roblox hasn’t updated clipdescendants with UICorner.
This is why I have to use Size to increase and decrease the slider.
In that case, not much change needs to be done. The script already generates an alpha value which is from 0 to 1, and you can just plug that directly into a UDim2 value for the size.
Could you possibly change this in the LocalScript provided under Frame, I don’t understand what to do here lmao. It seems to change the Y value of size when I change the .Position to .Size for some weird reason.