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

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

Asked by 4 years ago

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

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

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

0
It also states in the developer wiki link that CastShadow doesn't matter regardless of the part's transparency. 123nabilben123 499 — 4y
0
The reason why the shadow also vanishes is because Transparency has an effect on Shadows, CastShadow should solve the problem 123nabilben123 499 — 4y
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. ScottVulpes 105 — 4y
0
I'll try to think up of another solution, one I have in mind is having a separate part doing the shadows. 123nabilben123 499 — 4y
View all comments (2 more)
0
That wouldn't work either as there isn't a object that casts shadows and is invisible. ScottVulpes 105 — 4y
1
I'm not sure what else we could try, how about shadow raycasting? 123nabilben123 499 — 4y
Ad

Answer this question