Did somebody something like this or do you have an idea how I could achieve something similar? Can that be done wit particle system? I guess not or I don’t know how or what particle shape I should use.
You could do this using Particle Emitters if you attach them to your moving object. If you call .setInWorldSpace(true) on the emitter, then the particles will stay where they are, leaving a trail. This is how I do all of the basic trails for spells with my game. You could even use the default grayscale effect image for smoke that’s included with the engine to test it out: Effects/Explosion/smoketrail.png
Not really. You could probably fake it a little if you did a particle emitter that emits world position particles and had a circle texture on it. You would have to emit a lot of particles though and you could go through weird periods where you would move to fast and there would be gaps.
Yeah the particle emitter isn’t necessarily the best way to go for every effect, although I’ve found you can use them for pretty much anything and sometimes it will look good, other times it won’t cut it.
The best way I’ve been able to combat the issue you mentioned is by drastically increasing the amount of particles on the emitter, and make sure the values you set to the 'lowlife, ‘highlife’, and ‘particles per second’ don’t cause the emitter to use up all of its particles before the old ones disappear. But still particle emitters can appear more imperfect depending on the specifics of the effect your’e going for.
The cinematics area of the engine provides a useful demonstration of what you see. It is for the spatials n stuff but the math is there. You give it waypoints and it will calculate the kind of curvy line you are looking for. I guess you just throw a bit of gentle noise in the width of that line and maybe even the texture.
Ok it makes a curve with a spline, but I guess I have to update that curve ever frame (or so) with a new way point. So I guess have to create a custom mesh or the like to achieve this. Or I don’t see how I could use MotionPath for that, maybe how the curve is done (the math from there).
Not only that, I have to remove the oldest segment (after a while, after given number of way points).
But I slowly start to have an idea to do it, at least some points are now clearer for me, like how to make a curve and not a blocky line.
There is a waypoint listener. When a waypoint is reached and it has reached your limit, say 20 points, remove the first point in a FIFO fashion and add the next. Also, there is a debug shape you can use to work out the geometry side.
Edit: as Paul mentioned, you can actually work out a few short cuts to the procedure and optimize it better as you achieve the desired effect.