just wanna ask how to make a custom wall lantern to work exactly like the tomb wall lantern, with the optimization stuff that disable casting light toward walls:
this one doesn't work, the light goes trough wall:
I have just changed the light color in the object definition and the custom particle.
What Is something wrong? Why this is not working?
SpoilerShow
Code: Select all
defineObject{
name = "skycity_tomb_wall_lantern",
baseObject = "tomb_wall_lantern",
components = {
{
class = "Light",
offset = vec(0, 1.55, -0.12),
range = 10,
color = vec(1, 0.5, 0.1),
brightness = 10,
castShadow = false,
staticShadows = true,
onInit = function(self)
-- optimization: disable casting light behind the wall
local face
if self.go.facing == 2 then
-- disable -Z
face = 5
elseif self.go.facing == 3 then
-- disable -X
face = 1
elseif self.go.facing == 0 then
-- disable +Z
face = 4
elseif self.go.facing == 1 then
-- disable +X
face = 0
end
self:setClipDistance(face, 0)
end,
},
{
class = "Particle",
particleSystem = "skycity_wall_lantern",
offset = vec(0, 1.55, -0.12),
},
},
}
Work now. It wouldn't work because I ve set the cast shadow to false. Weird!