Button functions of widget component within Blueprint

I have a blueprint with a widget component with several buttons, I want to call a function when a button is clicked, and I want this to be inside of the entire blueprint instead of just the blueprint of the widget. I’m not sure how to have a “when button clicked” event inside of the blueprint.


Here is an image of what I have so far in the bottom left. I am able to have an event for when the widget itself is clicked, which does not work properly. I want to have the “activate door” function called when button 1 is pressed, I have a few blocks that are not compatible with each other. Here is the widget:

In the actor:

  • get widget component
  • get widget
  • cast to widget class
  • Get button
  • assign onClicked

This is fine for 5 buttons but there are better ways if you have 100 buttons.

Here’s what I have so far:


There are no errors, but the “activate door” function does not run when I click the button. I know you said “cast to widget class”, as opposed to just the widget. This doesn’t seem to work, since the targets are not compatible:

Did I make a mistake?

First pic is Ok but Activate Door from the red node - the onclick

And the whole thing is not connected to anything. Use Begin Play.