Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why won't hovering over object work?

Asked by
chafava -113
4 years ago
local player = game.Players.LocalPlayer
local mouse = player:GetMouse()

while true do
if mouse.Target == script.Parent.Parent.Parent then
    print("Mouse hovering over food")
    script.Parent.BillboardGui.Enabled = true
else
    script.Parent.BillboardGui.Enabled = false
end
wait(.1)
end

It is a local script and it shows bill board gui when shown on mouse contact, you know what to do ;)

0
Could you try printing mouse.Target in the loop to see what your mouse is targeting when you're trying to target the food? This can help identify the problem. gskw 1046 — 4y
0
Roblox says Target is nil to mouse apperently. chafava -113 — 4y

Answer this question