Ive been all over google trying to figure out my error with no luck. i have a mesh renderer with a particle/additive material that i am trying to change the tint color of for a fade out. All works good but every now and then im getting the following error in the debugger. not sure how major of a problem it is as it doesnt seam to mess anything up… but lol would like to find a way to stop it if possible. any help would be greatly appreciated, thank you
Material doesn’t have a color property ‘_Color’
UnityEngine.Material:get_color()
public void AttackGroundSlam () {
GSTime -= Time.deltaTime;
if (GSTime < .5f) {
if (!gs) {
gs = Instantiate (GS, transform.position, Quaternion.identity);
gs.gameObject.tag = "GS";
GSR = gs.GetComponent<MeshRenderer> ();
}
gs.transform.localScale += new Vector3 (1, 0, 1) * (Time.deltaTime*70);
if (GSTime < .25) {
float GSTransparency = Mathf.Round(100 * (GSTime / .25f));
if (GSTransparency < 0) {
GSTransparency = 0;
}
Debug.Log ("GSTransparency" + GSTransparency);
GSR.material.SetColor("_TintColor", new Color(GSR.material.color.r,GSR.material.color.g,GSR.material.color.b,GSTransparency));
if (GSTransparency <= 0) {
AttackGSBool = false;
Destroy (gs.gameObject);
}
}
}
}