Click detector's MouseHoverEnter event not firing locally

Hello, I was having an issue with this local script, that changes a textlabel’s text whenever an object with a clickDetector that has a specific CollectionService tag is hovered over with the mouse.

As explained in the title, the event doesn’t seem to be firing at all

local cs = game:GetService("CollectionService")
local textboxes = require(game.ReplicatedStorage:WaitForChild("TextBoxModule"))
local Tooltip = textboxes:Activate(game.Players.LocalPlayer.PlayerGui:WaitForChild("Dialogue").ItemTooltip)

local function AddClickConnection(detector : ClickDetector)
	detector.MouseHoverEnter:Connect(function()
		print("Mouse Entered")
		Tooltip:AddSentences(detector.Parent.Name , 0)
	end)
	detector.MouseHoverLeave:Connect(function()
		Tooltip:AddSentences("" , 0)
	end)
end

for i , v in pairs(cs:GetTagged("Clickable")) do
	print(v.Parent)
	AddClickConnection(v)
end

cs:GetInstanceAddedSignal("Clickable"):Connect(function(Object)
	AddClickConnection(Object)
end)

Are these functions and loops firing?

1 Like

I just discovered the cause, I didn’t know that the maxActivationDistance property of clickDetectors was based on distance to the player, thought it was distance to the camera.

1 Like

Oh, lol. Glad you figured it out.

1 Like