Random images in Widget Blueprint

Greeting UE Community,
So basically what I want is to random an image on the screen whenever a press a key.
What I have done :

So the problem here is when I connect the return value of get to the texture from Create brush from texture, the result will be that it will continuously drawing all images ,not showing only one random image.

This is the blueprint of the object that detects the pressed key.
I know the reason. As long as the image is still on the screen , it will always get random values of the image array and return another image all the time.

move everything from GetBrush, into EventConstruct. because EventConstruct is only called when the widget is created, instead of repeating all the time.

1 Like

Omg thank you so much :smiley: It works perfectly xD

How do you do that, you can copy the return node etc.

Hi, how can you move everything from GetBrush into EventConstruct? i’m stuck there :frowning:
GetBrush function is not needed anymore after moving everything? Apologies, i’m new on Unreal Engine.

Just move everything behind the GetBrush node to the EventConstruct

But how can you do that? How can you insert everthing from GetBrush into EventConstruct without the return node? I guess that the GetBrush binding is not needed anymore after that right? Apologies, i’m new to Unreal and i’m kinda lost yet.

This is how my GetBrush function looks, my idea was to create a loading screen with an array of images so that every time the loading screen appears, a different image is displayed at random pick.

The thing is that i don’t understand what can i do in order to connect what i have inside GetBrush to the EventConstruct.