Hi, I don't really have the time or energy to explain everything in details, so here is the file:
JS Only
Alternative With Events (the JS code is still in there, but disabled)
Basically, I keep track of the N last positions and angles the trail was in, and I update the mesh from left to right to be a the last positions one by one.
I also use polar coordinates to compute the width of the trail.
You can control the trail head's position, the start width, the end width, and the trail's current rotation (currently, the rotation is automatically computed as "look at where you're going")
Here's a video of how it works
Please do note that:
- It uses a sprite for the trail, so the trail can be textured
- It uses the mesh feature, so it'll need a version of C3 that got released after the mesh features started getting released
- I used JS to make it as performant as possible, but it can be remade using events, it's not particularly hard (or especially less performant from my testing)
- The trail doesn't suck and it's turbo blazingly fast.
thank you have a nice day happy christmas xx
EDIT: A few people asked, and I have updated the example with an alternative system written in Events entirely
All you need to do to switch from one to the other is to enable/disabled the groups. Performance wise, JS seems to be more performant the more you add trails on screen.