TrailRenderer messing up sharp edges. Alternatives?

Hi,

when a Transform with TrailRenderer component makes sharp 90° turns, there is some problem with vertex flipping and the turn looks jagged (see image).

I considered using Vectrosity instead, but its lines do not look smaller when further away from the camera (there is no foreshortening). Another alternative may be to dynamically create a mesh in code, but I was wondering if there is an easier alternative.

Please let me know if you have an idea how to solve the problem of jagged edges!

You will get a sharp edge with a sudden change of angle like that, it makes sense. There is a vertex aligned one way and then suddenly you have a huge transition to the next one. If you want a smoother transition you will have to have a lot more vertices blending between the two angles ie a rounded edge.

Hey imaginaryhuman,

thanks for your reply! I am still not quite sure what is happening here with the vertices. Rounding the edges is an unpractical solution. Do you figure coding my own mesh in realtime would be a feasible solution? I have never done that before.

Hm, maybe you could use a particle system that spawns continuously particle with “trail” texture in the direction opposite to your game object, but speed of particle/lifetime of it is determined by base object velocity?