Creating the satisfying 'swoosh' effect in Super Lucky's Tale
Hot on the...tail...of the recent Steam launch of Super Lucky's Tale, game dev Michael Voeller shares exactly how he created the game's satisfying "swoosh" effect.
Michael Voeller makes video games, real time visual effects, and tools, and is currently working on retro first-person shooter, Prodeus.
While working on Super Lucky's Tale, something that I thought was solved in a pretty cool way were the "swooshes." Swooshes are used for collecting coins, spawning certain enemies, and Lucky's tail swipe effect.
For this type of effect you want a fire and forget solution and you also want it to be super predictable. It should do the same thing every time and keep a consistent look over its lifetime.
An obvious approach may be to use a trail attached to an object that moved toward a target. There are a few issues that may arise with this approach though. If the target moves, the trail could end up having a funny shape, and it could also be difficult to figure out exactly when the swoosh will arrive at the target, which doesn't help with timing when to spawn things.
The best solution turned out being a mesh that was a strip of polygons with the beginning and end at 0,0,0 with a trail texture that scrolled across it. A script on the swoosh object informed the shader where the target was and the vertex shader moved the end of the swoosh over to the targets position. The script could also orient the mesh to face the target. This allowed for lots of variation in the shape of the swooshes and also guaranteed that the swoosh would reach the target exactly when it was supposed to and always have the intended shape.