1

Objective: I'm trying to make the trail of a sphere. I want it to be tubular, like this:

enter image description here

I was trying to achieve it with LineRenderer and TrailRenderer component, but both components work with lines, so the generated trails are bidimensional, no tridimensional, looking like this:

enter image description here

My other approach was to create a cylinder shape, add the transparent material and try to put one cylinder after another on the points of the trajectory, but the result is not the desired as it looks like:

enter image description here

Any idea or different approach will be appreciated.

Lotan
  • 4,078
  • 1
  • 12
  • 30
  • 1
    You could generate the [mesh](https://docs.unity3d.com/ScriptReference/Mesh.html) procedurally. – Iggy Jan 21 '20 at 11:53
  • Id have said maybe particles that start spread and get narrower – BugFinder Jan 21 '20 at 12:44
  • 1
    the shown picture most likely has a bidimensional renderer aswell, but adds lightning to the trail. if you want it for something similiar to the first picture i think 3d would be a wast of resources. have you looked at https://www.reddit.com/r/gamedev/comments/387pwc/rendering_3d_trails/ ? – nkazz Jan 21 '20 at 15:07
  • Thanks to all, I'll take a look to the link, but my problem is not the performance, I need the EXACT look as the image, beside the performance. – Lotan Jan 21 '20 at 20:18

1 Answers1

0

After some digging I found that UnifyCommunity has the answer with his TubeRenderer component: http://wiki.unity3d.com/index.php?title=TubeRenderer&oldid=17443

The only thing to know is that the script requires to add a mesh clearing after creating the new Mesh();

To achieve it type: mesh.Clear(); before assign vertices etc

Lotan
  • 4,078
  • 1
  • 12
  • 30