Search Unity

TextMesh Pro TextMesh Pro + Sprite Asset - Order in Layer

Discussion in 'UGUI & TextMesh Pro' started by josephsaade, Apr 5, 2019.

  1. josephsaade

    josephsaade

    Joined:
    Apr 18, 2016
    Posts:
    46
    Hello,

    I have a TextMesh Pro object that uses a sprite asset.

    I have set the Order in Layer field, when the game runs the text is rendering fine but the sprite asset is rendering below other elements.

    Is some flag that I need to set specifically for the sprite asset?
     
  2. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    I presume you are referencing / using normal <TextMeshPro> objects. Correct?

    When you describe setting the Order in Layer on the text object, you mean in the Extra Settings of the text object as seen below. Correct?

    upload_2019-4-5_13-18-18.png

    Since Sprites / Inline Graphics are contained in child SubMesh objects, these also have their own controls for Sorting Layer and Sorting Order as seen below where you can control the sorting.

    upload_2019-4-5_13-23-25.png
     
  3. josephsaade

    josephsaade

    Joined:
    Apr 18, 2016
    Posts:
    46
    Thank you
     
  4. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    The option is there for the normal <TextMeshPro> component that works with the MeshRenderer but it is not available for the <TextMeshProUGUI> component that works with the Canvas system and CanvasRenderer since sorting order with the Canvas system is determined by scene hierarchy.
     
    DOGUKANN3 and keerthan657 like this.
  5. ThisIsDangerous

    ThisIsDangerous

    Joined:
    Dec 3, 2018
    Posts:
    39
    Yeah, I figured out I was looking at a wrong one. You managed to reply just before I deleted my post :)
    Sorry.
     
  6. shayan0sh00

    shayan0sh00

    Joined:
    Nov 1, 2020
    Posts:
    1
    Thank you
     
  7. jab2007

    jab2007

    Joined:
    Mar 2, 2022
    Posts:
    1
    Thanks so much, couldn't figure this out.