Mouse.Icon not showing up in games

I’m having trouble with changing my mouse icon. The code is correct, and the icon shows up as expected during Roblox Studio tests.

However, when actually playing the game on Roblox, the icon doesn’t show, or rather just shows the default icon. I know there’s something about size limitations, but my cursor image is 8x8 pixels.

I’ve tried cropping the image size using a basic software to 8x8 pixels, and I’ve tried both implementing it on Roblox Studio as my image, and making it a decal to then use as the icon, but none of these solutions worked.

I did then try searching up these solutions, and they did give some ideas, mentioning the icon size limit, and other things irrelevant to my issue.

Please help me with this. Thank you.

Script:

--game.StarterPlayerScripts.MouseIcon:

local player = game.Players.LocalPlayer
local mouse = player:GetMouse()

mouse.Icon = "http://www.roblox.com/asset?id=14200341458"

(this is my first post btw)

3 Likes
  1. It’s possible your code is running before the Player and Mouse objects are fully initialized. In that case, you should wait for the player to load before setting the mouse icon.
  2. The Asset ID in your code might not be correct or not publicly available. Ensure that you’re using the correct Asset ID, and it is publicly available for use.
1 Like

The ID is from a decal I published, and :GetMouse() would surely get the mouse, or wait until it exists.

The mouse icon (8x8 pixels):

Use UserInputService.MouseIcon Instead, as it has superceded Mouse

The mouse icon loads on Roblox Studio, but not actually in-game. :GetMouse() works, the icon itself has an issue.

if not game:IsLoaded() then
    game.Loaded:Wait()
end

You’re not understanding me very clearly.

The code works, it’s just not showing up on an actual Roblox game. It’s something with the ID.

Did you publish to roblox after the script was added?

My game has been published a very long time ago.
Edit: I do publish it every now and then.

Then it’s no longer a scripting issue. This no longer belongs in Scripting Support.

Can I still get a solution to this?

the script worked when i tried it in game and in studios so im not rlly sure why it isn’t working for you.

It’s not working when I actually play the game on the Roblox platform. Only works on Roblox Studio testing.

And I know it’s not just an issue with me, because I tried it on my phone on an alt account, the icon also didn’t show up.

did you try republishing the game after the script was added?

Any chance you have collaborative editing/team create enabled? You’ll need to commit your script drafts and then publish your game.

Like @MythicalFireMarvel said, I was able to get this to work in Studio and in a live experience with no complications.

I publish the game every hour so I don’t lose any progress.
And I’m sure I published it after script changes.

Collaborative editing is off. Thanks for clarifying though.

This is in Roblox Studio:


And this is in an actual Roblox game:

The game:

1 Like

i joined it and the icon is there