- Home /
How to make canvas be layered behind my sprite?
I'm working on a 2D game and I want to have my score counter Text
object (a child of the canvas) appear behind my obstacle sprites so that it doesn't distract the player too much.
Currently I have already set the Sorting Layer for my obstacle sprites and the Text object. The Text object is on a sorting layer below the obstacle sprites but the Text object still appears on top of the obstacle sprites in-game.
I'm still getting used to this new UI system that Unity has so I'm not sure how to make this work. Anyone know how to fix this issue?
Thanks!
Answer by Hrungdak · Apr 16, 2015 at 08:45 AM
You can set the render mode of the canvas to world space. So the canvas becomes a normal Game object that can be layered.
Thanks for the answer. When I set the render mode of my canvas to world space, my UI Text disappears. I have tried setting it on a sorting layer that is above all my sprites but I still don't see my Text elements. Any ideas?
That doesn't work with mine. Does a World Space canvas need some sort of special camera attached to it? Unity seems to be prompting it in the editor.
Your answer
Follow this Question
Related Questions
How do I change the sorting layer of a UI image when it is being dragged? 2 Answers
Display individual UI elements on different layers 1 Answer
unity2d text UI is appearing above my loading prefab 0 Answers
Is there a way to adjust canvas z-ordering while using Alphabetical Sort in the Hierarchy? 2 Answers
UI object drawing order is different between Unity Editor and Standalone version 1 Answer