- Home /
Question by
KimJammer · Mar 21, 2020 at 05:27 PM ·
colortrailrendererpreset
Is it possible to switch between trail color presets in code?
I've looked all over the internet, but is it possible to switch between trail color presets with code?
Comment
@KimJammer Have you found an answer to your question, bc I can't find nothing about changing the trail color presets with code.
Answer by dougantor · Mar 21, 2020 at 10:50 PM
use GetComponent() and then you can set the colour with colorGradient, startColor or endColor. Example:
GetComponent<TrailRenderer>().startColor = Color.white;
All this sort of stuff can be found in the Unity documentation, the page for the TrailRenderer can be found here.
Your answer
![](https://koobas.hobune.stream/wayback/20220612225434im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Trail renderer color always black 3 Answers
Trail Renderer's colors don't apply to material 1 Answer
Trail faded at start - All colors are full alpha 1 Answer
Set trail renderer color and gradient in script? 0 Answers
Unity restore preferences 0 Answers