Mouse icon bugging out when in game, but not in studio

In a project I’m working on, player’s can hover over items then click to pick them up.
When you hover over one, your default cursor changes to a image of a hand.

This works fine in studio - see below.

But when playing the game on ROBLOX, the image turns to a strange red, pixellated texture.


(sorry for the bad picture quality here, had to take a picture of my monitor with my phone as the mouse cursor kept disappearing when I tried to screenshot)

I have zero clue why this would happen. Any help?

Things which might be useful:

This bug may not be happening to everyone either - the game link is here: The Sculpture: SCP-173 - Roblox

Most likely the problem is that the image size is on the verge of the maximum allowable. Try saving the image and reducing it to 50x50 pixels.

1 Like

Tried reuploading for both 64x64 pixels and 32x32 pixels, neither worked.

Disabled the vignette and static overlay, didn’t change anything.
Disabled the entire UI script and it didn’t change anything.

I think something’s wrong with the image file itself, when I set the image to be some thing random from the toolbox it worked fine. I’ll make a new place and test the images there to see if its something in the game affecting the images or the images themselves.

Thanks for the response.

Try preloading the image using ContentProvider service’s PreloadAsync method


-- Tested using a LocalScript in ReplicatedFirst
local ContentProvider = game:GetService("ContentProvider")

local ASSET_ID = "rbxassetid://18932196925"


ContentProvider:PreloadAsync({ASSET_ID})
1 Like

Didn’t work unfortunately, I tried the assets out in an old test world of mine and the same issue occurred, so I assume something’s wrong with the images themselves

I’ll just remake them and then reupload, thanks for the reply!

1 Like

Remade them from scratch - same bug.
Remade them again without the static thinking that was causing something to go wrong - same bug!

No clue where to go from here

Hopefully changing the mouse icon using a script fixes the issue:

-- Needs to be a client-sided script that's parented to the ClickDetector
local UserInputService = game:GetService("UserInputService")

local ASSET_ID = "rbxassetid://18932196925"

local clickDetector = script.Parent


clickDetector.MouseHoverEnter:Connect(function()
	UserInputService.MouseIcon = ASSET_ID
end)

clickDetector.MouseHoverLeave:Connect(function()
	UserInputService.MouseIcon = ''
end)

If it doesn’t, then try uploading the image using a different format (As an example, JPEG rather than PNG). If this is also unsuccessful, then it would be best to report this as a bug

1 Like

I tried uploading as JPEG’s earlier to find no success.

I’ll try this method now though.

Earlier, I made a test image (just a simple cross) and it worked fine, so there must be something wrong with the way I’m making them in photoshop - I dont think it’s an issue on ROBLOX’s end.

1 Like

Final comment.

I was able to get another one working - but just a test drawing. Whenever I tried to use the actual hand image for the cursor it wouldn’t work - no clue why this is.

Still convinced it was a problem with the image, and not ROBLOX.

The image worked fine on screen guis and surface guis, it only messed up when used as mouse.cursor.

So I’ve opted to use the solution described here: Mouse Icon is colored in game

Unsure whether to mark this as a solution? Just in case anyone else comes across the same problem or a real solution.

1 Like