Hello!
I’m a solo dev with a tech art background 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 could be manipulated, have force applied to it and so on. So I tried making one.
Turns out the more I played 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).
Without putting too much time into it since I wasn’t sure if this script would be of interest to anybody, I tried cleaning it up a bit and submitted it to the Asset Store. However, it got denied because it was “too simple for our current standards”.
So I decided to post it here instead hoping to get some feedback, and I might fix it up even more and try submitting it to the Asset Store once again.
Included in the package are some demos, and a couple of quickly done shaders to support them.
There’s also a brief documentation.
I tested importing the package into a 2019.2.14f1 project with Assets->Import Package->Custom Package… and that went well.
Any feedback, comments or questions are welcome
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. So it’s kind of a mix between a trail and a particle system in a way.
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
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: the flame is never above 28 verts)
This is how it ended up in the game (embedding didn’t work here, sorry)
Clicky: Imgur: The magic of the Internet
Thanks for reading!