PcoWSkbVqDnWTu_dm2ix
We use cookies on this site to enhance your user experience
Collapse Sidebar

Color

ParticleEmitter

ColorSequence

The Color property determines the color of all particles active in an emitter’s system. The color is applied to the ParticleEmitter/Texture when rendering, and uses the texture alpha along with the ParticleEmitter/Transparency. If a particle has a ParticleEmitter/LightEmission of greater than 0, darker colors will make particles appear more transparent. Below, two default ParticleEmitter are pictured, except the right emitter uses a Color from yellow to cyan.

Two default ParticleEmitters, except the right has a Color from Yellow to Cyan

Note that the default ParticleEmitter/Lifetime is 5 to 10 seconds, so some particles next to each other have small variations in color due to the variations in individual particle lifetime.

A particle’s present color is determined by linearly interpolating on this ColorSequence using the particle’s age and the particle’s total lifetime. For example, if a particle spawned 2 seconds ago and has a 4 second lifetime, the color will be whatever is 50% of the way through the DataType/ColorSequence.

Changing this property applies changes to all particles present in the system. This is because the color of a particle is determined using its present lifetime and this ColorSequence (the ColorSequence when the particle was emit is not stored on a per-particle basis).


Code Samples


Creating a Particle Emitter from Scratch

This rather lengthy code sample shows how every property of a ParticleEmitter can be set, including DataType/NumberRange, DataType/NumberSequence and DataType/ColorSequence properties. Below is how the ParticleEmitter should after every property is set. Try playing around with the different properties to customize how the effect looks!

The final product