How to create a blueprint light that is triggered on/off by your character
In the folder where you are saving blueprints – right click and select add blueprint from the menu.
Select Actor from the list of blueprints.
Rename it BP_Autolight or a name you prefer (BP short for blueprint).
Open the Blueprint.
Add a point light.
In the point light details uncheck ‘Visible’ – Otherwise it will be turned on when the game starts.
Add a static mesh and rename it lamp.
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.)
Position the point light correctly with the mesh.
Add a collision box and resize to required size so the player character can overlap with it in the level.
Note: Attach the components to the scene root and not each other (not critical but just more tidy!)
Go to the event graph tab.
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
Drag off from the top of this node (the arrow) socket and search for Toggle Visibility Point light
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.
Select Collision box and in the button right hand corner select the green button On Component End Overlap
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).
The light will now turn off and on when the player enters and leaves the collision box area.
Finally right click and search/add the Delay node.
Add in 3 into the Duration box.
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).
The Finished Blueprint is below:
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!