Keep in mind that you must provide the code that is suitable with Unity version 2022.1.5f1. It is also supposed to be C# code.
I’m working on a upcoming game, and I’m working on a fade in/out effect that will be used when scenes are being loaded in or have just been loaded in respectively. I put this line of code into the script, which is supposed to change the “A” (the transparency) of the effect’s image in the span of a second, although I removed it from the script to remove the error, and when the line of code existed inside the script, Unity said that there was a error. Here’s how this error read:
“Cannot modify the return value of ‘Graphic.color’ because it is not a variable”
Here’s how the line of code read:
this.image.color.a += 255f * Time.deltaTime;
How can a script increase/decrease a UI image’s color without any errors? Please help me; it would really mean a lot to me.