So with the new bloom effect I want to make it so if a player is in a dark area outside is really bright and it gets brighter the longer they spend in the dark and when they go outside they slowly adjust to it and the bloom decreases. Except is it even possible to detect how much a area is lit?
COMMUNITY QUESTION
How do I Detect Darkness?
1 answer
ofcourse it is possibal. for example you can place this into a local script
local plr = game.Players.LocalPlayer
local blurmultiplyer = 1
while wait() do
for i, v in pairs(workspace:GetChildren()) do
if v:IsA("BasePart") and ((plr.Character.Torso.CFrame.p-v.CFrame.p).magnitude)<15 then
if v:GetChildren=~nil then
for i, t in pairs(v:GetChildren()) do
if t:IsA("Point Light" or "Spot light") then
blurmultiplyer = blurmultiplyer - 0.1
wait(1)
else
blurmultiplyer = blurmultiplyer + 0.1
wait(1)
end
end
else
blurmultiplyer = blurmultiplyer + 0.1
wait(1)
end
end
end
end
Then make a few other lines that when they are exposed to light the bloom property changes.
consider also using a raycast to see if the player is beneath any parts and therefor cannot see the light. lastly you can check the time of day aswell.
2 comments
0
/:
0
This only checks for point/spot lights. Furthermore if you have a dark building with no lights but the time of day is still 'day' then it wont work either.
This discussion is preserved as it was. New answers, comments, and votes are closed.

2 comments
Just go into the bloom properties and change it when the player hits a transparent brick.
I sadly don't think you can. You would have to do the above suggestion or use magnitude. I will say however that the bloom effect only works if a player's quality level is six or higher, and the sun rays effect only works if the player's quality is eight or higher.