Mouse Icon not changing

  1. What do you want to achieve?
    Changing the players mouse icon whenever it hovers over a Humanoid.

  2. What is the issue?
    The Mouse icon wont change when i hover over it.

  3. What solutions have you tried so far?
    i looked at the devforum and im pretty sure there wasnt a solution to my problem


Whenever the players mouse hovers over a character/humanoid, its supposed to change the players mouse icon, but the mouse icon is not changing, if you know how to fix this, please let me know.

Local Script Inside of StarterGUI:

repeat
	wait()
until game:IsLoaded()

local Players = game:GetService("Players")

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

mouse.Move:Connect(function()
	
	mouse.Icon = "http://www.roblox.com/asset?id=9407861776"
		
	local target = workspace:FindPartOnRay(
		Ray.new(mouse.UnitRay.Origin,mouse.UnitRay.Direction*50000)
	)

	if not target then
		mouse.Icon = "http://www.roblox.com/asset?id=9407861776"
	else
		
		if target.Parent:IsA("Model") then
			  
			local findhumanoid = target.Parent:FindFirstChild ("Humanoid")
			if findhumanoid ~= nil then
				  
				mouse.Icon = "http://www.roblox.com/asset?id=10471499246"
				
			   end
			end
		end
end)

can you add a print in the if findhumanoid then statement?

1 Like

it prints, the script works but its the mouseicon that doesnt work

if target.Parent:IsA("Model") then

does it print in here?

try rbxassetid://10471499246 instead of http://www.roblox.com/asset?id10471499246

1 Like

You can detect models with mouse.

no you can’t detect a model, you can detect the childrens & descendants of it (not all of them).

yes it does print, but the icon is not changing

yes thats what i meant, sorry.

When you try to search the http://www.roblox.com/asset?id10471499246 id it gives an error so as @ayoub50 said use rbxassetid://10471499246

2 Likes

the issue turned out to be my image, i dont know why the image is the problem but atleast i’ve fixed it now

if it was your image your mouse would’ve been invisible then.
you said it wasn’t changing.

1 Like

the image that i tried to set the icon to wasnt working for some reason and that was the issue, but i’ve managed to fix it now, thanks

Everything is fine with your image i searched it in the creator marketplace and it was all right, so i don’t know what you are talking about

1 Like

when i hover over a humanoid it changes to the default roblox mouse icon which i dont want, when i used a different image it worked for some reason

yeah the image is fine when you search it but it just doesnt work for some reason, when i used a different image it worked somehow

it works now very some weird reason, instead of getting the ID from the browser i got it from roblox studio and it randomly worked