Light source

The Light should be Stationary as long as you’re not going to be moving it. The documentation says that Stationary lights cannot be moved, but can have intensity and color changed.

Now, I was wrong about using Affects World. That property cannot be edited in game.

So, what you need to do is this:

  • Set your light to “Stationary”
  • Make sure the light is selected in the viewport
  • Open the Level Blueprint
  • Right-click the graph
  • Select "Create a reference to whatever your light is called
  • Right-click the graph, and search “Enter”. Select the Enter event.
  • Drag off of the Light Actor reference and add a “Get Light Component” node
  • Drag off of the Light Component node and add a “Set Visibility” node
  • Connect its exec pin to the Enter event’s On Pressed pin
  • Drag off of the Light Component node and add a “Get Visible” node.
  • Off of that, add a “NOT boolean” node
  • Connect the output of the NOT node to the “New Visibility” pin of the “Set Visibility” node

Now, when you press Enter in the game, the light toggle.

Your final blueprint should look like this: