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

ZOffset

ParticleEmitter

float

The ZOffset property determines the forward-backward (Z) render position of particles, in studs. they render at a modified ParticleEmitter/Size such that this property will not affect the screen size of particles. When changed, this property will affects all particles, both current and future particles. Note that this property accepts fractional values; it is not like GuiObject/ZIndex (an integer)

Pictured below are three default ParticleEmitters with varying ZOffset values. The center is default, the left has +2 and the right has -2. Note how all the particles have the same apparent screen size.
Three default ParticleEmitters with varying ZOffset values

A practical use of ZOffset is for ParticleEmitters placed in players’ characters: use it to define if particles should appear in front of or behind the character (use a value of +/- 2).

Two identical Roblox characters with ParticleEmitters in their head, with varying ZOffset values

Positive values will move particles closer to the camera, and negative values move particles away. Sufficiently negative values can cause particles to render inside or behind the parent part.


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