ClickDetector.MouseHoverEnter not working

  1. What do you want to achieve?
    I want to make a GUI frame visible when the player hovers over a hitbox.

  2. What is the issue?
    The event simply wont work.

  3. What solutions have you tried so far?
    I’ve tried looking for similar problems but couldn’t find answers and I’ve tried putting a print in the functions which didn’t work (didn’t print).

local model = script.Parent
local box = model.HitBox
local cd = box.ClickDetector

cd.MouseHoverEnter:Connect(function(plr)
	local ui = plr.PlayerGui.PickInfo.Frame
	ui.Visible = true
	print("Hover")
	
	ui.Text.Text = "Pistol"
end)

cd.MouseHoverLeave:Connect(function(plr)
	local ui = plr.PlayerGui.PickInfo.Frame
	ui.Visible = false
	print("Hover End")

	ui.Text.Text = "Pistol"
end)

It works fine for me. Are you sure you don’t have any client scripts affecting the visibility of the frame?

1 Like

This is the only script that affects it, is it bc the gun is on the ground or something like that?
It doesn’t event print.
(hitbox is chosen in this sc)
image

Try anchoring the gun and see if it still doesn’t work. It could just be a problem with click detectors.

1 Like

Still doesn’t work, starting to think that its a engine bug.

Are you sure the ScreenGui is enabled? It probably is but i’m just wondering.

1 Like

Double checked all 3 GUI elements, only thing that is not is the frame.

Well, not sure if I should feel like a idiot or not but the solution was to enable CanQuery.