In Unreal Engine, you can turn on a light via the Level Blueprint by following these steps:
- Open the Level Blueprint by right-clicking on the level in the World Outliner and selecting “Open Level Blueprint”.
- In the Level Blueprint, create a new variable to store a reference to the light you want to turn on. You can do this by right-clicking in the graph and selecting “Add Variable” from the context menu. Choose a variable type that is appropriate for your light (e.g. “Actor”, “Point Light Component”, etc.).
- Drag off the new variable and select “Get” to get a reference to the light you want to turn on.
- Drag off the reference to the light and select “Set Visibility” to set the light’s visibility to true.
- Connect the output of the “Set Visibility” node to the “Event Begin Play” node to turn on the light when the level starts.
- To turn off the light, you can create another variable, drag off the reference and select “Set Visibility” this time to set the light’s visibility to false. You can connect it to an event or a button press or any other trigger you want.
It’s important to note that before you start, you have to place the light in your level, and assign it to the variable you’ve created in step 2.