Forum rules - please read before posting.

Screen Space - Camera - Behind level assets.

Hello all! Happy New Year! 

As the title suggests, I've redone my UI elements, and I had to change them to Screen Space Camera in order to get post-processing filters applied to the UI as well. The problem is that UI seems to appear behind level assets. I've looked online, but I can't seem to find a concrete answer on where exactly the layering for this is done. I've attached an image of my setup. I greatly appreciate the help.

Also, can the cursor graphic be set to Screen Space - Camera?

Thank you in advance. 

https://drive.google.com/file/d/126y4XC2Ltk7goNyotmoycm7VI9Nlnbxr/view?usp=sharing <- attachment

Comments

  • It's a case of the Canvas' Plane Distance field - which determines how far from the camera the UI is - needing to be lowered.

    Unfortunately, this field only shows when the Render Camera field is also assigned - which isn't the case when dealing with a prefab.

    To get around this: place the prefab into the scene, assign the MainCamera in the Render Camera field, adjust the Plane Distance that then appears (try "1"), apply changes back to the prefab, and then remove from the scene again.

  • thank you @ChrisIceBox. It's been driving me nuts. I was able to do it once, but I stumbled upon those exact steps by accident and couldn't reproduce the outcome.

  • edited January 3

    https://drive.google.com/file/d/15nU6ob6ToESCkHCh-Vv5X1t7nCgKeqOI/view?usp=drive_link
     <- it seems to have worked only partially. I can see the icons and the BG, but the shift (left and right buttons) don't seem to appear. I've double-checked Overlay, and everything is set up as it should.

    The UI element is still in the scene; could that be causing the problem, or is it a question of how the shift buttons are arranged in the hierarchy of the UI prefab?

  • The link is private - can you make it public?

    The Z-position of individual RectTransforms will have an effect in camera-space, IIRC. The best thing to do would be to pause the game when it occurs, open up the Scene window, come out of 2D mode and check the position of the UI objects - which should all be some set distance from the camera, and so clear as to which is being drawn behind another.

  • How does it look when viewed from the side in the Scene window?

  • I think I found the issue; it's not related to the Z axis (at least in this case). I had to move the shift buttons on the X position. For some reason, on Screen Space Camera, they don't appear in the same location as they do on Overlay. This part is fixed for now. Thank you and sorry for all the bother.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.