So you can see I actually have a trail renderer here.
It's kind of this weird pink color.
But you can see there is a path here and eventually you can see it disappear.
Let me go ahead and stop that.
So one of the most important properties of the trail render
is the material that renders the trail.
So let's go ahead and create a new material for this.
So I'm going to go into my projects tab and select
materials and by selecting the materials folder when I choose create,
it will then automatically create it within that folder, of course.
So let me go ahead and chose create.
Go down to material.
And I'm going to call this my Trail Material.
And these are just the standard options here.
I want to change my shader from standard to particles,
and then choose Alpha blended.
And of course, you can play with different shaders to see what effects they might have.
So I want to change my tint color.
So let me go ahead and choose just a white tint color here.
And I'll leave the alpha at 128 sort of half opaque, half transparent.
And that's all I'm going to do to that trail renderer.
Let me go back to my Rollerball and apply that material.
So notice right now the material is set at none and
that's why we have that weird pink color that's basically,
whenever you see that weird pink color in Unity,
that means probably a material is not attached to something.
So here in the trail renderer,
I want to attach that material to
my materials and I can go ahead and just
drag and drop it right there into that material spot.
And then material's now applied.
So without any other changes if I go ahead and hit play,
you'll see that we no longer have that pink,
we have more of a white color but it still doesn't look great.
So let me go ahead and stop this,
and go back to the trail renderer and play with some of the different options here.
So just moving down,
you can see the time is set at five,
that's basically five seconds.
The trail will continue to grow over five seconds and then the track.
So let me go ahead and change that to be much smaller.
Let me bring it down to two seconds and you could adjust how you see fit.
And if I go ahead and play now.
You can see that the trail is much shorter than it was before.
So the other thing is our trail is much too big
and you can see the width right here is set at one,
and if I change that to something like zero point five and then play again,
you can see my trail is a lot smaller.
So it's half of the meter rather than a meter.
But it would be nice to kind of have my trail dissipate over time.
That what with the little diagram here is representing.
So for example, let me change my width back to something like 0.8.
So it's a little bit bigger but it's not an entire meter which is the size of the ball.
And then I want to adjust a curve here.
So you can see the little keyframe at
the beginning and this sort of represents time here.
So if they go to the very end of this and right click,
I can then choose to add a key.
And once I have a key there,
I can actually drag this down.
If I drag it all the way down to zero,
you can see the curve basically represents a transition over
time from 0.8 width to zero width,
over 100 percent of the time.
So over two seconds it will have that transition.
So if I go ahead and play again, we can see the effect of that.
So you can see I've got a nice tapering off of that trail.
Now the last thing that I want to do is actually adjust the color over time as well.
So you can see the color option just below the curve.
Let me go ahead and select this.
And notice I don't get just the regular color picker I get a gradient editor.
So we can actually define a gradient over time.
And the way this works is the bottom are colors and the top is transparency.
So for example, I can choose the bottom indicator here and select that.
And that will bring up our color picker that we've seen before,
and I'm going to go ahead and set a starting color of 00FFEA
to create a similar blue color that we've seen before.
And let me go ahead and close that.
And then for the final color- so this is the beginning color and then
I can go to the end here
and double click on this to bring up the color picker once again.
And I'm going to set the final color to 0080FF.
So a darker blue color.
And go ahead and close that So I've got
a transition from this color to this color or a gradient if you will.
I also want to transition the transparency.
So if I double click on the first one you can see I start with an alpha of 255,
and then if I click on the last one here,
I'm going to transition down to an alpha of 50.
So almost completely transparent and you kind of see the effect there in the preview.
Of course you're not going to see that checkered pattern.
And let's go ahead and close this and test it up.
So you can see now our trail behind the ball is a blue color rather
than the white and it changes color over time and it fades out over time as well.
I think it looks pretty good.
In the next video, we'll add the ability to die in the game through health and damage.