# widget class randomisation

**URL:** <https://forums.unrealengine.com/t/widget-class-randomisation/2378298>\
**Category:** UI\
**Tags:** Class, unreal-engine, Widget, question, Blueprint\
**Created:** [March 6, 2025, 6:57pm UTC](https://forums.unrealengine.com/t/widget-class-randomisation/2378298 "2025-03-06T18:57:37Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Marioucheka](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Marioucheka](https://forums.unrealengine.com/u/Marioucheka)\
**Post date:** [March 6, 2025, 6:57pm UTC](https://forums.unrealengine.com/t/widget-class-randomisation/2378298/1 "2025-03-06T18:57:37Z")

</div>

Hi everybody,

I try to randomise widget classes but it doesn’t work. Do you know how to do this?  
On the first screen, this is the event graph for the randomisation.

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/0/0/70035b13a0debf1511e7421d3d3dc12def6d01ee.png)

And on the second screen, this is all of my widget class, but only one is displayed.

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/b/1/ab1adba43c454af93a403e6cd78618bf8ea2f532.png)

Thank you in advance for your answers

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [March 6, 2025, 8:21pm UTC](https://forums.unrealengine.com/t/widget-class-randomisation/2378298/2 "2025-03-06T20:21:52Z")

</div>

It looks like it should work, but you will get repeating widgets. That’s just because the random index can choose the same one several times on the trot.

If you want it to be ‘non-repeating random’, then you’ll need more code, to keep track of which widgets have been used.

---

<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 6, 2025, 8:56pm UTC](https://forums.unrealengine.com/t/widget-class-randomisation/2378298/3 "2025-03-06T20:56:04Z")

</div>

The script looks fine. Which part does not work? The script is not triggerred? The widget is not added to the viewport / is not visible? The randomisation produces incorrect reaults?

---

<div class="post-metadata">

**Author:** ![Marioucheka](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Marioucheka](https://forums.unrealengine.com/u/Marioucheka)\
**Post date:** [March 6, 2025, 9:39pm UTC](https://forums.unrealengine.com/t/widget-class-randomisation/2378298/4 "2025-03-06T21:39:22Z")

</div>

thank you for your replies, it’s a mistake on my part, I had entered some data incorrectly, but it works now.
