Search Unity

Unity UI Setting image sprite via code creates bugged/distorted sprite - 2019.1.3f1

Discussion in 'UGUI & TextMesh Pro' started by Stardog, Jul 27, 2019.

  1. Stardog

    Stardog

    Joined:
    Jun 28, 2010
    Posts:
    1,913
    1.PNG
    2.PNG

    Both of these elements are using same prefab, instantiated using the same code. The log sprite shows up fine for some reason, but he plank sprite shows up distorted. It has the same import settings.
    • Setting image to Filled fixes it.
    • Setting image.sprite to null before setting it in code fixes it.
    Has this been fixed in later versions?