Turn on a Light via the Level BP

In Unreal Engine, you can turn on a light via the Level Blueprint by following these steps:

  1. Open the Level Blueprint by right-clicking on the level in the World Outliner and selecting “Open Level Blueprint”.
  2. 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.).
  3. Drag off the new variable and select “Get” to get a reference to the light you want to turn on.
  4. Drag off the reference to the light and select “Set Visibility” to set the light’s visibility to true.
  5. Connect the output of the “Set Visibility” node to the “Event Begin Play” node to turn on the light when the level starts.
  6. 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.


Posted

in

by

Tags:

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *