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

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.

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?

1 Like

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.

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