Disable player shadows

I’m making cartoony lighting for my game and I am disabling shadows completely. So I have this script that disables all shadows from the player completely:

game:GetService("Players").PlayerAdded:Connect(function(Player)
	Player.CharacterAppearanceLoaded:Connect(function(Character)
		for _, v in pairs(Character:GetChildren()) do
			if v:IsA("BasePart") or v:IsA("UnionOperation") or v:IsA ("Accessory") then
				v.CastShadow = false
			end
		end
	end)
end)

This is a server sided script that I put in ServerScriptSerivice that disables player shadows completely. But when I play the game there’s still a shadow visible on the ground from my character

This image below is without the script:

Can someone help me? What should be the correct script I should use?

I think this is because of the :IsA() checks you are doing. I’d remove all but v:IsA("BasePart"), because UnionOperations are BaseParts, and checking if it’s an accessory means that you’re trying to set Accessory.CastShadow, which doesn’t exist.

However, since it doesn’t collect children inside accessories anymore, I’d just switch :GetChildren() to :GetDescendants().

With all the changes, we get this (which worked for me):

game:GetService("Players").PlayerAdded:Connect(function(Player)
	Player.CharacterAppearanceLoaded:Connect(function(Character)
		for _, v in pairs(Character:GetDescendants()) do
			if v:IsA("BasePart") then
				v.CastShadow = false
			end
		end
	end)
end)
1 Like

You don’t need a script for this, just turn off GlobalShadows.

he said he just wants to disable player shadows

1 Like

nah that can’t be right, perchance

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.