# When adding a child widget to the scroll box, it may not be added.

**URL:** <https://forums.unrealengine.com/t/when-adding-a-child-widget-to-the-scroll-box-it-may-not-be-added/1686196>\
**Category:** Blueprint\
**Tags:** unreal-engine, Blueprint\
**Created:** [February 13, 2024, 3:09pm UTC](https://forums.unrealengine.com/t/when-adding-a-child-widget-to-the-scroll-box-it-may-not-be-added/1686196 "2024-02-13T15:09:15Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![bats\_afinity](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@bats\_afinity](https://forums.unrealengine.com/u/bats_afinity)\
**Post date:** [February 13, 2024, 3:09pm UTC](https://forums.unrealengine.com/t/when-adding-a-child-widget-to-the-scroll-box-it-may-not-be-added/1686196/1 "2024-02-13T15:09:15Z")

</div>

![キャプチャ](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/b/0/4b038080cf425201c0f8b9701945ba584a2f0e09.png)

I’m making a game where you can chat with CPU girls.  
The “TalkGenerate” process runs at regular intervals and adds the ui TalkMessage widget to the scrollbox.

Then, even though the widget is not displayed on the screen, the “GenerateMessage” process in the AddChilded TalkMessage will be executed. What kind of situation do you think this is?

When you run “TalkGenerate” for the first time, the widget is successfully added to the screen,  
The widget will be hidden when you run “TalkGenerate” for the second or third time.  
And the fourth time, the widget will be displayed again.

The process of calling “TalkGenerate” is the same for the first to fourth times.

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [February 13, 2024, 4:47pm UTC](https://forums.unrealengine.com/t/when-adding-a-child-widget-to-the-scroll-box-it-may-not-be-added/1686196/2 "2024-02-13T16:47:14Z")

</div>

> Then, even though the widget is not displayed on the screen, the “GenerateMessage” process in the AddChilded TalkMessage will be executed. What kind of situation do you think this is?

Did you mean that it will **NOT** be executed?

This is a bit confusing, still.

- we keep adding widgets all the time (how?)
- sometimes the scroll box is visible, sometimes it is not (fine)
- when we show the scroll box, there is not enough messages as if they were not added when the widget was not visible

Am I close?

---

<div class="post-metadata">

**Author:** ![bats\_afinity](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@bats\_afinity](https://forums.unrealengine.com/u/bats_afinity)\
**Post date:** [February 19, 2024, 3:42pm UTC](https://forums.unrealengine.com/t/when-adding-a-child-widget-to-the-scroll-box-it-may-not-be-added/1686196/3 "2024-02-19T15:42:57Z")

</div>

thank you for your reply.

I’m writing after translating the Japanese into Google, so I’m sorry if the English is weird.

The expected processing during execution is the following message exchange.

example:

1. Girl A: Good morning
2. Girl A: It’s nice weather today.
3. Girl A: I like taking walks on sunny days.
4. Girl A: I want to go out with you.
5. Girl A: Let’s go out again.

When processing images, the following exchange will occur.  
This is because the line count variable is internally increased by +1 even though it is not being drawn.

1. Girl A: Good morning
2. Girl A: Let’s go out again.

---

<div class="post-metadata">

**Author:** ![bats\_afinity](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@bats\_afinity](https://forums.unrealengine.com/u/bats_afinity)\
**Post date:** [February 20, 2024, 10:05am UTC](https://forums.unrealengine.com/t/when-adding-a-child-widget-to-the-scroll-box-it-may-not-be-added/1686196/4 "2024-02-20T10:05:32Z")

</div>

> [@スクロールボックスにウィジェットをAddChildしても描画されない時がある](https://forums.unrealengine.com/t/addchild/1699779/7):
>
> 改めてコードを見てみるとScrollBoxの子供に直接ウィジェットを増やしているので、これだと表示がうまくいかない可能性がありますね [スクリーンショット 2024-02-20 172530] このようにVerticalBoxかListViewを挟むと縦方向にスクロールができます

I solved it on this forum.  
thank you very much.
