ClickDetector Mouse Icon Not Working

i have changed the default mouse icon by using a local script but now when i hover above click detectors the cursor icon i set doesnt work? iv done some research and this is a roblox issue im just asking here if theirs a way to circumvent this problem

local m = player:GetMouse()
m.Icon = "http://www.roblox.com/asset/?id=569021388"
1 Like

Clickdetectors have their own property called CursorIcon
image

maybe you can use that?

2 Likes

yeah i was but iv done research and CursorIcon is pretty buggy from looking at other posts, if you assign your own mouse icon then it doesnt seem to work? i’m just tryna see if theirs anyway to get around this.

1 Like

oh I didn’t know it was buggy :man_shrugging:

maybe this could work?

local Mouse = Player:GetMouse()

Mouse.Move:Connect(function()
	local MouseHovering = Mouse.Target
	if not MouseHovering then return end

	if not MouseHovering:IsA("MeshPart") and not MouseHovering:IsA("BasePart") and not MouseHovering:FindFirstChildOfClass("ClickDetector") then return end
	Mouse.Icon = "icon"
end)
2 Likes

if i were to go that route would it not be easier to go to using clickdetector hovering event?

1 Like

yeah that works to (charcharchar)

1 Like

the solution you gave me kinda just switches the icon permanately instead of only doing it whilst hovering and im not really sure how i could modify it to work sorry for the reply

local Mouse = Player:GetMouse()

Mouse.Move:Connect(function()
	local MouseHovering = Mouse.Target
	if not MouseHovering then return end

	if not MouseHovering:IsA("MeshPart") and not MouseHovering:IsA("BasePart") then 
		Mouse.Icon = "NormalIcon"
		return 
	end

	if MouseHovering:FindFirstChildOfClass("ClickDetector") then
		Mouse.Icon = "ClickDetectorIcon"
	else
		Mouse.Icon = "NormalIcon"
	end
end)
2 Likes

You could use a loop to check if the mouse target has a click detector inside it?

local mouse = game.Players.LocalPlayer:GetMouse()

game:GetService("RunService").RenderStepped:Connect(function()
   if mouse.Target:FindFirstChildOfClass("ClickDetector") then
      mouse.Icon = "HoverIcon"
   else
      mouse.Icon = "Normal"
   end
end)
1 Like

This is a better method as it uses less resources, this will only run the code when the mouse is moving.

1 Like

try using an rbxassetid:// instead of a normal link
image
image

1 Like

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