I’m trying to change the color of a material in a C# script. This is the line of code I have:
swatchColor.SetVector( "_Color", Vector4(fR, fG, fB, 1.0f));
In this situation, the material should be changed to the new RGB value I pass in, but I’m getting the error “‘UnityEngine.Vector4’ is a ‘type’ but is used like a ‘variable’.”
Sorry, I’m sort of new to Unity, so I expect this will be an easy fix once I find out what is going wrong.