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.
(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:
There’s a vignette and static texture overlaid over the whole screen as a screen gui
I’m changing the mouse icon through the click detectors mouse icon property
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.
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})
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!
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
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.
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.