Hello everyone, i came here to know how to set a opacity in the elements of my GUI.
I’ve tried this, but with no success:
var opa = 0.5f;
GUI.color.a = opa;
Inside of one OnGUI function, but i’ve received this error on console:
“error CS1612: Cannot modify a value type return value of `UnityEngine.GUI.color’. Consider storing the value in a temporary variable.”
But then i realized, i’m storing a value inside of a temporary variable, like opa. How to solve that, and if i’m in the wrong way to set opacity please set me on trails.
Thank you.
Thank you! if I want to make the buttons appear slowly and one after another, as I do?
– RafaelCNTo fade over time, you will need to change the alpha over time. If Do a Google search for "Unity3d GUI fade", and you will find a number of different answers on this issue, many with source. Try out some of the examples. If you get stuck, post a new question with the source you've done so far.
– robertbui'll do that, thanks.
– RafaelCN