X axis scrolling not working on ScrollingFrame

Not sure how long this has been around as I never use X axis scrolling, but I’ve noticed it does not work with X axis scrolling.

I’ve tried changing ScrollDirection, to no avail. This is broken in both studio and in game.
Repro
ScrollingBarBug.rbxl (19.8 KB)

3 Likes

I believe you need to press shift to scroll along the x-axis. I am not a fan of that behaviour though…

It is documented somewhere (can’t remember where) so I think this is intended.

1 Like

If so, it’s not a very good option. Who on earth in a game would know to do this? If we’re only intending to scroll on the X axis, I believe it should just default to that behavior.

2 Likes

Hi @NinjoOnline - thank you for reporting this issue! Horizontal scrolling is one of the items we’re looking to improve along with other changes to ScrollingFrame. It’s good to know that devs are requesting this functionality as it helps us prioritize our backlog!

2 Likes

I rely pretty heavily on horizontal scrolling in my game and I realized it didn’t seem to be properly supported a while ago, but if you need it for yours this is the solution I came up with:

function interfaceService:setupHorizontalScrolling(scrollingFrame)

local connections = {}
local position = scrollingFrame.CanvasPosition

local function verify()
	local pos = userInputService:GetMouseLocation()
	local objects = engine.playerGui:GetGuiObjectsAtPosition(pos.X, pos.Y)
	if table.find(objects, scrollingFrame) then
		return true
	end
end

table.insert(connections, userInputService.InputChanged:Connect(function(io)
	if not verify() then return end
	if io.UserInputType == Enum.UserInputType.MouseWheel then
		local diff = scrollingFrame.CanvasSize.X.Offset - scrollingFrame.AbsoluteSize.X
		diff = math.clamp(diff, 0, diff > 0 and diff or 0)
		position = position + Vector2.new(50 * io.Position.Z, 0)
		local x = position.X
		position = Vector2.new(math.clamp(position.X, 0, diff), 0)
		tweenService:Create(scrollingFrame, TweenInfo.new(0.2), {CanvasPosition = position}):Play()
	end	
end))

return connections

end

Hey, X-axis scrolling is not working for me. Is this issue still in the backlog?

1 Like

When will X-axis scrolling work?