|
Hi. I am trying to change the tint color of a material that is being used by a particle render. I came up with this code, and although I am getting no errors, the tint color does not change. What is wrong? Thanks
(comments are locked)
|
|
This is because the .color property of a material doesn't return tint color, it returns the MainColor, which is always called "_Color" in the source code of the built in shaders. :) Therefore, writing
Is actually shorthand for:
If you want to set the tint color, you need to use SetColor and specify "_TintColor" instead:
Beware that this only works for shaders which have a property called _TintColor, obviously. Sorry about the <>-brackets in there. They snuck their way in from my editor when I wrote the example in C#. Just replace them with () in your JS code.
Nov 22 '11 at 08:17 AM
CHPedersen
(comments are locked)
|
