How to create a blueprint light that is triggered on/off by your character

Getting Started:

  1. In the folder where you are saving blueprints – right click and select add blueprint from the menu.
  2. Select Actor from the list of blueprints.
  3. Rename it BP_Autolight or a name you prefer (BP short for blueprint).
  4. Open the Blueprint.

Components:

  1. Add a point light.
    1. In the point light details uncheck ‘Visible’ – Otherwise it will be turned on when the game starts.
  2. Add a static mesh and rename it lamp.
    1. In the details panel of the static mesh > Add a lamp mesh (I’ve used the starter content mesh – but any lamp mesh can be used.)
  3. Position the point light correctly with the mesh.
  4. Add a collision box and resize to required size so the player character can overlap with it in the level.
  5. Note: Attach the components to the scene root and not each other (not critical but just more tidy!)
  6. Unreal blueprint Auto trigger light

EVENT GRAPH:

  1. Go to the event graph tab.
  2. With the collision box selected > In the right hand side of the details panel – scroll down and press the green button On Component Begin Overlap
  3. Drag off from the top of this node (the arrow) socket and search for Toggle Visibility Point light
  4. This light will now turn off when player enters and will turn on when play enters again (after leaving trigger box area). But we want a bit more refinement for our blueprint.

  5. Select Collision box and in the button right hand corner select the green button On Component End Overlap
  6. Line this up below the On Component Begin Overlap node and plug in its top socket into toggle visibility (both these are now plugged into the same toggle node).
  7. The light will now turn off and on when the player enters and leaves the collision box area.

  8. Finally right click and search/add the Delay node.
    1. Add in 3 into the Duration box.
  9. Plug this delay node in-between the End Overlap node and toggle visibility so that when the player leaves the collision area the light will not turn off until 3 seconds (or whatever time required). (You can also use the delay node with the Begin Overlap node as well if you want to delay the light turning on).
  10. The Finished Blueprint is below:

unreal engine blueprint auto light turn on

Now drag this blueprint where ever it’s required in the level and it will be triggered on and off by the player character. Please also note this is one way to trigger lights in a game or simulation, but there are other ways, but this is a good simple way to get the lights working!