- Home /
How to change the alpha of a spawned particle?
Hello,
I have some particles(space dust) that spawn from an emitter attached to the players space ship. I want the dust to give the player a sense of motion when the move their ship. What I'm looking for is to set the alpha of the particles based on the ships velocity.
So as the player slows down the particles fade away and as they speed up the particles become brighter.
This means changing the alpha value of particles that have been emitted.
Any help would be great. Thanks
Answer by anomalous_underdog · Jan 29, 2011 at 10:53 PM
Get the instance of the Particle Animator and edit ParticleAnimator.colorAnimation. Its an array of 5 colors. A color has an alpha value that goes from 0.0 to 1.0. With 1.0 being fully opaque.
Have the first color's alpha set to 0.0, the third and preceding colors' alpha set to 0.0.
When the velocity changes, store the ParticleAnimator.colorAnimation in a temporary variable, change the alpha of the second color depending on the ship's velocity, then assign the value back to ParticleAnimator.colorAnimation.
That's the basic idea.
Your answer
Follow this Question
Related Questions
All objects are getting transparent ? 1 Answer
Transparent brush overlap 'dotting' effect problem 1 Answer
Can't animate Material.Color properties 3 Answers
Trying to change the alpha on a particle system. 1 Answer
Using Colour over Lifetime with particles that have a Texture Sheet Animation 0 Answers