That’s great I am glad that it is working and working as expected seems to be.
-
While spawning transform doesn’t really matter, anyway you are setting actors location.
-
You are getting light status on the tick, which I think it is unneccessary calculation every frame. I would recommend making a timer after the spawn, something like 0.1-0.2 seconds to get light status. Another alternative to that you can set LightDetectionMethod of the component to distance, so when position changes, it updates and you can bind to component update event automatically. (There is a demo for the plugin demonstrating usage cases in detail) If you prefer component updating itself like distance, after spawn you can bind to component updates like this
-
In the LightDetector_BP on it’s LightAwarenessComponent, Sensivity→Low, DetectionDirection→Top with DetectionMethod→ManualRequest and if you request somewhat with lower frequency as mentioned 0.2 seconds, I think you will have more performing results out of the box.
-
On you UI, when value changes you are setting indicator to new position. I am assuming either its an event or its on tick. Making location changes over FInterpTo would give you much more smoother results with the indicator (needle)
-
In Real Life, camera exposures afaik works the same way, especially the digital age cameras. They basically sample spot, area or the entire screen depending on the choice available, so they get the light level and adjust timing on top of it. In digital cameras ofcourse we can see changes in real time (like in your project) and timing of exposure can be adjusted to achieve desired results (how much ligh should enter objective to added on top of the picture in order to achive correct light level)… In that terms your project right now works as a spot exposure meter.
-
Well don’t worry and the plugin itself besides all the code, workarounds –> as working principle it is quite a simple plugin and does it’s job well. You put you hand under a desk lamp and you can understand how bright light it is by looking to you hand only. Ofcourse when you go deeper in to the subject and rendering it can get sophisticated like in everything. Till plugin renders the image, how lights calculated in the engine, how vertex is processed.. the deeper you go it can get sophisticated however this is not something hard but solves the problem nicely.
When I rethink about it, think I can have some time to enhance it even further as plugin creator. Maybe there can be some ultralight detection for the scenarios/use cases like your project. Also I can facelift my code abit or maybe built another one that can be experimental for me too which I thought about it but didn’t take that direction.
We can simply tap into the shader, which already getting histogram for the whole scene..define another one to just get a dedicated area, like a square box on screen and resolve light values over there. Which will give approximately the same results , in a longer way but more performant solve possibly. We can just solve area of interest back to screen cordinate and would be a local exposure histogram just like the phone digital cameras where histogram detects the object area and adjusts.
Howeverr LightAwareness is built for more than that, for gameplay reasons, such as :
- AI : Stealth purposes, AI logic of avoiding light or dark areas, reaction to light etc.
- Gameplay : logic as entering a cave automatically wielding a torch or flashlight. An actor changing state when exposed to light, revealing a hint or completing a quest. Somebody was doing something related to photosynthesis sim, you gain energy when you are in light etc.
- Dynamic World : Extracting data of world light conditions, changing behaviours of vegetation, day and night time changes. Shader adjustments depending on the scene , weather and time of day.
Let me know if you can make it work better with the instructions or you need further assistance around it.


