How do i fix this mouse issue?

So basically I have this mouse issue where if I’m using a custom mouse and another if you hover a click detector the mouse icons don’t change how do I fix this?

Also I’m mad at Roblox for not letting me upload the video showcasing the problem

11 Likes

this might help you GuiButton | Documentation - Roblox Creator Hub

7 Likes

I don’t really know who this is going to help but thanks!

3 Likes

You can setup a listener to the mouse image and if it changes, just change it back in a loop like this

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

mouse.Changed:Connect(function()
    print("Mouse Icon Changed")
    mouse.Icon = "rbxassetid://#####"
end)
3 Likes

Clickdetector has a property for this called CursorIcon.

2 Likes

Can you explain a bit more on what you mean by this?

2 Likes

Thats not recommended because:

mouse.changed fires when any property of the mouse is changed.

So if you Connect a function to mouse.changed that changed the mouse its gonna run infinite times.

this is where debounce is useful

debounce = true
mouse.Changed:Connect(function()
    if debounce then
        debounce = not debounce
        mouse.Icon = "rbxassetid://####"
        debounce = not debounce
    end
end)

Now it will only run when its not changed back.

-debounce means its gonna be reversed. so if db is true then -db is false

2 Likes

You can’t do this. If you want to reverse a boolean add a not statement infront of it.

2 Likes

ohhh it worked for me like a week ago… Strange… anyways okax ill note that

3 Likes

It was supposed to change to this image when I hovered the mouse on the object

Mouse hover

1 Like

You are using ClickDetectors right?

2 Likes

Yes, I am I’m using a click detector.

1 Like

You can try using mouse.hit to see what the current mouse is hovering over and make it only change the mouse icon if you are a certain distance away

Is the clickdetector obstructed by anything at all?

no, it isn’t obstructed at all

Can you give the image ID of that custom cursor?

ID for the custom mouse: 14149455917