Search Unity

  1. Are you interested in providing feedback directly to Unity teams? Sign up to become a member of Unity Pulse, our new product feedback and research community.
    Dismiss Notice

In 2019.1, changes to Image.color are not displayed after changing its sprite via C#

Discussion in 'UGUI & TextMesh Pro' started by starform-joshrosen, Apr 22, 2019.

  1. starform-joshrosen

    starform-joshrosen

    Joined:
    Aug 29, 2018
    Posts:
    8
    I submitted a bug report on this already, but I wanted to bring it to people's attention in case they're having trouble upgrading their project to 2019.1
    Bug 1148001: https://fogbugz.unity3d.com/default.asp?1148001_nqqefj6nd7mfm5aq

    It has been talked about in the archived beta forum, but it is still present in the released 2019.1.0f2.
    https://forum.unity.com/threads/sin...-canvas-are-all-colorless-dynamically.661456/

    Observe in the screenshot how the selected Image shows up as green, even though in the inspector its color is purple.

    Calling Image.DisableSpriteOptimizations after setting the image causes the color to start updating again. But, I don't know if this makes the image generally less efficient than in 2018.3.

    I'm attaching a small sample project that demonstrates the issue (which was also included in the bug report).

    Screen Shot 2019-04-21 at 8.52.49 PM.png
     

    Attached Files:

  2. roka

    roka

    Joined:
    Sep 12, 2010
    Posts:
    498
  3. starform-joshrosen

    starform-joshrosen

    Joined:
    Aug 29, 2018
    Posts:
    8
  4. Gamrok

    Gamrok

    Joined:
    May 13, 2015
    Posts:
    14
    Same problem here when changing the sprite and/or the color. Moreover when a shadow component is used, only the shadow is displayed after changing the sprite.
     
  5. Urishizu

    Urishizu

    Joined:
    Sep 24, 2016
    Posts:
    154
    Same here. Just upgraded and this bug essentially breaks the UI for my game. Is there an ETA on when a patch will be out to fix it?
     
  6. smokinpuppy

    smokinpuppy

    Joined:
    Sep 1, 2018
    Posts:
    26
    Same problem here, I upgraded to 2019.1.1 and still the issue is there, i'm trying to call
    Code (CSharp):
    1. image.color = Color.Blue;
    in my code
     
  7. komodor

    komodor

    Joined:
    Jan 2, 2013
    Posts:
    35
    i had that issue on 2 groups of things in 2019.1.0f2, after update to 2019.1.1f1 one of the groups started to work as supposed (all the alpha tweening is displaying correctly), but the other usage where i tween alpha to 0, then change the sprite and tween back to 1 isn't working like before (if I change it from simple to let's say filled it displays but not with simple)

    so i was looking and i found 2 differencies - the not displaying sprite was rect mesh and not in atlas ... so i checked mesh and still no success but when i atlased the sprite it started to display

    i guess the bug was half fixed in update to 2019.1.1f1 but since it works only with atlased sprites (the particular sprite isn't POT)
     
  8. shark812

    shark812

    Joined:
    Dec 6, 2012
    Posts:
    13
    Same error here, I'm using the Image.DisableSpriteOptimizations right now.
     
  9. better_walk_away

    better_walk_away

    Joined:
    Jul 12, 2016
    Posts:
    185
    Yes, I have the same issue, the image color won't change when modifying through script. I have faced too much critical bugs in 2019.1. There is an IAP regression in 2019.1 as well. So I currently downgrade my project to 2018.3.
     
  10. shark812

    shark812

    Joined:
    Dec 6, 2012
    Posts:
    13
    What do you mean?
     
  11. better_walk_away

    better_walk_away

    Joined:
    Jul 12, 2016
    Posts:
    185
    shark812 likes this.
  12. roka

    roka

    Joined:
    Sep 12, 2010
    Posts:
    498
  13. telica77

    telica77

    Joined:
    Aug 27, 2017
    Posts:
    6
    Yep, I am also having this issue, I am gonna revert to 2018, there are too many game-breaking bugs in 2019.1 unfortunately.
     
  14. BakuDigital

    BakuDigital

    Joined:
    May 9, 2013
    Posts:
    18
    Seriously? This sounds ridiculous considering the number of problems for something as simple as changing a sprite... Can Unity make a comment here to explain why?

    Anyway, In the meantime, here is a hack that worked for me:

    use
    Image.overrideSprite = sprite;
    instead of
    Image.Sprite = sprite;


    Thanks @AShim-3D
     
    Rexkwong and IceMachineMG like this.
  15. roka

    roka

    Joined:
    Sep 12, 2010
    Posts:
    498
    Yeah i use the same thing too, but it do not sound normal for me to bypass it like that.
    They answer on what they want, we have several post like this on the forum and a big silence, really ridiculous.

    Imagine how someone new can have an headache because he do not understand how a simple stuff like this is not working .....
     
  16. boogi505

    boogi505

    Joined:
    May 21, 2019
    Posts:
    3
    I thought it was my mistake. Because if it was edited in the editor, it worked normally. T_T ... I am using version 2019.1.3 and still have this bug. why not fix this bug? I spent the whole day looking for the cause.
     
  17. BakuDigital

    BakuDigital

    Joined:
    May 9, 2013
    Posts:
    18
  18. roka

    roka

    Joined:
    Sep 12, 2010
    Posts:
    498
  19. telica77

    telica77

    Joined:
    Aug 27, 2017
    Posts:
    6
    I still don't understand what backports means? Can someone explain that? I assume it means it will be fixed in 2019.1 and 2019.2 but which version of 2019.1, will it be fixed in?
     
  20. better_walk_away

    better_walk_away

    Joined:
    Jul 12, 2016
    Posts:
    185
    I have read the link Unity staff provided, I found this piece of information:

    Will there be updates for both the TECH and LTS streams?

    Yes.

    We will continue to offer weekly updates for the TECH stream. However the updates for the current TECH stream will stop when the next one is released. For example, when 2018.2 is released, weekly updates for 2018.1 will stop, and when 2018.3 goes live, support for 2018.2 will end.


    Because 2019.2 hasn’t gone live, 2019.1 will continue to be updated until 2019.2 is released. So I think the fixes that had been done to 2019.3 will also be done to 2019.1. Nonetheless, I still think Unity should point out this important fact in the issue tracker status, not just saying “Fixed in 2019.3”, saying something like “Fixed in 2019.3 and will also be backported to 2019.1, 2019.2” instead.
     
  21. Adam-DevClever

    Adam-DevClever

    Joined:
    May 22, 2019
    Posts:
    4
    Can anyone confirm that this is fixed in 2019.2?
     
  22. vitalie8484

    vitalie8484

    Joined:
    Apr 13, 2017
    Posts:
    1
    I can confirm that this bug is fixed in version 2019.2.6f1.
     
  23. Catuwepall

    Catuwepall

    Joined:
    Apr 4, 2018
    Posts:
    1
    This bug is also present in 2019.3.0b6. Happens both with Image.color and Image.sprite changes, at least with prefab instances.

    [Update] My fault, but kinda tricky to solve: I was using inheritance from Button class so I could send hover, click... events to the contained text mesh pro, so it can also be tinted at the same time. But the call was being made even after exiting play mode: when the button gets destroyed by the progrqam execution, somehow it was calling my coroutine for gradual text tint, and put it back to white. Extrange behaviour. I ended up just ignoring that call under an (Application.IsPlaying) condition.
     
    Last edited: Oct 28, 2019
  24. Missile_

    Missile_

    Joined:
    Feb 9, 2014
    Posts:
    7
    Bump. Animating Image.sprite is broken in 2019.3.0b7. Having no answer from Unity at this point is worrying.
     
unityunity