Change TrailRenderer Properties from Code

Hi all, I have a TrailRenderer attached to my character, I need to modify its properties (time, material) on runtime. Is it possible? Any sample code please.

Thanks

No, the best question would be “How do I make” etcetera.

What is preventing you from using GetComponent(TrailRenderer)?

This is only 2 years late, but I thought I would chime in for anyone who might happen upon this later.

You need to do a

TrailRenderer trail = GetComponent<TrailRenderer>();

After doing this, you should be able to access all of the properties you need.