I want to make any objects that pass into a certain area semi-transparent. I tried doing it by changing it by doing
theThingIWantTransparent.getComponent<Renderer>().material.color.a = 0.5;, but i get error CS1612, and it says:
Cannot modify a value type return type of UnityEngine.Material.color. Consider storing the value in a temporary variable
What is the best way to do this? And if this is the best way, how do i make it work?