I have a class that extends MonoBehavior and this:
renderer.material.color.a = 1f;
give me an error of this:
Cannot modify the return value of `UnityEngine.Material.color’ because it is not a variable
I don’t really see what I am doing wrong here.
I have a class that extends MonoBehavior and this:
renderer.material.color.a = 1f;
give me an error of this:
Cannot modify the return value of `UnityEngine.Material.color’ because it is not a variable
I don’t really see what I am doing wrong here.
You can only do that in Javascript. In C#, you have to do
Color temp = renderer.material.color;
temp.a = 1f;
renderer.material.color = temp;
Javascript does that for you behind the scenes.
–Eric