I need to change the alpha component of the color of my particles depending upon the angle the scene is being looked at.
In my Update() method, I calculate the angle, create a new color and then call
thinDiskParticleRenderer.material.SetColor (“_TintColor”, thinDiskColor);
This seems to have no effect.
The material does have a TintColor.
Can anyone tell me why this isn’t working?
Thanks.
After some further experimenting, maybe I’m using the wrong name for the color?
If I do:
var oldColor = thinDiskParticleRenderer.material.GetColor(“_TintColor”);
The oldColor has 0 for all 4 components (which is not right).
I figured it out. Apparently the color name I want is “_Color” event though it is called “Tint” in the UI. Looks like you can set it using either:
thinDiskParticleRenderer.material.color = thinDiskColor;
or
thinDiskParticleRenderer.material.SetColor (“_Color”, thinDiskColor);