Search Unity

Resolved Addressable sprites "white" when loaded (But works in editor)

Discussion in 'Addressables' started by jeppe79, Jul 2, 2020.

  1. jeppe79

    jeppe79

    Joined:
    Sep 17, 2019
    Posts:
    74
    Hello,

    All my sprites comes out white when loading.

    * Loading other sprites in the same group with the same dynamic code works fine.
    * All sprites (working and not working) all have the same import settings, the only thing that differs is the label.
    * Using asset database (Fastest) build
    * Label is unique.
    * Not using sprite atlas.
    * Problem sprites loads properly in Editor and Game view.
    * When building to Android and testing they are white
    * I logged the sprite names and they are all correct... but.. white
    * Issue tested in Addressables v. 1.10.0 and 1.11.2

    What on earth could be causing this?

    *Edit* I tried to set the "faulty" label on a sprite in the same addressables group that works, and that worked.
    So it seems it is a texture settings problem. I will keep investigating this.
     
    Last edited: Jul 2, 2020
  2. jeppe79

    jeppe79

    Joined:
    Sep 17, 2019
    Posts:
    74
    Ok, turns out this was a Unity glitch rather than an Addressable issue.
    I reimported the sprites, un-labled them in the Addressables window and re-labled, suddenly everything works.
    I can't say what the actual issue was, but I guess something glitched when I imported the sprites the first time.(Dragged 35 of them into Unity at once.)
    Hopefully this helps someone else in the future.
     
  3. better_walk_away

    better_walk_away

    Joined:
    Jul 12, 2016
    Posts:
    291
    I found that if we call LoadAssetAsync<Object>() instead of LoadAssetAsync<Sprite>(), and then cast the Object to Sprite, we will get a white sprite. So in this case, make sure we are using LoadAssetAsync<Sprite>() and we are good to go.