I am making a custom scrolling frame system. The only problem I have is that the camera is zooming when you scroll. Is there a way to prevent that?
This is the code responsible for scrolling:
frame.InputChanged:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseWheel then
local canvasSize = (frame.CanvasSize.Y.Scale * frame.AbsoluteSize.Y) + frame.CanvasSize.Y.Offset
local change = input.Position.Z * (attributes.ScrollSpeed or 50)
local pos = Vector2.new(0, math.clamp(frame.CanvasPosition.Y - change, 0, canvasSize - frame.AbsoluteSize.Y))
end
end)