Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Default sprite asset not working

Discussion in 'UGUI & TextMesh Pro' started by Derakon, Nov 19, 2019.

  1. Derakon

    Derakon

    Joined:
    Jul 3, 2019
    Posts:
    20
    (Unity 2018.4.12f1) I have a custom sprite asset I use for embedding controller glyphs into my text for button prompts, e.g. "to jump, press <sprite name="XBox 360/A">. While working on adding more glyphs to the sprite atlas that backs the sprite asset, that has mysteriously stopped working for me -- instead of getting the sprite embedded into the text, I just see the literal text `<sprite name="XBox 360/A">`. I've tried rolling back all changes I've made to my controller glyphs / sprite assets, to no avail.

    What's particularly strange is that if I manually set the "Sprite Asset" property of a TMP text object, then that object correctly converts the <sprite> tag into an image. So it seems like TextMeshPro's default sprite asset isn't working...but that default sprite asset is the same it's always been (after I rolled back my changes anyway).

    I've also tried just outright deleting the sprite atlas and recreating it from scratch, but I get the same behavior -- TMP doesn't "see" it unless I manually set it as the sprite asset on each individual TMP text object I create.

    Notably, even if I use the default EmojiOne sprite asset, it still doesn't work. `<sprite name="Smiling face with smiling eyes">` renders as that literal text instead of the :) emoji.

    Any suggestions for things I should look into?
     
  2. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    6,588
    Make sure these sprite assets are located at the location specific in the TMP Settings which by default is "Resources/Sprite Assets/..." as seen below.

    upload_2019-11-19_12-14-47.png

    Perhaps this default location was changed which would result in TMP not being able to find the Sprite Assets which in turn would display the text as string literal.
     
  3. Derakon

    Derakon

    Joined:
    Jul 3, 2019
    Posts:
    20
    I tried that too, sorry, I should have mentioned. Certainly the EmojiOne resource should have worked if that were the issue, as it's located in the default "Assets/TextMesh Pro/Resources/Sprite Assets" directory, which is the directory pointed to by the settings asset.
     
  4. Derakon

    Derakon

    Joined:
    Jul 3, 2019
    Posts:
    20
    Got it sorted out. I had two copies of the `TMP Settings.asset` file in my project; the one I was editing was not the one that TextMesh Pro was using. Sigh.
     
    Stephan_B likes this.