Don't use a trail renderer, use its static cousin line renderer.
You can control the width of the line renderer using curves. So a linear falloff from 1.0 at the beginning to 0 at the end will give you a "tail" which looks similar to a trail renderer.
In order to create a circular line, you might want to generate the positions of the line procedurally.
Here is an untested code example.
float radius = 10f; // radius of circle in units
int num_points = 360; // adjust based on desired tradeoff of performance vs. quality
var points = new Vector3[num_points];
for (var i = 0; i < num_points; i++) {
var angle = (Mathf.PI * 2f) * ((float)i / num_points);
points[i] = new Vector3(Mathf.Sin(angle) * radius, Mathf.Cos(angle) * radius, 0f);
}
lineRenderer.SetPoints(points);
I don't know how you built your scene, so I had to make a couple assumptions. Should the circle be in the wrong orientation (vertical instead of horizontal), change the order of arguments to new Vector3()
). I don't know if your planets orbit clockwise or counter-clockwise, so if the trail is in the wrong direction, replace angle
with -angle
. Should it be off by 90°, switch Sin
and Cos
.
This code is also rather costly (both calculating the points and setting them), so you might want to do this only once in Start()
and then just rotate the LineRenderer with the planet while it moves on its orbit.