I want to send events from multiple child widgets of the same class to a single parent widget.
Normally, you can bind multiple objects that hold event dispatchers from target.
However, for widgets, assignments don’t work because each one acts as an independent event.
This can be very inconvenient if you have a lot of widgets.
Can these events be merged?
ive done that before, are you saying the problem is the multiple pins? if so just make an array and loop over them
hello chat GPT?
instead of use a dispacher u can create a BPinterface and add that to the main widget, and in every child widget call the function that u create un the Interface
That was a bit of a roundabout question.
In short, I would like to use the method shown above the image, but (i don’t know why) it doesn’t work on widgets and gets converted into individual events as shown below the image.
So if you can get the method above to work, that would be best.
bonnie5689
I believe what you’re referring to is passing the parent information to the children to run a function directly.
This certainly works, but passing the information to all the children is a pain.
Auran13
You can connect multiple targets to the Target pin of a function, and they will automatically be looped.
This is faster than a For Each Loop.
Husky211
The interface is tedious to manage, so I try not to use it unless absolutely necessary.
If this is the only way then I have no choice, but I would like to know if there are other way.
That means a way to communicate only between parent and child widgets.
Hi!
The approach at the top half of the image should work as expected, you only need to remove the events added manually at the bottom half of the image.
…and gets converted into individual events as shown below the image.
These individual events were added by selecting each UW_WeaponAssignSlot > Events > Clicking the event name, which adds the event to the graph, correct?
Yes, i thought should work as expected too.
But it doesn’t work in the widget.
The events work so the event dispatcher is definitely working.
These individual events were added by selecting each UW_WeaponAssignSlot > Events > Clicking the event name, which adds the event to the graph, correct?
Yes. I added these event in the same way as “Press Button” for a button.
Let’s assume it’s a bug, you could remove the UW_WeaponAssignSlot widgets you added, compile blueprint, add them again, then bind their events on BeginPlay and test using PrintString.
Wow I can’t believe it…This worked perfectly!
I had assumed that the event dispatcher behaved differently for widgets, but I was wrong.
Thank you for your help!
I’m glad it worked, good luck with your project!
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.