I’m a solo dev making games with Unity. So far I’m making everything myself, including effects.
This script I’ve been working on started with me wanting better looking rocket flames in one of my games, and I decided to ditch using long stretchy particles, and started fiddling with mesh generation instead.
I felt Unity was missing a mesh trail that can be manipulated, have force applied to it and so on. So I tried making one.
Turns out the more I play with its settings and shaders the more effects I realize it could potentially be used for (I tried to showcase that in the video above).
The reason I’m posting this is to ask you fellow fx loving people if there is any interest in something like this, or if someone else like me felt it missing. I’m thinking of cleaning it up and putting it on the Asset Store, but that would require quite some time and effort.
Any comments or questions are welcome
It must be said that right now the mesh trail is very much 2D but that might change in the future.
To use it you simply add a script to a Game Object and it starts spitting out mesh.
Then you give it a material with a shader assigned to it and you’re good to go.
The script itself has properties a bit like a particle emitter, like life time and starting speed, but most of the tweaks and work is done in the shader.
Noteworthy features are:
- Editor previewing (play mode not required), this was important to me
- Useful data like lifetime left is sent to shader through vertex colors
- Optional world space force to every trail point, useful for faking gravity or wind
Well, that’s pretty much it. Here follow some gifs from development for anybody interested:
First thing was to make the emitter emit moving connected points with a limited lifetime
Then adding vertices to each point, also here red vertex color represented lifetime of each point
Start of material and UV work, also width expansion and randomness
Playing with shader, mesh still buggy (fun fact: it’s 28 verts)
This is how it ended up in the game
Hope you enjoyed reading!