-
What do you want to achieve? I have a light fixture in my game and I am attempting to make it flicker, as if the power in the facility is dying.
-
What is the issue? The color and material of the light fixture isn’t changing.
-
What solutions have you tried so far? None, as all of them I had already.
local light = script.Parent.PointLight
local lightMat = script.Parent.Material
local lightCol = script.Parent.BrickColor
local plastic = Enum.Material.Plastic
local neon = Enum.Material.Neon
local white = BrickColor.new("Institutional white")
local grey = BrickColor.new("Light stone grey")
lightMat = neon
lightCol = white
light.Enabled = true
while wait() do
light.Enabled = false
lightMat = plastic
lightCol = grey
wait(math.random(1,4))
light.Enabled = true
lightMat = neon
lightCol = white
wait(math.random(1,4))
end
This is my light fixture setup in the hierarchy:
And this is some footage of it not working:
As you can see, the PointLight itself goes on and off, but the material doesn’t change. Please help, I’m desperate lol