How do I make the mouse icon change when it is hovering over a part?
You can use the Cursor’s .Target
property to read the current BasePart
the Cursor is hovering over. Using a conditional, we can compare the Objects to filter for one specific Instance.
Then, using .CursorIcon
, we can change the Icon through a decal ID.
local Player = game:GetService("Players").LocalPlayer local Cursor = Player:GetMouse() local SetIcon = --// Id Here local Part = workspace.Part Cursor.Move:Connect(function() if (Cursor.Target == Part) then Cursor.CursorIcon = "rbxassetid://"..SetIcon end end)
If this helps, don’t forget to accept this answer!