Search Unity

Bug Text/Sprite shader missing when creating new Sprite Asset

Discussion in 'UI Toolkit' started by norgalyn, Mar 14, 2021.

  1. norgalyn

    norgalyn

    Joined:
    Feb 15, 2014
    Posts:
    8
    Hi, I am using 2021.2.0a8 and when attempting to create a Sprite Asset by right clicking a sprite > Text > Sprite Asset, I get a null pointer exception due to SpriteAssetCreationMenu attempting to create a material with shader called "Text/Sprite", which does not exist. I do not have any UI package installed.
    This prevents me from using any sprite assets as I can't create the necessary material myself either.
     
  2. JuliaP_Unity

    JuliaP_Unity

    Unity Technologies

    Joined:
    Mar 26, 2020
    Posts:
    700
    Hello, a fix for this issue is done and should be out in a new version soon!
     
  3. RunninglVlan

    RunninglVlan

    Joined:
    Nov 6, 2018
    Posts:
    182
    I'm having this issue in 2021.2.0b6. When will the fix be out?
    upload_2021-8-4_19-3-15.png
    Looks like regression as it's working in Unity where UI Toolkit was a package.
    Does it mean that we can't use <sprite> until this will be fixed?
     
    Last edited: Aug 4, 2021
    MousePods likes this.
  4. HugoBD-Unity

    HugoBD-Unity

    Unity Technologies

    Joined:
    May 14, 2018
    Posts:
    499
    Hi @RunningIVlan! There's a fix incoming that will be backported to 2021.2. Unfortunately, it's indeed a regression. I just tested it, and it seems like the SpriteAssets created in the package are still working in 2021.2. Creating new SpriteAssets will not, though.

    As a temporary workaround, you could drag and drop the Sprite shader from the com.unity.textcore package into your project. (com.unity.textcore/Shaders/Sprite.shader) Just don't forget to remove it once we have fixed the issue.
     
    RunninglVlan likes this.
  5. RunninglVlan

    RunninglVlan

    Joined:
    Nov 6, 2018
    Posts:
    182
    Confirming, can't reproduce this bug in 2021.2.0b15