Disclaimer 1: I don’t use the plugin, I just opened the docs at Day Sequence Time of Day Plugin for Unreal Engine | Unreal Engine 5.5 Documentation | Epic Developer Community (and the source on github) and hopefully figured out what to do, or at least something to start with.
Disclaimer 2: Unfortunately there doesn’t seem to be an event-based solution for this, the “time of day changed” delegate isn’t exposed to BPs, but just doing it in Tick will be fine (read on).
- I’m assuming you added a
ADaySequenceActor
(of some kind) to your world (if not, check the docs, should be straightforward to set up a basic day/night cycle). I’m also assuming your streetlight is a blueprint asset and you know how to toggle its light on/off. - Create a BP to manage the streetlight toggling, either a new one or a derived
ADaySequenceActor
(if you’re not directly adding one of the premade ones). Doesn’t matter much which BP you use for the (following) logic, as long as you don’t make each streetlight tick on its own to achieve this (that’d be kinda wasteful and is easily avoided). - In that BP (let’s call it BP_StreetlightManager) connect your
BeginPlay
event to aGetActorOfClass
node, and setADaySequenceActor
as the Actor Class (on that same node). Drag the resulting wire (blue) into aCast to ADaySequenceActor
node, and drag that result into “Promote to variable” (top of the dropdown), let’s call the variable StreetlightManager. This way you can easily reference the day/night cycle actor within this blueprint. - In that same BP, connect your
Tick
event to StreetlightManager->Get Time Of Day
. This returns a float representing the current time of day, check the docs for more details if unclear. - Add a
GetAllActorsOfClass
node (connecting 3.'s white execution pin to this to continue the logic) and set your streetlight BP class as the “Actor Class” parameter. Drag the output array (blue wire) into aFor Each Loop
. Drag the loop’s blue wire (Array Element) into aCast to BP_Streetlight
(<- example name, use your streetlight BP’s name here). Manipulate the resulting wire using the time of day float (from step 3), either by directly accessing its components or by calling a function (you add to your streetlight BP). - Add
BP_StreetlightManager
(or however you end up calling it) to your world and it should automatically manipulate the streetlights (in whichever way you set up the logic at the end of step 4).