Cannot cast On Button Click from Widget A to Custom Event/Function on Widget B

I was having the same problem calling functions between widgets and working with buttons. This [youtube][1] video from Nebula Games (thanks!) should help. But instead of using GetAllActorsOfClass, use GetAllWidgetsOfClass. This should do the trick:

The On_Clicked event is from WidgetA and when it is clicked, the DisplayMessage function I created in WidgetB prints a string message.

Hello there. :3

I have two widgets. Widget A contains just a button. Widget B contains a custom event that I want to fire each time the button on Widget A is pressed. Widget B also contains a test button to make sure the line of commands I want carried out are functional. When I press the test button in Widget B, it works exactly how I want it to. When I press the button in Widget A, nothing happens.

I’ve tried for several hours, looked at several tutorials, and for some reason I can’t quite figure it out.

I’ve tried doing a “call” but I don’t even get the option to “call” anything when I type it whilst blueprinting.

Also, when I try casting from Widget A to Widget B, it states "Widget A does not inherit from “Button” and it fails to cast.

Could someone show me the proper way to construct these widgets so that A can communicate with B?

Thank you.

Ok so I was able to reproduced this and get what you want - here’s how I set it up…

Use the character or player controller as a third party communicator

Choose one - and inside create 2 “New Variables”. The Variable types should be the widgets you created (See pic 1) {I used my character/ controller works too}

Next - on event construct In both WidgetBP’s , cast to character/controller (whichever you chose) and for each widget set “self” to the 3rd party BP’s corresponding references (See Pics 2 & 3)

Now your 3rd party will have valid references to each widget, eliminating the need to cast to them (See Pics 4 & 5)

Best of Luck

Ok so I was able to reproduced this and get what you want - here’s how I set it up…

Use the character or player controller as a third party communicator

Choose one - and inside create 2 “New Variables”. The Variable types should be the widgets you created (See pic 1) {I used my character/ controller works too}

Next - on event construct In both WidgetBP’s , cast to character/controller (whichever you chose) and for each widget set “self” to the 3rd party BP’s corresponding references (See Pics 2 & 3)

Now your 3rd party will have valid references to each widget, eliminating the need to cast to them (See Pics 4 & 5)

Best of Luck

Hey! Both of your answers were adequate solutions, thank you so much.

I do have to note however that I needed to uncheck “top Level Only” in order to get the first suggestion to work.

Once again, thanks a ton. I knew it would be something really simple in the end, haha.