Adjusting the Tint of a Particle/Additive shader

Hi there,

I was just trying to fade off the alpha of the Tint Color component of a Particles/Additive shader, but my usual script wont work . Something like this - Clouds.renderer.material.color.a = .5;
Gives me this error - ‘_Color’ is not a member of ‘UnityEngine.Material’.

I can’t figure out how to access the alpha I’m trying to fade off here, but i can get to it in in the inspector so I must be able to modfy it somehow,

Anyone got any ideas on how to get that?
Thanks
Pete

“material.color = x” is a shortcut for “material.SetColor(”_Color", x)". Particles/Additive uses _TintColor rather than _Color, so the shortcut won’t work.

–Eric

2 Likes

Perfect! Thanks Eric :slight_smile:

Thanks for the tip, I tried that but I still get this error:
Material doesn’t have a color property ‘_Color’
UnityEngine.Material:get_color()
FadeCylinder:MaxAlpha() (at Assets/Wyndham/Sandbox/CocktailTransition/Script/FadeCylinder.cs:47)
c__Iterator1C:MoveNext() (at Assets/Wyndham/Sandbox/CocktailTransition/Script/FadeCylinder.cs:81)
UnityEngine.MonoBehaviour:StartCoroutine(String, Object)
FadeCylinder:FadeIn(Single) (at Assets/Wyndham/Sandbox/CocktailTransition/Script/FadeCylinder.cs:136)
FadeCylinder:FadeIn() (at Assets/Wyndham/Sandbox/CocktailTransition/Script/FadeCylinder.cs:125)
FadeCylinder:Update() (at Assets/Wyndham/Sandbox/CocktailTransition/Script/FadeCylinder.cs:153)

Wow, this was an old post!
It’s hard to tell what could be causing the problem without seeing the section of code that is causing the error. Maybe post that here so we can have a look at that and get to the botttom of it.

P.

its ok i got it working, i had to pull _TintColor instead of _Color