UE5 Time of Day Blueprint System
This page is part of the documentaiton for my UE5 Time of Day Blueprint System

Example: Custom Blueprint Switch

UE5 Time of Day Blueprint System Version: 2.0

    There may come a time when you would like some of your own custom blueprints in your level to simply turn on or off at different points in the day, like showcasing a gravity defying cupcake with spinning spotlights that starts at 5:47 PM and stops at 4:45 AM …

    In the cupcake showcase example in the demo world the cupcake transitioning in and out is our custom blueprint, but we are also controlling the two spotlights which are additional blueprints. The rotating of the ceiling the lights are attached to is handled inside the custom blueprint. The controlling of all 3 of these blueprints is handled using the Remote BP Switch.

    The Remote BP Switch, BP_TimeOfDay_SwitchRemoteBP, can be found in the Blueprints/Utilities/ folder. To use it just drop a copy of the Remote BP Switch blueprint into your level, near the custom blueprints you would like to control.

    Configure the Remote BP Switch

    The remote bp switch is an advanced example, and while it might be tempting to jump right to it if you are having trouble understanding the configuration settings take a look at some of the other switch examples, under the surface they all work the same, and have similar configuration setups.

    SwitchTypeThe type of time mode to use when controlling turning on and off blueprints with this switch.
    FixedTimeSwitch If using the “Fixed Time” SwitchType this is the time schedule you would like to use to turn on (starting point) and turn off (end point) your custom blueprints.
    TimeOfDaySwitch If you are using the “Time of Day” SwitchType this is where you define the time of days to call the Turn On at. When it is outside the time of day the custom blueprint will be told to Turn Off. Keep in mind if your “on” state spans multiple Times Of Day the custom blueprint will be told to Turn On at each of the time of days. It is your responsibility to account for this at your end if it needs to to prevent redoing something again.
    Blueprints This is where we connect the blueprints in our level to this switch. The blueprints you select here must also be configured using the instructions below.

    Configure Custom Blueprints to work with the Switch

    To configure your custom blueprint to listen for the Turn On and Turn Off calls from the Remote BP Switch we use a blueprint interface. Simply add this blueprint interface to your custom blueprint by selecting the Class Settings button on the menu bar then from the Implemented Interfaces section click the Add button and select the BPI_TimeOfDay_SwitchRemote interface. This will then add 2 events to the “interface” section of your MyBlueprint panel.

    From this Interface section double click on the TurnOn and TurnOff events to implement them into your blueprint. This will create the new events in your custom blueprint’s event graph. From here is how the switch will tell your custom blueprint what it needs to do when it turns on and off.

    This documentation and asset version are new. If you encounter any bugs or if anything doesn't make sense, please let me know.