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

Is there a way to disable the shadow of the player?

Asked by 4 years ago

I'm going for a more cartoony look in my game, and the player's shadow sort of messes up the whole look. Is there any way to just turn off the player's shadows? Thanks!

4 answers

Log in to vote
2
Answered by 4 years ago
Edited 4 years ago

This should stop your avatars shadows. Put a script in a serverscriptservice and put this in there.

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)
0
Oh wow. I never knew that property existed. Cool. oreoollie 649 — 4y
0
Thanks. I just used a for loop and looped through the character and found if it was a part or union and then if it is then it turned off the shadow. Nistrict 44 — 4y
0
Thanks! Works perfectly for all the body parts of the avatar. However, I was wondering if there was a way to add accessories to this too as they still cast shadows. CaptionDemon 21 — 4y
0
Yes, there is a way I can edit my answer for you if you like! Nistrict 44 — 4y
0
If anybody was wondering how to also make the accessories shadow's to be removed, change the if statement to this: if v:IsA("BasePart") or v:IsA("UnionOperation") then v.CastShadow = false elseif v:IsA("Accessory") then v.Handle.CastShadow = false end omerk1 0 — 4y
Ad
Log in to vote
0
Answered by
Benbebop 1049 Moderation Voter
4 years ago

Baseparts have a parameter that says whether or not they cast shadows, called CastShadows. It seems like what you want.

Log in to vote
0
Answered by
oreoollie 649 Moderation Voter
4 years ago
Edited 4 years ago

Well if you're looking to disable shadows entirely apparently inserting a Humanoid into the workspace gets rid of shadows. It's pretty strange but it works.

Log in to vote
0
Answered by 4 years ago

This is easy to do if you have a local script inside of StarterCharacterScripts. You can put into the localscript:

local plr = script.Parent -- Makes a variable plr which is the visible character.
for _,limb in pairs(plr:GetChildren()) do -- "limb" is the limb inside of the plr variable.
    if limb:IsA("BasePart") then -- Checks if limb is a basepart
        limb.CastShadow = false -- Disables shadow casting.
    end
end

And you are good to go, a player without shadows.

~ Dan_PanMan, advanced scripter.

Answer this question