Today I'm trying to do a recreation of a game I made last year, but only I'm taking a different approach: Changing the brick's colour! However, it's not going as expected. XP If the ball (the light source) is far away enough the box turns bright blue in places. (The shading box) The light is also pretty dark than expected. Is there a better way of accomplishing this?
This's the code:
local ball = Workspace:WaitForChild('Ball') local box = Workspace:WaitForChild('Box') while true do for i, v in next, box:GetChildren() do if v:IsA('BasePart') then local dist = (ball.Position-v.Position).Magnitude v.Color = Color3.new(0 ,0, (191.25 - math.max(dist, 0)) / 255) end end wait(1/44) end
Tyvm in advance! ^^