Widget Button Control Blueprint Lights

Hello,

I have this blueprint that toggles my lights on when I press the F key:

I would like to be able to press a button on my HUD that I’ve already created and have that button also turn on and off the same lights. I can’t for the life of me figure out how to do it. I’ve gotten as far as creating the button and adding OnClicked in the widget event graph. I tried to use an event dispatcher but couldn’t figure it out.

FYI: I have about a year worth of experience with UE, but I only recently began diving into Blueprints. So I am not so familiar with a lot of lingo yet, so simple explanations would be very helpful :slight_smile: Thank you so much.

Is this a HUD hud, or a Widget that you construct and use Add to Player Screen?

In either way, when your player does On Begin Play, it should find the HUD widget (either get HUD and cast to widget class, or retrieve it from wherever you create it) and configure some Variable on that widget that is “the player.”
The HUD widget will then use this variable, and call your “turn on lights” function on that player instance.

Thank you for the reply.

Here is the event graph for the widget. I would like to be able to click this button to control the lights in the BP that I showed in my original post.