Particles - trail effect

Is possible to create a trail effect (e.g as passenger airliner trail on the sky) in Corona particles system?

I’m using http://particle2dx.com to generate my particle emitter and trail effect is visible on particle2dx simulation window but not on Corona (when particle object is moving on the screen).

To simulate trail effect in particle2dx.com, after launch this site, simply click on “Radius” (to remove gravity) and drag visible particle - trail effect will be visible (on Corona when particle object is moving we can see only “moving plasma sphere”) .

Can you post code?

My particle (with emitter generated on particle2dx.com) is moving by x and y (manually or by transitions), so I don’t have nothing special in my code to post here.

Hi @info09,

Without seeing your actual particle setup or anything, we have to guess at what you’re trying to accomplish. If this particle effect is supposed to follow some object (I assume a flying object), then logically you should just have the emitter follow the object as it moves around the screen. Then, for its properties, there probably would not be any actual x/y/gravity movement on the particles, but instead, you just output particles and give them a certain lifespan before they fade out or disappear. This would cause a trail of particles to drift “behind” the object as it moved around the screen.

Take care,

Brent

Thank you Brent for your answer.

Particle should leave a long trail as a passenger airliner on the sky but not leaving (as on particledx2.com).

Below is my code (simplified).

local json = require( "json" ) local filePath = system.pathForFile( "particle.json" ) local f = io.open( filePath, "r" ) local fileData = f:read( "\*a" ) f:close() local emitter = json.decode( fileData ) local myEmitter = display.newEmitter( emitter ) myEmitter.x = 0;myEmitter.y = 0 transition.to(myEmitter,{time=3000,x=480,y=320}) ------------------------ particle.json: { "startColorAlpha": 1, "startParticleSizeVariance": 10, "startColorGreen": 0.4, "rotatePerSecond": 0, "radialAcceleration": 0, "yCoordFlipped": -1, "emitterType": 1, "blendFuncSource": 770 , "finishColorVarianceAlpha": 0, "rotationEnd": 0, "startColorVarianceBlue": 0.2, "rotatePerSecondVariance": 0, "particleLifespan": 1.1, "minRadius": 0, "configName": "fire", "tangentialAcceleration": 0, "rotationStart": 720, "startColorVarianceGreen": 0, "speed": 0, "minRadiusVariance": 0, "finishColorVarianceBlue": 0, "finishColorBlue": 0, "finishColorGreen": 0, "blendFuncDestination": 1, "finishColorAlpha": 1, "sourcePositionVariancex": 15, "startParticleSize": 111, "sourcePositionVariancey": -20, "startColorRed": 0.2, "finishColorVarianceRed": 0, "textureFileName": "particle\_smoke.png", "startColorVarianceAlpha": 0.1, "maxParticles": 289, "finishColorVarianceGreen": 0, "finishParticleSize": 40, "duration": -1, "startColorVarianceRed": 0, "finishColorRed": 0, "gravityx": 0, "maxRadiusVariance": 0, "finishParticleSizeVariance": 0, "gravityy": 0, "rotationEndVariance": 0, "startColorBlue": 0.69, "rotationStartVariance": 0, "speedVariance": 0, "radialAccelVariance": 0, "textureImageData": "", "tangentialAccelVariance": 0, "particleLifespanVariance": 0.4, "angleVariance": 50, "angle": -146, "maxRadius": 0 }

Hi @info09,

If you want the trail to remain “forever”, you should not allow the particles to die (“particleLifespan”). However, note that if particles remain on the screen forever, and you allow hundreds of them to be output, you may eventually crash the app with an overload of the particle system.

Brent

I’m tried different settings without any success. IMHO, when emitter display object is moving, Corona moving all emitter particles and create a trail effect is probably impossible. In this Unity game this effect is accomplished as it should be (smoke or dust trails):  

https://www.youtube.com/watch?v=XWe4VvQ4apM

Hi @info09,

Do you mean that your particle trail moves “in sync” with your emitter? If so, this is because you need to toggle the “Grouped/Relative” setting to the opposite of what you have now. See this tutorial on using Particle Designer (it’s very useful for other usage points too):

http://coronalabs.com/blog/2014/03/25/tutorial-using-particle-designer-in-corona/

Take care,

Brent

Thank you Brent, this is it!   :slight_smile:

Exactly this is “absolutePosition: true” emiter parameter, which was not generated on particledx2.com.

Can you post code?

My particle (with emitter generated on particle2dx.com) is moving by x and y (manually or by transitions), so I don’t have nothing special in my code to post here.

Hi @info09,

Without seeing your actual particle setup or anything, we have to guess at what you’re trying to accomplish. If this particle effect is supposed to follow some object (I assume a flying object), then logically you should just have the emitter follow the object as it moves around the screen. Then, for its properties, there probably would not be any actual x/y/gravity movement on the particles, but instead, you just output particles and give them a certain lifespan before they fade out or disappear. This would cause a trail of particles to drift “behind” the object as it moved around the screen.

Take care,

Brent

Thank you Brent for your answer.

Particle should leave a long trail as a passenger airliner on the sky but not leaving (as on particledx2.com).

Below is my code (simplified).

local json = require( "json" ) local filePath = system.pathForFile( "particle.json" ) local f = io.open( filePath, "r" ) local fileData = f:read( "\*a" ) f:close() local emitter = json.decode( fileData ) local myEmitter = display.newEmitter( emitter ) myEmitter.x = 0;myEmitter.y = 0 transition.to(myEmitter,{time=3000,x=480,y=320}) ------------------------ particle.json: { "startColorAlpha": 1, "startParticleSizeVariance": 10, "startColorGreen": 0.4, "rotatePerSecond": 0, "radialAcceleration": 0, "yCoordFlipped": -1, "emitterType": 1, "blendFuncSource": 770 , "finishColorVarianceAlpha": 0, "rotationEnd": 0, "startColorVarianceBlue": 0.2, "rotatePerSecondVariance": 0, "particleLifespan": 1.1, "minRadius": 0, "configName": "fire", "tangentialAcceleration": 0, "rotationStart": 720, "startColorVarianceGreen": 0, "speed": 0, "minRadiusVariance": 0, "finishColorVarianceBlue": 0, "finishColorBlue": 0, "finishColorGreen": 0, "blendFuncDestination": 1, "finishColorAlpha": 1, "sourcePositionVariancex": 15, "startParticleSize": 111, "sourcePositionVariancey": -20, "startColorRed": 0.2, "finishColorVarianceRed": 0, "textureFileName": "particle\_smoke.png", "startColorVarianceAlpha": 0.1, "maxParticles": 289, "finishColorVarianceGreen": 0, "finishParticleSize": 40, "duration": -1, "startColorVarianceRed": 0, "finishColorRed": 0, "gravityx": 0, "maxRadiusVariance": 0, "finishParticleSizeVariance": 0, "gravityy": 0, "rotationEndVariance": 0, "startColorBlue": 0.69, "rotationStartVariance": 0, "speedVariance": 0, "radialAccelVariance": 0, "textureImageData": "", "tangentialAccelVariance": 0, "particleLifespanVariance": 0.4, "angleVariance": 50, "angle": -146, "maxRadius": 0 }

Hi @info09,

If you want the trail to remain “forever”, you should not allow the particles to die (“particleLifespan”). However, note that if particles remain on the screen forever, and you allow hundreds of them to be output, you may eventually crash the app with an overload of the particle system.

Brent

I’m tried different settings without any success. IMHO, when emitter display object is moving, Corona moving all emitter particles and create a trail effect is probably impossible. In this Unity game this effect is accomplished as it should be (smoke or dust trails):  

https://www.youtube.com/watch?v=XWe4VvQ4apM

Hi @info09,

Do you mean that your particle trail moves “in sync” with your emitter? If so, this is because you need to toggle the “Grouped/Relative” setting to the opposite of what you have now. See this tutorial on using Particle Designer (it’s very useful for other usage points too):

http://coronalabs.com/blog/2014/03/25/tutorial-using-particle-designer-in-corona/

Take care,

Brent

Thank you Brent, this is it!   :slight_smile:

Exactly this is “absolutePosition: true” emiter parameter, which was not generated on particledx2.com.