Measuring ambient light at a given position

Good day all,
I’m looking for a reliable method for determining the ambient light level in a given position.
See, I’ve got a heads-up display and I’d like the black interface to turn white when the lights above characters turn off (the game is based in an enclosed environment). Assume you can detect whether a light is turned on or not.
Does anyone have any suggestions? I was thinking about using raycasting to place an invisible block on which :GetTouchingParts() could be ran to determine if lights are enabled or not.

2 Likes

cant u just use the changed event with the lighting source in a script and check if the light is on or off?

2 Likes

Try searching for “light level” here on the dev forums, you’ll find quite a few posts asking similar questions. The TL;DR is you can’t.

It’s somewhat often requested as an engine feature, so hopefully we can get this soon. I’ve been wanting it for years now, because I’ve wanted to make a game like the original Thief games.

3 Likes

That works in a typical scenario. OP is looking to do this only if the lighting in the specified area is dark. Doing this would produce inaccurate results.

1 Like