How to create a button on a mesh that will switch a light actor on or off in UE5?

I am making a UV lamp in UE 5 and I already have a model ready that I imported. I am attaching a rectangular light to it to create the light effect. What I want to do now is to be able for the player to switch the light on/off by approaching it, looking at it and pressing E/left click.

I’ve seen some other answers but they didn’t exactly help me. This should be easily done with Blueprints, right?

Do I need to make the light a component of the UV Lamp actor?

Yes, making the light a component of your lamp actor would be a good idea.

There are plenty of tutorials about interactables available. Take a look at the Unreal Content Examples or YouTube videos like this one https://youtu.be/EYEDl7JQsoE.

You will most likely end with an actor that contains your mesh and the light, some way that tells your character/controller at what actor you are looking at (line trace or collision sphere) and a method that routes your “e key pressed” event in your character to the “toggle light” method in your lamp actor.