Search Unity

Unable to get setting spritte asset to work

Discussion in 'UGUI & TextMesh Pro' started by fwalker, Feb 28, 2021.

  1. fwalker

    fwalker

    Joined:
    Feb 5, 2013
    Posts:
    255
    According to the documentation, you should be able to do this:
    To use a different sprite asset, use <sprite="assetName" index=1> or <sprite="assetName" name="spriteName">. Sprite assets must be located in a specific folder, defined by the settings asset.

    But I have not been able to get anything to work when I set the sprite sheet as above. Is there a trick to this?
    All I get is the actual string I set something like:
    <sprite="My_Spritesheet_FOR_UI" name ="mySprite">

    As if the rich text is not being interpreted.

    The sprite asset is under the Resources/Sprite Assets folder which is what is specified in the TMP Settings prefab.

    What am I missing?
     
  2. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    Just for testing, place your sprite asset at the same location as the EmojiOne sprite asset and let me know if you get the same results.

    If the above works, then move the sprite asset back to its previous location and double check the spelling of everything as it should work from this other location as well provided the spelling is all good.

    If the above doesn't work, please provide me with a copy of the sprite asset and the texture used to create it. You can do so in a PM if desired. I can then check why it might be working as expected.

    Make sure you are also using the latest release which is version 1.5.4 for Unity 2018.4, version 2.1.4 for Unity 2019.4 and version 3.0.4 for Unity 2020 or newer. This should not affect this functionality but still good to be using the latest release.