unity-webgl

Disappearing buttons in the Unity WebGL build


I have 2 buttons to set the control scheme in my game and a script that fades the active scheme button. It works fine in the inspector, but after building on WebGL buttons disappear when I try to change their color.

ButtonsFade script: https://gist.github.com/Dankisey/7a0c16ce5e10b152da0d876cc0be3304 CustomButton script: https://gist.github.com/Dankisey/f6defadfc26f236b1155654690b332b5


Solution

  • Many thanks again to @Thinkr. The mistake was trying to do mathematical operations on Image.color and reading the color value from the Image component was also a bad idea. You can find my solution in the new revision of CustomButton script gist