ScrollBar Needs to be Scaled horizontally

I need to scale the scrollbar as its not going to be the same as the shadow on all devices.
PC:

Literally; Any Other Device.

image

Help me find a fix/workaround for this please…

1 Like

What does your UI hierarchy look like?

1 Like

This problem has already been answered here -

2 Likes

image

3 Likes

Doesnt work for me, I practically tried most scripts on devforum presented to me.

2 Likes
  • Put this in a local script in your scrollingframe
local ScrollingFrame = script.Parent -- define scrolling frame
local mouse = game:GetService("Players").LocalPlayer:GetMouse()

local SCREEN_SIZE_X = mouse.ViewSizeX -- The player's device width in pixels
local STUDIO_SCREEN_SIZE_X = 1366 --Can be changed, this is your pc's width in pixels

ScrollingFrame.ScrollBarThickness = SCREEN_SIZE_X / STUDIO_SCREEN_SIZE_X * ScrollingFrame.ScrollBarThickness

2 Likes

1 Like

Edited it, it should work now (30 Limit)

1 Like

appreciate it
very much, do you also know how to fix this? or just a studio bug

Haven’t ever encountered this unfortunately

Are you wondering why you can still scroll while trying to move the character?

Just a studio bug, uh the scrolling bar is a bit too small any way to edit or fix that?

Is it too small in your pc’s screen size or on a smaller screen?

If it is too small on smaller devices, try changing the STUDIO_SCREEN_SIZE_X variable to that of your pc’s width

Alternatively, you can try using this and see if this works better
Important Note: Change the numbers in STUDIO_SCREEN_SIZE to that of your own pc’s width and length

local function average(size)
    return (size.X + size.Y) / 2
end

local ScrollingFrame = script.Parent

local SCREEN_SIZE = average(workspace.CurrentCamera.ViewportSize) -- The player's device width in pixels
local STUDIO_SCREEN_SIZE = average(Vector2.new(1366, 768)) -- Change this is to your pc's width and length in pixels respectively

ScrollingFrame.ScrollBarThickness = SCREEN_SIZE / STUDIO_SCREEN_SIZE * ScrollingFrame.ScrollBarThickness
2 Likes

your using the mobile test thing, which is making your mouse cursor behave like a finger on a touch screen, its the same behaviour like mobile

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.