Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

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

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

✓ Accepted answer

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)

5 comments

0

Oh wow. I never knew that property existed. Cool.

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.

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.

0

Yes, there is a way I can edit my answer for you if you like!

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

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.

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.

This discussion is preserved as it was. New answers, comments, and votes are closed.