Hello.
Expected behavior: The whale’s color is loaded from PlayerPrefs. (Note: I disabled Animation Controller)
Current behavior: Animation Controller overrides color and defaults to white.
Work around: When I change the color using the editor, the Animation Controller doesn’t override it.
Notice in the status bar that the PlayerPrefs is actually returning the saved color.
Any pointer as to what may be causing the Animator Controller overriding the color from PlayerPrefs when it doesn’t do the same when the color is changed in the editor?
Thank you.
I accidentally found a workaround. I was playing with the color selection field and when I changed the color to red and hit play, the whale was showing the right color. I tried with different colors and it works fine. The only color that overrides the PlayerPrefs color is white. I don’t know WHY it works and this isn’t sound debugging practice as I don’t know the root cause but for now, I know it works. I just hope there would be a future explanation why starting with white overrides the color loaded from PlayerPrefs.
Update: It doesn’t work with lighter colors like yellow or green, but red and black seem fine.
-
Paint the sprite black in the editor
-
And hit play, the whale displays the color from PlayerPrefs
I think I found the root cause of the problem. I added a Color property in the dopesheet and the RGB values default to 1. I only wanted to manipulate the Alpha. When I deleted the RGB properties, everything works fine now. I hope this helps others avoid the same mistake I made. 
1 Like