# Dynamically adding children to a scroll box?(From the top down?)

**URL:** <https://forums.unrealengine.com/t/dynamically-adding-children-to-a-scroll-box-from-the-top-down/463944>\
**Category:** UI\
**Tags:** hud, unreal-engine, Array, Widget, Blueprint, question\
**Created:** [April 18, 2020, 10:15pm UTC](https://forums.unrealengine.com/t/dynamically-adding-children-to-a-scroll-box-from-the-top-down/463944 "2020-04-18T22:15:15Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![PerCat](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/percat/32/479573_2.png) [@PerCat](https://forums.unrealengine.com/u/PerCat)\
**Post date:** [April 18, 2020, 10:15pm UTC](https://forums.unrealengine.com/t/dynamically-adding-children-to-a-scroll-box-from-the-top-down/463944/1 "2020-04-18T22:15:15Z")

</div>

I’m creating a message log to catalog events as they happen. Game start, new day, any event etc. Think of this like in civ or something.

I want to make it so when a new child widget is added to the scroll box in my hud it will be added to the top and push the last one down. Unfortunately there is no simple way to do that in ue4. I am attempting to add the widget to an array and then add each child again, saving all the info in arrays along the way.

For some reason my for loop doesn’t seem to iterate at all though, it just instantly fires the complete. I just have the initial event hooked up to a timer on begin play that loops every 5 seconds so I can see a new game start message every 5 seconds.

 ![300002-messagelog.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/e/c/eec0a74f9fa74e3030a24927ea5af4a02d9b7c8e.png)

Any help appreciatted.

Edit: Grammar

---

<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:** [April 19, 2020, 12:55am UTC](https://forums.unrealengine.com/t/dynamically-adding-children-to-a-scroll-box-from-the-top-down/463944/2 "2020-04-19T00:55:35Z")

</div>

This is one of my pet peeves, such a weird omission in UMG.

> it will be added to the bottom.

I believe you mean to the ‘top’, seeing how you’re forced to use the array insertion workaround. Not sure why the loop is not iterating (no need to cast, btw) - maybe it is but the children do not appear?

* * *

Do consider the following alternative, there’s a _hack_ that works surprisingly well:

- add a _Vertical Box_ to the _Scroll Box_ and rotate it 180
- when adding children, add them to that _Vertical Box_ instead, and also rotate them 180

This way the _Scroll Box_ behaves normally (since it is not rotated) and new elements pop in at the top. And you do not need to fiddle with an array or clear the container:

 ![300010-annotation-2020-04-19-015212.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/3/e/d3e09ecc613effebefa6d2bfc526dedeeb3e8272.png)

[![Image from Gyazo](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/5/6/f56bb21c9950e8b03e2dc487ca614f5635bfc182.gif)](https://gyazo.com/27ee77073daba997a419c2c8f4abe1e8)

…such a weird omission in UMG.

* * *

edit:

> From the bottom up

Or is literally from the bottom up, as in the container is aligned to the bottom and new notifications push the stack upwards?!

---

<div class="post-metadata">

**Author:** ![PerCat](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/percat/32/479573_2.png) [@PerCat](https://forums.unrealengine.com/u/PerCat)\
**Post date:** [April 19, 2020, 1:42am UTC](https://forums.unrealengine.com/t/dynamically-adding-children-to-a-scroll-box-from-the-top-down/463944/3 "2020-04-19T01:42:27Z")

</div>

No I’m just stupid and missed typed, I meant top down. Thanks for the answer an easy workaround that fixed my issues immediately.

---

<div class="post-metadata">

**Author:** ![dellis23](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@dellis23](https://forums.unrealengine.com/u/dellis23)\
**Post date:** [August 24, 2020, 3:51am UTC](https://forums.unrealengine.com/t/dynamically-adding-children-to-a-scroll-box-from-the-top-down/463944/4 "2020-08-24T03:51:12Z")

</div>

I feel baffled, because I seem to be getting the opposite behavior as everyone else. Adding a child appears to put the child at the bottom rather than the top for me, and I want the opposite behavior. Maybe I’m just misreading edits at this point.

This hack seems silly, but it indeed works for me. Thanks.

---

<div class="post-metadata">

**Author:** ![Elfideo](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Elfideo](https://forums.unrealengine.com/u/Elfideo)\
**Post date:** [December 15, 2020, 3:28am UTC](https://forums.unrealengine.com/t/dynamically-adding-children-to-a-scroll-box-from-the-top-down/463944/5 "2020-12-15T03:28:57Z")

</div>

Hi I had the same problem I was trying to put an email list with the new emails at the top this is what I’ve used to solve the issue

 ![324853-widgetpushtotop.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/1/9/819a8b0dc1ce0b326853ed8a3ffcc09c77665ed1.png)

---

<div class="post-metadata">

**Author:** ![StormolFlak1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@StormolFlak1](https://forums.unrealengine.com/u/StormolFlak1)\
**Post date:** [August 3, 2022, 8:01am UTC](https://forums.unrealengine.com/t/dynamically-adding-children-to-a-scroll-box-from-the-top-down/463944/6 "2022-08-03T08:01:09Z")

</div>

Thanks this works very well

---

<div class="post-metadata">

**Author:** ![Nizami\_Nz](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Nizami\_Nz](https://forums.unrealengine.com/u/Nizami_Nz)\
**Post date:** [July 27, 2023, 1:12pm UTC](https://forums.unrealengine.com/t/dynamically-adding-children-to-a-scroll-box-from-the-top-down/463944/7 "2023-07-27T13:12:54Z")

</div>

Genius)

---

<div class="post-metadata">

**Author:** ![WolfTechRob](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/wolftechrob/32/1032282_2.png) [@WolfTechRob](https://forums.unrealengine.com/u/WolfTechRob)\
**Post date:** [October 29, 2024, 12:54am UTC](https://forums.unrealengine.com/t/dynamically-adding-children-to-a-scroll-box-from-the-top-down/463944/8 "2024-10-29T00:54:03Z")

</div>

You deserve all the medals. Way to flip this problem on its head!
