Is there a way to change the click mouse icon?

I didn’t explain fully in the title, but basically, what i’m trying to do is change the player mouse icon when they hover over a gui button, and changes back to the custom mouse icon i made. Here’s what code ive tried using:

local ImageLabel = script.Parent
local player = game:GetService("Players").LocalPlayer
local mouse = player:GetMouse()
local connection

local function CheckMouse()
	ImageLabel.Position = UDim2.new(0, mouse.X + 10, 0, mouse.Y + 5)
	ImageLabel.Visible = false
	mouse.Icon = 'http://www.roblox.com/asset/?id=493788843'
	local target = mouse.Target
	if target and target.Parent then

		if target.Parent:FindFirstChild("TextButton") then
			connection = target.Parent:FindFirstChild("TextButton").Changed:Connect(function(property)
				if property == "Position" or property == "Orientation" then
					CheckMouse()
					connection:Disconnect()
				end
			end)
			ImageLabel.Visible = true
			mouse.Icon = 'http://www.roblox.com/asset/?id='
		end

	end
end

mouse.Move:Connect(CheckMouse)

When i tried making it instead have no mouse icon when hovering over but then showing an image label so its like a different clicking mouse icon, it didn’t do anything at all, and just had the normal click mouse icon still.

You could change the mouse icon when it hovers over a clickable gui, change it to a clicking icon when it clicks and then reset it to the normal icon?

I have also tried that, but it also does nothing when hovering over a gui button (yes i will make all the gui clickable buttons also be detected, im just testing with a text button currently)

1 Like

Consider making a general implementation that’s divorced from any specific Gui objects. Use InputChanged and check for changes when the MouseMovement UserInputType is passed for the current mouse object (with deferred events you may need to use RunService instead?). Couple that with GetGuiObjectsAtPosition and offer the XY coordinates in the InputObject to this function. From the returned table, check if there’s a non-zero number of GuiButtons in that list. If so change the icon accordingly or set it to the default.

1 Like

Marking this as a solution. Thanks!