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

How to make a character invisible, but shadow lighting remains?

I've been trying to make a character invisible with their shadow remaining. I've looked into several methods of alternatively making a character invisible, which none keep the shadow and some not working. I need a way to make the character (R6) invisible to everyone, but keep the shadow on the ground. Any solutions?

game.Players.PlayerAdded:Connect(function(player)
	local Tool = script.Parent
 
Tool.Equipped:Connect(function(Mouse)
	Mouse.Button1Down:Connect(function()
		player.Character.Head.Transparancy = 1
	end)
end)
end)

This is what I've been trying, as I said this doesn't work because the shadow vanishes.

1 answer

I think there is a property called CastShadow in the BasePart object, look in the BasePart and see if there is no CastShadow property and if there is then set it to true, otherwise I'll try to think up of a better solution

So your code would be:

game.Players.PlayerAdded:Connect(function(player)
    local Tool = script.Parent

Tool.Equipped:Connect(function(Mouse)
    Mouse.Button1Down:Connect(function()
        player.Character.Head.Transparancy = 1
	player.Character.Head.CastShadow = true
    end)
end)
end)

Heres a link to CastShadow property: https://developer.roblox.com/en-us/api-reference/property/BasePart/CastShadow

This answer is probably not gonna work or you already tried it before

6 comments

0

It also states in the developer wiki link that CastShadow doesn't matter regardless of the part's transparency.

0

The reason why the shadow also vanishes is because Transparency has an effect on Shadows, CastShadow should solve the problem

0

This does not work, as CastShadow and Transparancy are not related, one does not turn the other off. Basically this doesn't work. Try it yourself.

0

I'll try to think up of another solution, one I have in mind is having a separate part doing the shadows.

0

That wouldn't work either as there isn't a object that casts shadows and is invisible.

1

I'm not sure what else we could try, how about shadow raycasting?

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