- Home /
How to Sort Canvas/TMP Text behind Gameobjects ?
Hi, i am a beginner and i am working on a 2D game where the player has to jump higher and higher to score. I want to place a text on my screen that stays at the point i have placed it. I want the player to jump past the text and render the player in front of the text. Currently i have added a canvas with a TMP text to the scene but i can`t figure out how to set the proper sorting layer.
When i set the render mode of the canvas to World Space and drag in the MainCamera, the Text disappears. What can i do ?
EDIT: I am deactivating the background, moving it to the top, and reactivating it to create an infinite Loop so directly attaching the text to the background object didn't seem like a good idead.
Have you tried "Sort Order" on the Canvas component. That should allow you to properly stack your canvas orders.
Unfortunately no, this is what my canvassettings currently look like. The background is order in layer 0.
Answer by KitOdin · Oct 10, 2019 at 07:35 PM
Make sure its still in the canvas and make sure it is the first object in the canvas. Hope that solves your problems
Thanks for your answer, yes, the text is inside the canvas and its the first object. However, is "World Space" the correct Render $$anonymous$$ode for my Canvas ? $$anonymous$$y canvas settings currently look like this :