function Hover()
print("Hovered")
end
script.Parent.MouseHoverEnter:connect(Hover)
This does not work because MouseHoverEnter is not a member of Part. How can i fix it without a ClickDetectors Hand Cursor?
function Hover()
print("Hovered")
end
script.Parent.MouseHoverEnter:connect(Hover)
This does not work because MouseHoverEnter is not a member of Part. How can i fix it without a ClickDetectors Hand Cursor?
Use Mouse.Target, this says the part which the mouse is on and you can see if the Target is a certain part and if it is than it will do something.
#Mouse.Target This is a property that you cannot change.
print(Mouse.Target) --Will print the name of the part you were first touching.
#Mouse.TargetFilter Will make Mouse.Target ignore some parts.
Mouse.TargetFilter = workspace.Part
print(Mouse.Target) --Should ignore part and say another part, or maybe say nil.
#Final Product
--Local Script
local plyr = game:GetService("Players").LocalPlayer
local mouse = plyr:GetMouse()
local part = workspace.Part --The part you want to do the action with.
mouse.Move:connect(function()
if mouse.Target == part then
print("Hover")
end
end)
You can incorporate a remote event/function into this so the part would print "Hover" instead of the local script.
Hope it helps!
This discussion is preserved as it was. New answers, comments, and votes are closed.
2 comments
Good answer, and well explained
you're new, aren't you...