How do I turn off all the lights in my map with a simple button press?

I have an action map for what keys should be used but I’m not sure how to make the function.
What I want to do is when the two buttons are pressed all the lights turn off and a sound is played such as a power down or some sort of ambient sound.

If you have added the action correctly you should be able to Create an event with the name of the action. I.e., if you’ve made an action with the name KillLights it would called “InputAction KillLights”. You’d probably want to do this in either the Playercontroller or the Pawn.

From the Released pin add a sequence.

On the Then 0 you can add the play sound to play the power down audio file.

On the Then 1: Do a get all actors of class with the class PointLight or Spotlight and if you use both you need to do it for both instances. Then from the array do a foreach loop and from the array element you should be able to call Set Intensity and set that to 0. Or you can call affects world and set that to false.

No problem happy to hear it helped you out!

Thank you! This works perfectly, sorry for the late reply.