Search Unity

  1. Unity 2019.1 beta is now available.
    Dismiss Notice
  2. We're excited to be bringing you the newest Unity features, news, demos, and we've even got some special guests from some of the industry’s most storied franchises. Set a reminder to tune in on YouTube here
    Dismiss Notice
  3. Unity 2018.3 is now released.
    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.