what do i need to do, in order to be able to click on a button in a widget , that fires an event in an other Actor Blueprint?
…for example toggle a light.
I tried it with an event dispatcher, but i don´t know what do add to the Bind Event to make it work
What input does the “Target” Pin has to be, and where do I get that from? Everything I tried either doesn´t fit, or produced an error.
The Overlap Event is just a placeholder, i forgot to mention that. I have to make a custom event for that, right?! I just want the button of the widget to fire the event, nothing else.
You can create an Event Delegate in the player called Toggle Light (or something like that) and on the light actor on begin play you use Get Player Pawn and cast it to your players type, from there you call Bind Toggle Light and connect it to a custom event you create that toggles the light. On the widget, create a variable called Player of the type of your player and in the Event Construct you do Get Owning Player Pawn and cast it to your players type and save that to Player. On the button’s click event you get the Player variable and do call Toggle Light and that will broadcast the message to all of the actors that are binded.
Thank your for your answer but unfortunately I´m not smart enough to follow your instructions.
How do i create an Event Delegate and how do I know my players type? Also I don´t have an Event Constuct in my widget.
It’s because the Player type is Actor and it has to be Player, because that is where the delegate exists, so after you change the type, delete that Call toggleLight and drag a wire out of Player and search for call ToggleLight and you should be good to go.