Mouse.Icon isn't changing

Hello!

In Studio I’m attempting to change my mouse icon in Roblox but it just refuses. No errors.

This is the image I’m attempting to change the mouse icon to: Small Tall Cursor - Roblox

I’ve searched the forums of course but they all include the same 2 lines of code that seems to work for everybody else.
(i.e.)

local mouse = game.Players.LocalPlayer:GetMouse()
mouse.Icon = "rbxassetid://ID"

Here is my script:

print("SCRIPT STARTED")

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

print("SCRIPT BEGAN")

for i = 3, 0, -1 do
	print(i)
	
	task.wait(1)
end

local mouse = game.Players.LocalPlayer:GetMouse()
mouse.Icon = "rbxassetid://14068895064"
print(mouse.Icon)

print("SCRIPT ENDED")

The output is as follows:

13:24:52.527  SCRIPT STARTED  -  Client - LocalScript:1
  13:24:52.527  SCRIPT BEGAN  -  Client - LocalScript:7
  13:24:52.527  3  -  Client - LocalScript:10
  13:24:54.684  2  -  Client - LocalScript:10
  13:24:55.697  1  -  Client - LocalScript:10
  13:24:56.700  0  -  Client - LocalScript:10
  13:24:57.717  rbxassetid://14068895064  -  Client - LocalScript:17
  13:24:57.717  SCRIPT ENDED  -  Client - LocalScript:19

No immediate observable issues of course besides the mouse icon not changing.

I’ve also tried using a more formatted url i.e. "http://www.roblox.com/asset/?id=14068895064" however nothing changes.

I have the image loaded as a decal in the workspace to pre-load it but that doesn’t seem to do anything.

The script is a LocalScript inside StarterPlayerScripts.

I have tried setting the icon in a loop but that also does nothing.

For those who may be wondering, by doing nothing I mean the mouse icon stays the same:

image

I appreciate any suggestions.

3 Likes

Maybe instead of using game.Players.LocalPlayer:GetMouse(), try using userinput service instead. Like this

local userinputservice = game:GetService(“UserInputService”)

userinputservice.MouseIcon = “Your ID”

3 Likes

I am not the OP but I tried this along with the OPs way and neither of these work. Does it work for you?

1 Like

Currently experiencing the same issue.
You might wanna try the game outside of studio as I was informed it might give a different outcome.
UserInputService is also preferred over :GetMouse() so you might wanna try

local UserInputService = game:GetService("UserInputService")

UserInputService.MouseIcon = "rbxassetid://14068895064"

(Oops responded to wrong person mis-clicked)

2 Likes

I’ve never used that tactic. I’ve always used UserInputService. Try that instead of using Player.LocalPlayer:GetMouse()

have you tried creating a StringValue as a child of your script and setting the StringValue to “rbxassetid://yourid”?
throwing it out there

1 Like

i had tried both and i’m experiencing the same issue as the op, has it ever worked for you

1 Like

Maybe try this? It works for me at least:

--put this in starter gui
local id = --your id
local plr = game.Players.LocalPlayer
local mouse = plr:GetMouse()

mouse.Moved:Connect(function()
mouse.Icon = id
end)


1 Like

It has, but Ive never used it properly because my screen goes wack if a game has a custom cursor. Instead I do what the game DOORS did. Disable the mouse icon, slap a dot cursor or mouse cusor decal, and boom, your own custom mouse that is somewhat off centered.

1 Like

Got it.
Cursor is currently broken in Studio, so you’ll have to test it in the actual game.
You also have to put the local script inside StarterGui, using the script I provided it should work.

2 Likes

Mouse.Icon is broken atm, use this. Make sure decal is adjusted to it’s size.

local Player = game:GetService("Players").LocalPlayer
local Mouse = Player:GetMouse()
local vGui = Player:WaitForChild("PlayerGui")
local Run = game:GetService("RunService")
Mouse.Icon = ""
Run.Stepped:Connect(function()
	vGui.Mouse.ImageLabel.Position = UDim2.new(0,Mouse.X, 0, Mouse.Y)
end)

image
ImageLabel not decal oops.

2 Likes

As first responder mentioning an issue you get solution. However credit also goes to @Z3SC as it is true that the cursor is currently broken in studio and can only be edited in-game. Thank you all.

1 Like

Same thing was happening to me! I had to get the ID from an image label. I’m guess the image label and decal are two separate Id’s.

1 Like

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