How could I change the cursor between states?

There are various built-in cursors that roblox uses:


The problem is I can’t find any way to switch between the states myself. I know I can change the mouse icon using the Icon property of the player’s mouse, but I also can’t find the rbxasset id of these cursors. Does anyone have an id/image of these cursors? Can I switch between these cursor states? Any help would be appreciated.

1 Like

Try going into Roblox’s files then downloading the mouse icons then uploading them to Roblox. or just go into toolbox and try to find one because Roblox uses actual file icons not toolbox decals.

also, can perhaps show or tell me what you are trying to accomplish with this?

I have grabbable parts and I am making it so that when a player hovers over and clicks those parts the cursor changes

do you have the decal id?
I can try helping you

No, I dont have the decal id of the roblox cursors yet, where does roblox store the mouse icons?

https://developer.roblox.com/en-us/api-reference/property/Mouse/Icon
Roblox has some default icons


Example in LocalScript:

local Player = game:GetService("Players").LocalPlayer
local Mouse = Player:GetMouse()

Mouse.Icon = "rbxasset://SystemCursors/Arrow"

Unfortunately those are for plugins only, so they don’t work in-game. I was trying to save the images off of the website but they don’t have a transparent background

yes, you could try when the mouse hovers the cursor could be the openhand, and when you click it will be closed hand

are you using a click detector?
if so, go inside its properties and change the cursor icon to

rbxasset://SystemCursors/OpenHand

You can probably save each of those icons as an image (or custom ones) and upload them to Roblox as a decal. Just change the mouse icon to that decalId:

local Player = game:GetService("Players").LocalPlayer
local Mouse = Player:GetMouse()

local mouseIconId = 0
Mouse.Icon = "http://www.roblox.com/asset?id=" .. mouseIconId

You can download the icons and upload them to Roblox decals here:
https://www.roblox.com/develop?View=13

Just search ‘cursor packs’ for your own custom.

no, i am using a raycast that changes the cursor based on what it is hovering over, i dont want to put a click detector inside all of the grabbable objects

then try what @NicoleSydor said

1 Like

The mouse’s behavior is handled by C++ code, its state is therefore handled outside of an environment available to user developers. If you want the mouse to exhibit custom states then you’ll need to code that behavior your self.

local Game = game
local Players = Game:GetService("Players")
local Player = Players.LocalPlayer
local Mouse = Player:GetMouse()

while true do
	if Mouse.Target.Name == "Example" then --Name of an example part instance.
		Mouse.Icon = "rbxassetid://0" --Change mouse's icon accordingly.
	end
end

You can find transparent versions of various cursor icons in the following directory.
C:\Users\<PCName>\AppData\Local\Roblox\Versions\version-<Version>\content\textures\Cursors

3 Likes