How to stop BillboardGUI from taking over scroll wheel

I have a bunch of billboard guis in my game. In test mode if I try zooming in or out with the scroll wheel, sometimes my cursor is accidentally in a billboard gui. This causes it to take over the scroll wheel input. Then if I move my mouse outside of the gui, sometimes the scroll wheel stops working until I right click and orbit to move the camera around.

The billboard gui doesn’t have any scrolling elements, so i’m not sure why its taking over the scroll wheel anyway.

3 Likes

This is typically what happens when the mouse moves over an element with the Active property on. If any of your elements have Active enabled, they will capture the mouse focus.

There are image buttons inside the billboard gui that i need to work

what should I do to fix this unwanted behavior then? it really messes with zooming in and out even after the mouse cursor is moved from the gui.

Just turn off Active. GuiButtons can still be interacted with even if Active is off.

If you’re using the Activated event to determine when a button has been clicked, change that to another method (e.g. InputBegan of the button, not UserInputService). Refer to GuiObject.Active for documentation of what behaviour this property gives and what’s affected by it.

1 Like

I am connecting to ImageButton.MouseButton1Click and it doesn’t fire if the billboard gui is not Active.

You can change this to InputBegan instead. It’s also more universal in the instance that you want other input types to pass, such as touch taps.

ImageButton.InputBegan:Connect(function (inputObject)
    if not (inputObject.UserInputType == Enum.UserInputType.MouseButton1) then return end

    -- Your code here
end)

If you’re insistent on using MouseButton1Click but it doesn’t fire when Active is on, you can’t work around this problem. Active will sink input to the 3D world, which zooming (the scroll wheel) is considered. Active needs to be off to prevent a Gui element from capturing the mouse.

stair.InputBegan:Connect(function (inputObject)
if not (inputObject.UserInputType == Enum.UserInputType.MouseButton1) then return end
click("placeStair")
end)

floor.InputBegan:Connect(function(inputObject)
if not (inputObject.UserInputType == Enum.UserInputType.MouseButton1) then return end
click("placeFloor")
end)

This is inside a localscript. stair and floor are ImageButtons. click is my own method. Its not working whatd I do wrong.

And this is all when your GuiObjects have active off? This isn’t expected behaviour. I would assume that your functions start working when you turn Active on, though.

While I don’t have any specific answer to that problem and it’s worth other investigation, the answer for the question you have posted in the OP is just that: GuiObjects with the Active property enabled will sink input and need to be off to avoid that from happening.

uhhh this is awkward but I actually made the gui inactive instead of the imagebuttons… now I made the imagebuttons and the gui active and its working like you said

also i can still use mouse1click

I am having the exact opposite issue. None of my scrollingframes placed inside the billboard UI’s are reacting to the scrolling wheel. Active property is enabled, but the bug still occurs. Are you able to make a scrollingwheel inside a billboard ui that is reacting to a mouse wheel input?

Did roblox change the property. Right now even with active on the scrollingframes within the billboardgui refuses to recognize any mouse wheel input. Are you able to produce a billboardUI with a scrollingframe inside that is able to scroll using the mouse wheel?

Active hasn’t changed but if you meant the behaviour then I’m not particularly sure, consider creating a new thread for help if your problem isn’t the same as what OP is facing.

I personally never have put a ScrollingFrame inside a BillboardGui and never really intend to so I’m not particularly sure of any resolutions to any related problems regarding putting ScrollingFrames in BillboardGuis. I only know of Active’s ability to steal mouse input.

1 Like

I would usually do screenguis. The idea was to use the adornee function of billboardgui instead of having to position the screengui on a renderstep to simulate adornee. It’s not really a big deal but I was curious since the behaviour from the OP was what I originally intended to have.

Edit: I might have misunderstood the OP since they don’t directly say that the mouse wheel is working on a scrollingframe, rather that the camera might not be changing when the mouse is hovering above the scrollingframe inside a billboardgui