Mouse target on mobile is super weird i basically want to see if my simulated mouse icon for mobile is hovering over any part heres my attempt
local mouse = game.Players.LocalPlayer:GetMouse()
local gui = script.Parent
mouse.Move:Connect(function()
if gui.Position == mouse.Target.Position then
if mouse.Target.Name == "Special" then
print"gui is hovering over a special part!"
end
end
end)
I try this but it doesn't print anything or do anything my guess is the first if statement is not passing?

2 comments
It wont work on mobile as on mobile they don't have a mouse.
mouse.Target will be nil when no base part is found so .Position will cause an error. Why are you compareing the gui position to the mouse position?