# Shuffle widget buttons position

**URL:** <https://forums.unrealengine.com/t/shuffle-widget-buttons-position/479788>\
**Category:** UI\
**Tags:** buttons, hud, randomize-array, unreal-engine, Widget, question\
**Created:** [March 5, 2021, 9:14am UTC](https://forums.unrealengine.com/t/shuffle-widget-buttons-position/479788 "2021-03-05T09:14:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![olga\_p](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@olga\_p](https://forums.unrealengine.com/u/olga_p)\
**Post date:** [March 5, 2021, 9:14am UTC](https://forums.unrealengine.com/t/shuffle-widget-buttons-position/479788/1 "2021-03-05T09:14:33Z")

</div>

So, I have 3 buttons (1, 2, 3), I want them to load in random position every time widget is loading. Example: 3, 1, 2; 2,3,1 and so on. I have no idea if that is correct or not, but I tried to create an array and shuffle it, connected it in Construct, and Pre-construct too, but it seems I’m missing something as it doesn’t work. Where should I place it or how do I achieve that?  
Thanks

---

<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:** [March 5, 2021, 10:02am UTC](https://forums.unrealengine.com/t/shuffle-widget-buttons-position/479788/2 "2021-03-05T10:02:04Z")

</div>

> I tried to create an array and shuffle  
> it

You might be referring to the _Make Array_ node here; shuffling that will not work well, indeed. Placing buttons in a proper _Array of Buttons_ should do the trick, though:

 ![331606-shufflebuttons.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/7/9/b79a49363dfc0f6d1809e1cc5684d21f499b8e60.jpeg)

Pre-Construct allows you to preview changes in the editor and will fire when the widget is created, too. A _Custom Event_ can be hooked up to the same execution chain and executed run-time, if needed.

[![Image from Gyazo](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/7/4/f7479cfaee0276c8a4a8cb0d7004c214e7d0c69a.gif)](https://gyazo.com/67987a858aeeea340b6e8d43edb0367b)

---

<div class="post-metadata">

**Author:** ![olga\_p](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@olga\_p](https://forums.unrealengine.com/u/olga_p)\
**Post date:** [March 5, 2021, 10:40am UTC](https://forums.unrealengine.com/t/shuffle-widget-buttons-position/479788/3 "2021-03-05T10:40:09Z")

</div>

Thank you very much. That’s exactly what I needed!
