Playmaker Forum
PlayMaker Help & Tips => PlayMaker Help => Topic started by: akadow on March 08, 2019, 06:19:54 AM
-
Hi there!
Is it possible to change the color of a trail renderer n event (trigger enter, etc)?
Thanks!
-
Absolutely, you could do it a few ways including through the use of the "set material color" action. If you select the shader you want to use so that you can view its keywords in the inspector window, use that keyword in the "named color" part of the action, once that state is active it will change it to the colour you set. For example the particle shader I'm currently looking at has a "tint color" setting, the keyword for this would be "_TintColor".
-
Hi, thanks for the answer but with set material color I do not get Gradient Editor
-
Sorry I didn't consider that, I actually looked for the same answer a while back and was told that Playmaker doesn't support gradients. I'm pretty sure I've used gradients on particles, but just to setup a black and white gradient, then I think I've controlled an overall tint through the material assigned to the particle. You may be able to go down that route. Best of luck with it!
-
Hi.
From what i understand,
you are looking to be able to do this :
https://docs.unity3d.com/ScriptReference/TrailRenderer-colorGradient.html
I will see if i can make an action for this tomorrow (its already midnight here at the moment :) )
-
Djaydino, I made a line renderer gradient awhile back. You could probably just repurpose it and change it to be trail renderer instead of line renderer: http://hutonggames.com/playmakerforum/index.php?topic=15044.0
-
hi.
@tcmeric.
Great thx.
i will have a look.
-
Hi.
Eventually i did not use arrays directly but you can choose the amount of color keys and alpha keys
Similar to multi actions.
(https://i.imgur.com/geyEwT2m.png)
I did not have much time to test so please let me know if they work :)
You can get them from the attachment below. (For line and trail)
-
Now that's pretty snazzy!