UI image - wrong data type

When player press the button, I load a new level, but I don’t want him to look at the frozen screen while it loads, so I want to enable a full-screen image and then load level. I’ve made an Image variable, but UE says that I’m using a wrong type, so I can’t drag my image asset to this variable. Which type should I use?

  • As My Hud is invalid - it’s not even connected to anything…, that’s not how casting works. NewLevelImage cast will always fail here. Also, you cast to it, do not set it and use it on itself? This makes little sense.
  • even when you manage to get it to work, it won’t - when you open a level, all widgets are removed (unless something has changed in 4.20

See if you can find an answer here:


Thanks! Now I can see a white screen while loading a level. But how can I change it to the image I need?

I do not fully understand what you’re trying to do.

You create a new widget and add it to viewport. That’s cool.

But you have a variable (Next Level Image - in red, top image) that is in no way associated with the widget you create. Is this is a widget reference or an image reference? Where is it coming from? Does it contain the image you want to set on the widget?

I am confused because the widget you create and the variable have the same name

If you want the newly created widget display a custom image, create an image variable inside the widget, bind it to the widget’s image (still inside the widget) and mark it as Instance Editable and Expose on Spawn

This will get you an extra pin on the Create Widget node you can feed with any image.

Alternatively, drag a wire from the Return Value pin of the Create Widget node > get Image > Set Brush from Texture (I think that’s the name)