How to make a different icon appear when hovering over a part with a click detector?

You can write your topic however you want, but you need to answer these questions:

  1. I want to make a custom cursor appear over a part containing a click detector.

  2. For some reason because my game is set to first-person only and the fact that I added a custom Mouse Icon, The Detectors icon will not show up

  3. I tried to change the icon option in the click detector but it doesn’t work. I also tried the code below

local clickDetector = script.Parent.ClickDetector
local icon = "rbxassetid://5945514392"

clickDetector.MouseHoverEnter:connect(function(player)
    local mouse = player:GetMouse()
    mouse.Icon = icon
end)

clickDetector.MouseHoverLeave:connect(function(player)
    local mouse = player:GetMouse()
    mouse.Icon = "rbxassetid://5945460343"
end)

Things you might need:

  1. Its a 1st person game, Meaning the camera mode is set to lockedtofirstperson
  2. I have used a custom mouse icon
  3. Ask for more info
2 Likes

Set the player mouse icon to a blank value so it goes back to the defualt and the clickdetector icon should wrk hopfully

The ClickDetector itself has a property called CursorIcon.

Is that perhaps what you’re looking to change?

1 Like

yeah like @DumbSkid said, the click detector has a CursorIcon property for a custom cursor when you hover over the click detector, try changing it

Is it inside Local Script or Script?

If its in normal script then u can’t do player:GetMouse().

You can use remote Event when the mouse hovers in clickDetector and fire into client .
In a local script u can do

local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
game.ReplicatedStorage.EventName.OnClientEvent:Connect(function()
Mouse.Icon = " "-- ur icon id here --
end)

and again u can use another remote event to fire client to change into the default icon.
If I’m incorrect please correct me.

1 Like

Ok, I will try this. Thanks for replying!

I’ve tried this and it doesn’t appear to work if you have a first person game

try reading the original post again

This is a bug caused by changing the Mouse.Icon via a local script. It’s been acknowledged by a developer relations member but since January 2021 there has been no updates or anything about it.

Edit: To clarify, I’m talking about how you cannot change the ClickDetector.CursorIcon value when using a custom Mouse.Icon.

2 Likes