This is the way to go. I’ll just add that you can run it in a loop and expose variables on spawn. This will allow you to customise the newly spawned widgets.
I’m sorry. I think I didn’t write enough about my problems.
My widget have some empty vertical boxes.
And I want to add some text or buttons and click on event of that buttons when i spawn widget during game.
I tried upside way, but widget cannot cast to button or text box.
It couldn’t work when I use editable text box or text block too.
My question is, “How to add text box or button as a child of vertical box dynamically”