[Help/SOLVED] Unable to get my Canvas Text to render over everything

I have gotten to the end and currently working on fleshing out my game. One item that I can’t seem to fix is getting my winning text to render on top of everything else. Because it’s part of my canvas, i can’t move it with zed. Any advice would be greatly appreciated. The units (cactus in the example pic) are placed dynamically after the scene has started and is under it’s own GameObject created at run time. I have tried using the layers and setting my canvas text as one layer and my unit preFabs as another, regardless of the order, the same issue happens.

Example:

The original post only let me attach one image, I wanted to show my hierarchy and inspector in case it helps.

The original post only let me attach one image, I wanted to show my hierarchy and inspector in case it helps.

In the Canvas Renderer component on your Canvas what have you got your Render Mode set to? If it’s not Screen Space Overlay try giving that a go.

From the Udemy tutorial I was following, Ben had us set it to world space. When I change it to Screen Space Overlay it makes everything in the cavas huge (at lease in my scene view) and everything outside of the canvas is extremely tiny.

What about when the game is actually run though?

Looking at the documentation, if you scroll down to the World Space there is a screenshot which shows the Order In Layer - is there anything else perhaps that may be clashing with this across your other objects?

2 Likes

I took a look at that document and tried playing around with things based on what you said. While it was in world overlay, it wasn’t layering or sorting right. So I took a look again in 3D mode and it made better sense. The winning text was on the main Level Canvas gameobject (per my screenshot above), and in world view rendering, everything was flattened to one “layer”. My attacker/defender units are in a separate gameobject that sits close to the camera, so “above” the level canvas.

With that in mind, it would never work right, because the win text would always be flat on the canvas, and the units would always be “above” it. So here is what I figured out to fix it.

  1. Set my Level Canvas Render Mode to Screen Space - Camera
  2. Set my Text Zed to -1

Thank you for pointing me in the right direction!

1 Like

Glad you resolved it, well done - and you’re welcome :slight_smile:

1 Like

Privacy & Terms