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
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)