PcoWSkbVqDnWTu_dm2ix
We use cookies on this site to enhance your user experience
Collapse Sidebar

MouseHoverLeave

Fired when a player’s mouse moves off of the ClickDetector's parent.

Parameters

Name Type Default Description

Code Samples


Mouse Hovering On and Off of a ClickDetector

The below code will print “Oh my… PlayerName left the confines of my parent” when a player’s mouse is moved off of the ClickDetector|ClickDetector's parent, replacing “PlayerName” with the player’s name.

It will also print “Oh my… PlayerName hovered over my parent” when a player’s mouse hovers over the ClickDetector’s parent, replacing “PlayerName” with the player’s name.

In order for this example to work as expected, it must be placed in a Script or LocalScript whose parent is the ClickDetector.

script.Parent.ClickDetector.MouseHoverLeave:Connect(function(Player)
   print("Oh my... " .. Player.Name .. " left the confines of my parent")
end)

script.Parent.ClickDetector.MouseHoverEnter:Connect(function(Player)
   print("Oh my... " .. Player.Name .. " hovered over my parent")
end)