When the player is holding a Tool, the Tool’s mouse input seems to override the functionality of ClickDetector, specifically MouseHoverEnter and MouseClick. As a result, my BillboardGui (meant to show interactable buttons on hover) doesn’t appear while the Tool is equipped.
If there’s no reliable workaround for this issue with tools blocking ClickDetector interactions, I’m open to changing my approach entirely for example, using an inventory system. I’d really appreciate any advice on the best path forward!
Here’s what the system does:
When hovering over a shelf part with a (ClickDetector), a BillboardGui appears above it with interactable UI.
When the player has a Tool equipped, they can click “Place Vinyl” on the BillboardGui to drop the Tool onto the shelf.
What i have tried:
I have looked around the forum for fixes and found some solutions that could work but i have not been lucky enough to get them to fix the problem.
Here is a video showing the problem:
Here is a small part of the code used:
clickDetector.MouseHoverEnter:Connect(function(plr)
local playerGui = plr:WaitForChild("PlayerGui")
local hoverUi = playerGui:WaitForChild("ShelfButtonsUI")
hoverUi.Adornee = spaces
hoverUi.Enabled = true
hoverUi.StudsOffset = Vector3.new(0, 2, 0)
end)
clickDetector.MouseHoverLeave:Connect(function(plr)
local playerGui = plr:WaitForChild("PlayerGui")
local hoverUi = playerGui:WaitForChild("ShelfButtonsUI")
hoverUi.Adornee = nil
hoverUi.Enabled = false
end)
Maybe disabling the tool would work? Since it disables the activate event, maybe it would make it so the tool no longer always says you can click on something: Tool | Documentation - Roblox Creator Hub
Any tool that still needs input, just using user input service should still work while holding the tool, even if the tool is disabled.
I tested out disabling the tool, but doesn’t seem to fix the issue. I tried both looping through tools and disabling them, disabling a tool on equipped and disabling once received tool. But still having the same overriding issue.
I am going to do some tests with UserInputService and see what kind of results i can get, thanks for the response!
i just fixed a similar issue in my own game where i have a highlight system that highlights objects with clickdetectors and couldnt find any help beforehand too. before it was using the clickdetectors mouse hover enter/leave and tools would always override this, to combat it i made it so the game constantly tracks what object the players mouse is on (get local player then mouse.target) using run service heartbeat and it also checks if the object has a click detector or not and highlights it (in your case it triggers the ui)
also if you want to click through the tool just get mouse target every tool activation and if the object has a clickdetector use a remote event to fire the clickdetector instance to every clickdetector script but then make sure you check that the click detector you fired matches the clickdetector in the script so that it doesnt activate every clickdetector script at once