Combo Box loaded options from Data Table row names but crashes game

Hello dear creative Unreal community,

i came across an issue (and i am not yet that experienced):
i have a widget with a combo box.
On Widget generation event”, i use “get data table row names”,
read in 600+ options for the player to choose from in a dropdown menu.
In my game, that is a visual faction choice in the lobby.
I start a “for each loop” with the array from said data table row names.
then i “Add Options” to the widget, with “get widget reference” of course.
Lastly, i thought once the for each loop is completed, i should connect it to the return node of my "on widget generation event function. However, in combo box tutorials, there is no return node,
and testing this, it breaks (does not fill any options) if connected to return node on completed.

Whats making this more delicate is, when not connected to return, it fills all options successfully,
but does not stop. So I run into a memory error and Unreal Editor crashes.
I have tested this with only 1 list entry, hence only 1 option, and still it propagates hundreds of options, (with all the same entry) in the combo box on play, and then, again;
when ever i scroll down the dropdown it crashes after a blink of a second.

I have the suspicion that it keeps calling the “generate widget event”, but i do not see why it should.
For my understanding, it should only do so once, and the for loop on completed should never be called again.

i would be very greatful for your advice.
The three options below all did not work (see images).
I also thought there might be an issue with converting from name to string;
but i tested tables with names instead of strings, same result.



Thank you very much

Hello,

let me add the crash report here:

Fatal error: [File:D:\build++UE5\Sync\Engine\Source\Runtime\SlateCore\Public\Layout\ChildrenBase.h] [Line: 210] The FChildren is destroyed. You probably have 1 widget owned by 2 different FChildren.

Thanks to Datura from the Unreal Discord!

It works now:

the solution was to not use the “generate widget event” but go to the event graph of the widget, and there use “on initialized” (only called once!).

Let me show you, so you do not have to look further:

I love unreal as a tool and the community, i come from a different engine, and this is so much better in many ways :slight_smile: cheers

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.