I’m trying to implement a communication pass between actor and widget, but it’s always unsuccessful, can you help me to see what is the problem? The logic I implemented is to first create a widget control inside the actor by clicking the mouse event and adding it to the viewport, and then finish processing a variable by clicking the button event inside the widget, and then I need to get the results of the variable after the widget runs to do branching in the actor, so I created a new variable inside the actor (which inherits the widget class), and then get the value of the variable by getting the widget’s variable to get the value of the variable. I need to get the result of the variable after the widget is run to make a branch judgment in the actor, so I create a new variable in the actor (the class that inherits the widget) and get the result by getting the value of the widget’s variable, but I won’t get the result of the widget’s run; if I add a new control in the actor to inherit the widget, it will prompt the parent class with a problem during the blueprint call.
And now… ( drum roll ) the correct answer
Very similar, in fact. When you make the widget, give it an actor reference variable, and expose it on spawn, like this
When you create the widget ( from wherever ), you say
The widget responds to the actor with a blueprint interface
That call gets caught in the blueprint
The interface definition
It’s not a really a clear ask. @CEN1 Can you simplify it somehow for us?
first create a widget control inside the actor by clicking the mouse event and adding it to the viewport, and then finish processing a variable by clicking the button event inside the widget, and then I need to get the results of the variable after the widget runs to do branching in the actor
This is what I got:
- in the widget:
- in the actor:
¯\ __(ツ)_/¯
The other bits, about actor / widget inheritance, I simply do not understand