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

Acceleration

ParticleEmitter

Vector3

The Acceleration property determines how particles ParticleEmitter/Speed changes over the particle’s lifetime. It is defined using a DataType/Vector3 to determine the acceleration on the global X/Y/Z axes. It is measured in studs per second squared. When changed, this property affects all particles emit by the emitter, both current and future particles.

Pictured below are two default ParticleEmitters. The foreground (right) emitter has an Acceleration on the positive-X axis, causing the path of the particles to bend in that direction.
An image of two default ParticleEmitters, wherein the foreground emitter has a +X Acceleration

Acceleration will slow particles down if the vector points in the opposite ParticleEmitter/EmissionDirection in which particles are emitted. Otherwise, it will speed them up. You can use ParticleEmitter/Drag to slow particles down no matter what direction they travel.

Acceleration is most often used to apply a gravity effect to particles (try a value of (0, -3, 0) for this). You can also use small values on the X/Z axes to make it look like particles are being blown away by wind. If you emit a bubble particle downwards, you could use an acceleration of (0, 5, 0) to cause the bubbles to decelerate and then float back upwards.


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