Is it possible to control a particles lifetime(duration) by distance rather than time using code

I am working on a couple of vehicle trails for a mobile game.I have to cracking my head trying to limit the lifetime of smoke trails.I would like to know if it is possible to control the lifetime based on distance rather than time.By code.It will greatly help my progress.

Cheers

Have you looked into the Trail Renderer? It sounds like it’s designed to do exactly what you’re trying to achieve with particles.