MouseEnter and MouseLeave not changing properties

Id like to change a cursors appearance when it hovers over a GUI, but i have not been able to yet.
As you can see i tried with switching images, Ive also tried to change the ID of the image (with no success either)

Please someone help or explain why as this is, because i cant find any posts

local cursor = game:GetService("StarterGui"):WaitForChild("Main"):WaitForChild("Cursor")

script.Parent.MouseEnter:Connect(function()
	print("Detected mouse entering")
	cursor.Input.Visible = true
	cursor.Load.Visible = false
	cursor.Cursor.Visible = false
	cursor.NotAllowed.Visible = false
	cursor.Info.Visible = false
end)

script.Parent.MouseLeave:Connect(function()
	print("Detected mouse leaving")
	cursor.Input.Visible = false
	cursor.Load.Visible = false
	cursor.Cursor.Visible = true
	cursor.NotAllowed.Visible = false
	cursor.Info.Visible = false
end)

What instance are you using the MouseEnter and MouseLeave event on?

hi lc
The mouseenter is used on a textlabel

Hmmm, ok can you provide a screenshot of where the text label is and where the image should appear? (Circle the area if needed)


It should change in here

Oh? Is your image above the textlabel?

okay so first i think the gui element isn’t Active or other gui elements on top are blocking the mouse events or The cursor might be controlled by UserInputService.MouseIconEnabled which can override your images :thinking:

So the MouseEnter and MouseLeave events not reliably changing properties such as cursor visibility is a known limitation in Roblox These events can be unreliable especially when the mouse moves quickly over GUI elements This unreliability can cause inconsistencies in UI behavior

Try what I said and see if they are enabled or not and if not I will try to help you with some solutions :woozy_face:

4 Likes

It wasnt active, thanks for the help!

1 Like

i saw this post for like a split second and it was also an issue with the script, thank you aswell

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.