Level Blueprint turning on street lights at day and off at night

Hey everyone! So I don’t really know what to do, I want to turn on my street lights at night and off on day time in my Level BP.

I have some street lights in my level with Point lights, the problem is that I cannot think of any way to turn them on and off when it is day and night.
Help is greatly appreciated.

So you’re light should be set to movable because static or stationary light gets baked and therefore cannot be turned off properly.
Asuming you have done that you can easily get a direct reference to the asset inside the level blueprint. Just click on the asset inside the level and right click in the level blueprint.
Third thing is how you determine day and night. Here, you can simply use a timer by event that triggers the event after a specific time.

You cannot call any event in the level blueprint from outside. So you have to either do the day/night change inside the level blueprint or create a light manager class inside the level which is storing references of all lights in an exposed array. You can then just get a reference from wherever you do your day/night calculation to that actor and let the actor handle the light off/on switching.

Or you can create an event dispatcher in the class that does the day/night switch that gets called on day/night switch. Then you can bind to it in the level blueprint or the light manager class.

I did this now:

It now works but I have to reference every point light in the map.
It my not be the final solution though.

I would assume your streetlight point lights/spot lights are a part of a BP actor, for example a bp_streetlight actor. Just create a function in the BP class to turn lights on and off, and have the game mode (or whatever keeps track of day/night) send an interface call when the lights should be turned on or off.

As you can see in his latest screenshot, they are not.

But yeah, if you want this to happen automatic you don’t get around creating a special blueprint for your lights (except all dynamic lights in you scene are streetlights, then you could directly call GetAllActorsOfClass() in begin play of your level blueprint and store them in an array).
Apart from using GetAllActorsOfClass(), you can use an event dispatcher in your game mode and bind an event in begin play of your BP_StreetLamp.