The color of a particle can be set here to change according to its speed in distance units per second.
This module is part of the Particle SystemA component that simulates fluid entities such as liquids, clouds and flames by generating and animating large numbers of small 2D images in the scene. More info
See in Glossary component. When you create a new Particle System GameObjectThe fundamental object in Unity scenes, which can represent characters, props, scenery, cameras, waypoints, and more. A GameObject’s functionality is defined by the Components attached to it. More info
See in Glossary, or add a Particle System component to an exiting GameObject, Unity adds the Color by Speed module to the Particle System. By default, Unity disables this module. To create a new Particle System and enable this module:
Since this module is part of the Particle System component, you access it through the ParticleSystem class. For information on how to access it and change values at runtime, see the Color by Speed module API documentation.
For some properties in this section, you can use different modes to set their value. For information on the modes you can use, see Varying properties over time.
Property | Function |
---|---|
Color | The color gradient of a particle defined over a speed range. |
Speed Range | The low and high ends of the speed range to which the color gradient is mapped (speeds outside the range will map to the end points of the gradient). |
Burning or glowing particles (such as sparks) tend to burn more brightly when they move quickly through the air (for example, when sparks are exposed to more oxygen), but then dim slightly as they slow down. To simulate this, you might use Color By Speed with a gradient that has white at the upper end of the speed range, and red at the lower end (in the spark example, faster particles will appear white while slower particles are red).