Why not added in parent widget that created in child widget

I was create the widget named usericon and add in UserIconArray variable in MiniMapUI.

251021-

In MapUI have child that is MiniMapUI like upper image.

And In MapUI, i want UserIconArray that created in child widget’s length.
but the string printed ‘0’.

why not added in parent widget that created in child???

how can i use widget in parent from created in child?

just example custom event. you think that event is called in tick event when UwerIconArray’s length is smaller than 2(for example). what i knew new situation, when i create widget in Construct event, in parent’s widget added. but i called that event in tick event, child widget not added in parent’s widget. i have to call the event in tick event because i want add widget special condition in run time.

Where and how do you call that CustomEvent? If you do not call it, nothing gets added.

You should not call an event like this in Tick, that’s for sure. That’s unless you’re doing something really special with this!

Can you show a screenshot of this event being fired by something? Are you the Tick is firing?

If the UserIconArray is empty, the second branch will never fire. It only fires if there are 2 or more elements in it. Did you want to use less or equal node instead?

Put a Print String after the Add User Icon Widget and see for yourself.


Are you even sure that the first branch fires True?

For example, i make blueprints in MiniMapUI Widget like upper image. but in MapUI(Parent Widget) printed Number UserIconArray’s Length was 0.

I already test that blueprints. UserIconArray is empty so, UserIconArray’s Length is 0. later 20 seconds, second branch is fired and never added widget.

Thank you. your comment is half right but half is wrong. second branch nerver fire is wrong. I tested it. second branch is fired when after 20 seconds but, UserIconArray’s add only one. because AddUnique, same item is not added. when i print string in game, before 20seconds, printed 0 but after 20 seconds, printed 1. pleas do not focus on length of array. The Important thing is why not added parent widget that created widget in child when tick event running that is waht i want to know

No, according to the picture you posted, the second branch will never fire. The array is empty and the branch will fire if the array is not empty - it can never be filled. Put a Print String after True and see for yourself. The second branch will only fire False.

Secondly, it’s a very strange thing you’re doing here with Tick, why not do this in order to have 2 widgets:

Do not use Tick for this.

Also, remember that AddUnique does what is says, adds unique values only - so you can’t have 2 of the same in the array.

pleas do not focus on length of array

It is the thing that is giving you problems.

because AddUnique, same item is not
added. when i print string in game,
before 20seconds, printed 0 but after
20 seconds, printed 1.

After the 2nd branch’s True? Could you connect the Print String nodes and show the picture how you’re measuring it? I assume it prints 1 because your array is not empty.

You said the array is empty, so:

See what I mean.

upper image is blueprint node, and down image is result printed image

251152-result-print.jpg

i think first image is same that i posted image[tickevent-add-childwidget.jpg]
20hours ago.

it’s dont care how many items added in array. if only one item added in array, i want to get the array in parent. but i don’t know why array is empty in parent even if i create new widget and add array(UserIconArray) in child widget. in my opinion UserIconArray’s change in child widget is not be applied in parent widget.