-
What do you want to achieve? To fix the scrolling frame constantly bouncing back up.
-
What is the issue? The custom scrolling frames don’t work, the frames don’t scroll down but up.
-
What solutions have you tried so far? N/A
-
Why did you create a custom smooth slider frame?
I’ve created a custom scrolling frame because It would look nicer like it does in an internet browser and like not stop in a corner.
The frame keeps scrolling back up. If you try to scroll back down. It scrolls back up. I wanna keep the smooth slider design, does anyone see what’s wrong with it?
My Code:
Any help would be appreciated
local down = false
local plr = game.Players.LocalPlayer
local mouse = plr:GetMouse()
local scrollspeed = 5
local friction = .9
local frames = {}
for _, v in ipairs(script.Parent:GetChildren()) do
if v:IsA("ScrollingFrame") then
table.insert(frames, v)
end
end
mouse.WheelBackward:Connect(function()
yvel = yvel + scrollspeed
down = false
end)
mouse.WheelForward:Connect(function()
down = true
yvel = yvel - scrollspeed
end)
while true do
yvel = yvel * friction
for _,scroller in ipairs(frames) do
scroller.CanvasPosition = scroller.CanvasPosition + Vector2.new(0,yvel)
end
if down then
yvel = yvel + 5
elseif not down then
yvel = yvel - 5
wait()
end
end```