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:
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?
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)
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)