Search Unity

  1. Unity 2018.3 is now released.
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. We've updated our Terms of Service. Please read our blog post from Unity CTO and Co-Founder Joachim Ante here
    Dismiss Notice
  4. Want to provide direct feedback to the Unity team? Join the Unity Advisory Panel.
    Dismiss Notice
  5. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice

Text Mesh on 2d sprite and sorting layer problem

Discussion in 'Extensions & OnGUI' started by FiftyYtl, Dec 21, 2018.

  1. FiftyYtl


    Dec 2, 2018
    Hello everyone;

    I'm having trouble about sorting sprite and text together.

    I have multiple 2d game objects moving around and they all have text on it. I couldnt add text mesh on sprite because it conflicts with the sprite renderer so i created a child element and i added text mesh to it.

    But i cant order layers, text is always in front of the all other objects.

    For example; i have 3 balls on the screen and each have their sorting layers as "ball" and they have order in layer like 1,2,3. Big ball is always in front and the others behind them. And i added these objects empty game object and added Text Mesh to them. When i move balls text is always in front for all balls. I want big ball in front with its own text and the other balls behind it with their own text.

    Text Mesh doesnt have any sorting layer option, i guess its sorting layer is always "Default"

    How can i order objects with the correct order ?

    Thank you.