User widget z order

z order in widgets are only respected in the widget itself, not globally.
So if you create 2 userwidgets, one will always overwrite the other, dependent on creation order.

This hinders interaction like drag&drop between different widgets.
Z-Order should be in the hands of the user.

Hello ,

I have a few questions for you that will help narrow down what issue it is that you are experiencing.

Quick questions:

  1. Can you reproduce this issue in a clean project?
  2. If so, could you provide a detailed list of steps to reproduce this issue on our end (this is to make sure that we are seeing the same issue)?
  3. Could you provide screen shots of any blueprints that may be involved?
  4. Have you tried adding these two widgets to a master widget?

Hello Rudy,

thanks for helping!

1.) Not too much in my project, so I consider it clean. Yes.

2.) I can:
a.) Create a UserWidget, add an image to it, name it UW1 and add it to the viewport
b.) Create a UserWidget, add an image to it, name it UW2 and add it to the viewport, make it overlap with UW1
c.) In the designer, change ZOrder of the image in UW1 to 10 so that it should be drawn after all widgets in UW2.

Result: image in UW1 is drawn under all widgets in UW2.
Expected Result: image should be drawn over all widgets in UW2, because it’s ZOrder is 10 and zOrder of all widgets in UW2 is 0.

3.) sorry, I think in this case a picture can’t help.

4.) this works, but it’s more of a workaround. Leaving the ZOrder in the users hand allows for more freedom. Perhaps I might suggest, that the menu itself (top most Canvas Panel) gets a ZOrder? So menus can be ordered by user.

Hello ,

The zoder is for organizing widgets within the widget itself. This feature does not extend globally to all widget blueprints. To determine what widget blueprint will be on top you will need to know which was added to the viewport last. This means that another workaround could be to remove the widget that you want on top and to immediately add it back when ever another widget blueprint is added. With that being said there is a feature request that has been implemented on an internal build that will allow for more control over the layering of widgets. This feature will be available in a later release of the engine. I hope that this information helps.

Make it a great day

1 Like

Thanks! This will help.

I just realize that I need that feature too. I open several windows with UMG and they appear in different Z orders depending on when they were opened. I would much like to be able to set the Z order of a user widget myself. Can we get some info about this feature request and when it may be considered?

Thanks

Hello ,

I have a couple of suggestions for you that may help depending on your needs. I hope this information helps.

Suggestions:

  1. You could have one master widget that all other widgets are added to so that you can set their Z orders dynamically at children of the the Master Widget’s canvas
  2. You can manage the z order when adding the widgets to the viewport by clicking the little down arrow one the “Add to viewport” node. This would allow you to manage the zorder for the widgets as they are added to the screen.

Make it a great day

1 Like

Did you tried this:

With AddToViewport you can set the ZOrder as parameter.

3 Likes

man… this is a great idea.
Probably never saw it because of big tomatoes on my eyes.
My current solution is to mix Menus created in BP and created by cpp using AddToViewport(). There are a lot of side effects and code converting coords going on to make this work. But overall design is overly complicated so far. I’ll try this out. Probably setting the anchors to all 4 corners (for the master menu) should also help with resizing windows.

Ye wow, thanks, I never saw this either. I’m going to check this out right away :slight_smile:

What’s the name of this feature?

Hello AdmiralSlim,

I have provided a link to the Unreal wiki below. From there you will be able to read up on the z-order feature that can be used is widgets.

Link: Widget Type Reference for UMG UI Designer in Unreal Engine | Unreal Engine 5.1 Documentation

Make it a great day

Bumping this thread. Has zorder for widgets been implemented? Thanks.

Where exactly is this information?

Hello JeremyRF,

I have provided a screen shot of the part of the page describing z-order at the link provided. I hope that this information helps.

Example:

Make it a great day

@anonymous_user_e729f54e (or anyone else who knows)

Was the feature mentioned here ever released?
Is there now a better way to control the z order between widgets?

1 Like

Just press the arrow down on the add to viewport blueprint to get access to the z order for the widget.
image

2 Likes

this doesn’t seem to work I set my player HUD to 0 upon adding it to my viewport and my other widget to 100 when added and it’s still behind the HUD
image

1 Like

It’s kind of working now idk why I changed nothing just updated versions and it’s fixed :man_shrugging: