Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How To Disable Accessories Shadow?

Asked by
RBLXHS 9
3 years ago
Edited 3 years ago

I disabled the avatar shadows and now I need to disable accessory shadows. I have tried two things. Neither work:

Heres the first one:

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)

Here is the second one:

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") then v.CastShadow = false elseif v:IsA("Accessory") then v.Handle.CastShadow = false end
            end
        end)
    end)

2 answers

Log in to vote
0
Answered by 3 years ago

If you trying to do every part in the character, just use char:GetDescendants(), and if you only want accessories, just check if v.Parent is an accessory.

Hope this helps:3

Ad
Log in to vote
0
Answered by 3 years ago

Please provide explanation with your answers. Simply posting code does not spread knowledge of integral scripting processes which helps people understand the logic and reasoning behind your answer.
Lighting.GlobalShadows = false -- turn off all shadows

Answer this question