I have a custom icon, which is white. What I want to do, is when hovering with your mouse over a object with clickdetector, I want the mouseicon to change to a green one, and I can’t seem to make it work. It looks like the green icon is under the white icon. Am I doing something wrong here?
this is my localscript
local mouse = game.Players.LocalPlayer:GetMouse()
mouse.Icon = "rbxassetid://7277760836"
Here is my ClickDetector:
I tried changing the CursorIcon with a script, but it still doesn’t work. Here’s a video:
You are automatically setting the players mouse to the cursor icon mouse click detector, hence, it will be a dot already, and if you hover the click detector, it will change the icon, but, since the mouses are the same, it will not change visually.
Because you are using a custom mouse pointer you won’t be able to see the click detector on PC so you will need to change the icon based on MouseHover event
Apologies for the bump, but I’ve just tried this solution and it doesn’t seem to work. A server script can’t see the mouse.Icon property. Is there another way to go about this? I don’t think having a RemoteEvent for every button hover is efficient.
(To clarify, the MouseHoverEnter and MouseHoverLeave events work as intended, but the server script they’re used in can’t see a mouse.Icon property if mouse is a variable for a player’s mouse)
local players = game:GetService("Players")
local mouse = players.LocalPlayer:GetMouse()
local defaultIcon = "rbxassetid://17245091272"
mouse.Icon = defaultIcon
while wait() do
for i, clickDetectors in pairs(workspace:GetDescendants()) do
if clickDetectors:IsA("ClickDetector") then
clickDetectors.MouseHoverEnter:Connect(function()
mouse.Icon = clickDetectors.CursorIcon
end)
clickDetectors.MouseHoverLeave:Connect(function()
mouse.Icon = defaultIcon
end)
end
end
end