I couldnt get game.Players.LocalPlayer:GetMouse().Icon = “myid”
to work. So that led me to creating my own icon, by disabling the default icon and running a script that places an image label at the mouses position, all nested inside it’s own screengui.
The problem is that when I hover over the hamburger icon, on the top bar, it goes behind it.
This is not desired for obvious reasons.
What I tried was setting the display order of the screengui to 99999. But that didnt work. I looked on google and the forum for some information but. Well that’s why I’m here.
Developer Guis cannot be rendered on top of CoreGuis for security reasons. Regardless of what implementation you use, your custom mouse will always end up behind a CoreGui. There is no way to change this behaviour and requests to be able to do so will be denied.
That’s unfortunate. Any idea why the mouse.Icon isnt working for me? Also, does anyone know if custom icons are available for when the mouse is over a button?
I couldnt get game.Players.LocalPlayer:GetMouse().Icon = “myid”
to work.
What do you mean with this? Did the script throw an error? Remember that the code must be in a local script.
Also, does anyone know if custom icons are available for when the mouse is over a button?
There’s something that could work. Try setting the mouse icon to a new image after a GuiButton (TextButton, etc.) signals MouseEnter, and set back the original icon after it signals MouseLeave:
--this code should be in a local script
local player = game:GetPlayers().LocalPlayer
local ID = "" -- your mouse icon id number
local newID = "" -- the mouse icon id number, which will show when hovering over a gui button
local button = script.Parent --define the button
button.MouseEnter:Connect(function()
player:GetMouse().Icon = "http://www.roblox.com/asset/?id=" .. newID
end)
button.MouseLeave:Connect(function()
player:GetMouse().Icon = "http://www.roblox.com/asset/?id=" .. ID
end)
This doesn’t actually work for me. yes I’m sure I’ve set it up correctly. In another post it says that it probably wont work as intended; Which it doesn’t.
Has anyone successfully done this?
For any skeptics, here is the code in all its simplicity.
local player = game.Players.LocalPlayer
local ico = game:GetService("ReplicatedStorage").UIAssets.Cursor.Image;
local button = script.Parent
button.MouseEnter:Connect(function()
print ("Change")
player:GetMouse().Icon = ico
end)
button.MouseLeave:Connect(function()
print ("Change back")
player:GetMouse().Icon = ico
end)
In another post I’ve read, a dev suggested using both methods; that is using a custom cursor when over a button, and reverting back to the original when not over a button. I’ll give that a shot.
That code couldn’t help you at all
About setting the mouse icon, Roblox wiki states that
this property is overridden when the mouse is hovering over a GuiButton .
This means both functions MouseEnter and MouseLeave are useless in this case. I’m sorry I couldn’t help.
However, you can counter this behaviour by setting the gui button’s Active property to false. For some reason, you will still have the same problem when you click the button tough…