Search Unity

Unity UI Unity UI Sprite Getting Scrambled

Discussion in 'UGUI & TextMesh Pro' started by Zullar, Mar 12, 2019.

  1. Zullar

    Zullar

    Joined:
    May 21, 2013
    Posts:
    651
    In the Unity Editor my sprites are fine.

    But when I build my .exe some of my sprites get scrambled.

    EditorMod.png BuildMod.png

    Has anybody ever seen this? I'm having trouble pinpointing the problem. Thanks in advance.
     
  2. Zullar

    Zullar

    Joined:
    May 21, 2013
    Posts:
    651
    Another example
    ArrowCombined.png
     
  3. Zullar

    Zullar

    Joined:
    May 21, 2013
    Posts:
    651
    After a lot of investigating I am still unsure what is going on. But some things I've noticed.

    1: The bug only occurs in the build, never the editor.
    2: Only about 3 of my 1000 sprites are bugged out.
    3: The bugged out sprites seem to have a visual pattern to them. Changing the import settings changes the pattern.

    To fix the bug you can copy + paste the .png texture. Delete the original texture and re-name the new copy to the original.

    Things that DO NOT fix the bug.
    -Clearing the unity .meta file
    -Renaming the file in unity
    -Opening the file in microsoft paint, modifying it, and re-saving it
     
    NickCaligo42 likes this.
  4. Zullar

    Zullar

    Joined:
    May 21, 2013
    Posts:
    651
    Some of my textures are also failing to be resizes by setting max size on the texture import settings. In most cases they resize properly, but in some cases they are not resizing. This is not a visual bug, but an actual bug (if you look at the build log the texture will use the full 21MB corresponding to 4096x4096 not the 1MB needed for 1024x1024)

    These bugs seem related because they both occur on textures and the solution is the same (copy + paste and delete the original... and the new pasted copy is fine)

    upload_2019-3-14_18-7-49.png
     
    Last edited: Mar 14, 2019
    NickCaligo42 likes this.
  5. Zullar

    Zullar

    Joined:
    May 21, 2013
    Posts:
    651
    NickCaligo42 likes this.