Hi There!

I am working on a 3D spaceship game using C#, and would like to make a nice engine trail behind my ship (as seen in many, if not all, games of this genre.

My coding skills are still at the level where I need to follow tutorials for most things, but now and again I can come up with things on my own. In this case, I am a bit lost.

In my current setup, after hours of digging and experimenting, I managed to figure out how to manipulate the properties of the RibbonTrailMesh and TubeTrailMesh by using Mesh.GetIndexed("segments") for example.

What I am trying to figure out now is how to manipulate the mesh to follow the ship around in a dynamic way (i.e. for the trail mesh sections to twist and bend as the ship moves). For the moment they just stick out of the ship as straight lines.

My only thoughts now would be to figure out how to do this either by:

  1. using a vertex shader that I can apply on the material of the trails, but my skills in that area are quite limited
  2. manipulating the individual vertices using the SurfaceTool (but I have no idea how to set them, beyond the fact that I can get them using Mesh.SurfaceGetArrays(0))
  3. some other means yet unknown to me

Does anyone have any advice?