Hyper Trails - customizable trail effect


Hyper Trails is easy to use and customizable trail effect for the Defold game engine.

Installation and usage

Using it in your 2D game is simple:

  1. Add .zip as a Defold library dependency.
  2. Copy trail_maker.script and trail_model.model from /hyper_trails/hyper_trail_16.go into your collection in your game object.
  3. Run your game and move the game object. Enjoy!

Sources and documentation

Example App

Play online - https://indiesoftby.github.io/defold-hyper-trails/


  • More examples
  • Support of variable dt
  • Interpolation using splines


I’d appreciate any feedback! I want to understand use cases and improve the extension.


Wow :smiley: it’s an amazing asset, must dive in, but I’m already astonished :smiley: Do you mind creating an asset page for this? :wink:


@Pawel Thanks! Yeah, I’ll add asset page a bit later.

Also I need help from the community and the Defold team. I tested the extension on a lot of devices, but on two cases, there are hurtful glitches that I don’t know how to fix.

  1. Two PCs with Windows 10 and Geforce GTX 1080 Ti, latest drivers. Trails shake in random occurrence. It looks as if the data texture is not immediately sent to the GPU (using resource.set_texture(path, table, buffer)), but in other frames: video. If you run it in your browser, it works properly. (because of DirectX via ANGLE, probably)

  2. Amazon Fire TV Stick (W87CUN). No uniform attributes sent (only in Hyper Trails demo app!) and so it looks like: photo.


Amazing work!! :smiley:

Would it be possible to publish a playable web example as well?

Regarding point 1 above, the jittery/shaking bug, could it possibly be due to some precision in the shaders?


OK, published web example.
Also added to the Asset Portal.


This is really cool.


Looks like it’s not. I’ve been trying to figure out the reason all week… But so far I’ve been unsuccessful. I’ll make a simple project to try to catch this bug on it.


Maybe added trail on and off feature could be good.


Great Asset!!


As an example, I replaced the trail effect :dizzy: in @britzl’s GB Rausers with Hyper Trails: play online, sources.


Hi, I downloaded from Github
but when I build it with Defold there are 2 errors:

  1. /assets/font/smallest_pixel-7.font
    The file ‘/assets/font/pixelfont.material’ could not be loaded.

  2. /game/player.collection
    The file ‘/assets/trail/trail.material’ could not be loaded.

Instead, when I build the original GB Rausers, there is no error.

Do you have any idea about the rerason?
Thanks, Marco

1 Like

@mrduneit, сan you please download the project and try to build it again? Because I checked it, set up the CI and the project builds fine.

1 Like

Now it works, thanks!


I have a question, when making trails for objects made out of a factory, how can I properly do it? right now I have a pre-existing object with a trail and whenever a new object with a trail gets created, both objects end up with the same trail.


Hyper Trails uses a texture as an array of data. So each trail_model instance should have its own texture…

When I try to implement a trail onto an object, the trail seems to offset from the object even when the location is centered on the object, and is quite thin. And increasing the width increases the offset it has.

I downloaded the demo from github and mulled over everything and I can’t find any differences between the demo and what I have aside from one. I’m currently using the orthographic camera asset, and I can only assume it has something to do with that. Does this sound like anything anyone has run into before?

So I switched to using Rendercam instead of the orthographic cam asset. This seems to have fixed the issue, however, I’d love to know what was causing the issue with orthographic cam as I feel like it would be a good learning point for me at the very least. Thanks!


Is there a way to render these trails on top of models?

Most likely add another material / render predicate tag / assign that to the trails you want to be above models / then draw that tag after models?

I actually meant drawn in the same pass as the current models, so could (in theory) pass “through” a model. I guess they’re drawn in a magical way now, because they always end up underneath the models in the game.