Creating Speed Lines with Particle System

I’m trying to create speed lines using the particle system, a common effect in games when a character is moving or running very fast. In the YouTube video below, the creator demonstrates how to generate particles fixed relative to the camera, achieving the desired speed line effect. However, I haven’t been able to replicate this behavior in Babylon.js.

I’m sharing my attempt with a playground demo. The issue I’m facing is that when I move or rotate the camera, the shape or view of the particles changes, but it shouldn’t—the particles should remain consistent regardless of the camera’s movement.

Any advice or suggestions on how to achieve this effect?

Youtube speed line: https://www.youtube.com/watch?v=D7CIz2SHQXs
My Playground: https://playground.babylonjs.com/#VNNEFX#1

I’m also fairly new to Babylon so anyone feel free to correct me, but you may have to use a 2nd camera for the particles then point them to a renderTextureTarget, then lock the renderTextureTarget to your main camera facing position.

1 Like

I think I found the solution, only changed min and max life times to 0. At least I got the desired outcome :slight_smile:

particleSystem.minLifeTime = 0;
particleSystem.maxLifeTime = 0;

Here is the updated demo: https://playground.babylonjs.com/#VNNEFX#2

5 Likes

Additionally, you can experiment with the camera.fov parameter and, to enhance the effect, animate the field of view from 70 to 120 for increased speed on start and decrease on slowdown.

1 Like