Reference API Roblox

Engine API

Website

Related

Reference API Roblox

ParticleEmitter2D

A special object that emits customizable 2D particles from a GuiObject.

This class is not browsable. It is not visible in Studio's object browser.
Tags: [NotBrowsable]

Member index 55

HistoryMember
744Acceleration: Vector2
749AlphaErosion: NumberSequence
749BaseWarpStrength: NumberSequence
744Blend: float
744Brightness: float
744Color: ColorSequence
749DetailContent: Content
749DetailEnabled: bool
749DetailRotSpeed: NumberRange
749DetailRotation: NumberRange
749DetailScrollSpeedX: NumberSequence
749DetailScrollSpeedY: NumberSequence
749DetailSize: NumberSequence
749DetailSquash: NumberSequence
749DetailWarpStrength: NumberSequence
744Drag: float
744EmissionAngle: float
744EmissionMode: ParticleEmitter2DEmissionMode
744EmissionOffset: Vector2
744EmissionSpread: Vector2
744Enabled: bool
744FlipbookBlendFrames: bool
744FlipbookFramerate: NumberRange
744FlipbookLayout: ParticleFlipbookLayout
744FlipbookMode: ParticleFlipbookMode
744FlipbookSizeX: int
744FlipbookSizeY: int
744FlipbookStartRandom: bool
744Lifetime: NumberRange
747LightInfluence: float
744LockedToParent: bool
744Rate: float
744RotSpeed: NumberRange
744Rotation: NumberRange
744Size: NumberSequence
744Speed: NumberRange
744SpreadAngle: float
744Squash: NumberSequence
744TextureContent: Content
744TimeScale: float
744Transparency: NumberSequence
749WarpContent: Content
749WarpEnabled: bool
749WarpRotSpeed: NumberRange
749WarpRotation: NumberRange
749WarpScrollSpeedX: NumberSequence
749WarpScrollSpeedY: NumberSequence
749WarpSize: NumberSequence
749WarpSquash: NumberSequence
744ZIndex: int
744Clear(): null
744Emit(particleCount: int = 16): null
744FastForward(numFrames: int): null
inherited from Instance
731Archivable: bool
731Capabilities: SecurityCapabilities
731IsInSandbox: bool
731Name: string
731Parent: Instance
731PredictionMode: PredictionMode
731Sandboxed: bool
731UniqueId: UniqueId
576AddTag(tag: string): null
573ClearAllChildren(): null
462Clone(): Instance
573Destroy(): null
486FindFirstAncestor(name: string): Instance
486FindFirstAncestorOfClass(className: string): Instance
486FindFirstAncestorWhichIsA(className: string): Instance
486FindFirstChild(name: string, recursive: bool = false): Instance
486FindFirstChildOfClass(className: string): Instance
486FindFirstChildWhichIsA(className: string, recursive: bool = false): Instance
486FindFirstDescendant(name: string): Instance
563GetActor(): Actor
486GetAttribute(attribute: string): Variant
462GetAttributeChangedSignal(attribute: string): RBXScriptSignal
631GetAttributes(): Dictionary
648GetChildren(): Instances
462GetDebugId(scopeLength: int = 4): string
707GetDescendants(): Instances
486GetFullName(): string
706GetStyled(name: string, selector: string?): Variant
657GetStyledPropertyChangedSignal(property: string): RBXScriptSignal
576GetTags(): Array
576HasTag(tag: string): bool
486IsAncestorOf(descendant: Instance): bool
486IsDescendantOf(ancestor: Instance): bool
664IsPropertyModified(property: string): bool
698QueryDescendants(selector: string): Instances
573Remove(): null
576RemoveTag(tag: string): null
664ResetPropertyToDefault(property: string): null
573SetAttribute(attribute: string, value: Variant): null
462WaitForChild(childName: string, timeOut: double): Instance
731children(): Instances
731clone(): Instance
731destroy(): null
731findFirstChild(name: string, recursive: bool = false): Instance
731getChildren(): Instances
731isDescendantOf(ancestor: Instance): bool
731remove(): null
462AncestryChanged(child: Instance, parent: Instance)
462AttributeChanged(attribute: string)
462ChildAdded(child: Instance)
462ChildRemoved(child: Instance)
462DescendantAdded(descendant: Instance)
462DescendantRemoving(descendant: Instance)
500Destroying()
657StyledPropertiesChanged()
731childAdded(child: Instance)
inherited from Object
731ClassName: string
731className: string
647GetPropertyChangedSignal(property: string): RBXScriptSignal
647IsA(className: string): bool
731isA(className: string): bool
647Changed(property: string)

Removed member index 1

HistoryMember
747LightEmission: float

Description

A ParticleEmitter2D is a special object that emits customizable 2D particles for use in UI. To emit and render particles, it must be parented to a GuiObject, such as within a ScreenGui, SurfaceGui, or BillboardGui. Particles spawn from the very top layer of the parent GuiObject, above its strokes and inset shadows.

Particles emit automatically when the emitter is Enabled with a non-zero Rate, or manually when the Emit method is called. By default, particles emit upward in the parent's local canvas direction. The parent's rotation is inherited and combined with EmissionAngle and SpreadAngle to vary the emission direction further. With a non-zero Speed, particles are set in motion in that direction.

Several properties, including Size, Speed, and Acceleration, are measured in offset units, the logical pixel offset component of a UDim2 and the same units used by GuiObject.Size and GuiBase2d.AbsoluteSize. This differs from EmissionOffset and EmissionSpread which are scalar fractions of the GuiObject parent's own size rather than fixed offset units.

During the Lifetime of the particles, they can change appearance according to the Color and Size. Their motion can change over time according to the Drag and Acceleration properties, and they can also move as their parent moves when they are LockedToParent.

History 58

Members 55

Acceleration

TypeDefault
Vector20, 0

The Acceleration property determines how the Speed of particles changes over their lifetime. It is defined using a Vector2 to determine the acceleration on the GuiObject parent's local X/Y canvas axes, measured in offset units per second squared. When changed, this property affects all particles emitted by the emitter, both current and future.

Acceleration will slow particles down if the vector points in the opposite direction in which they are emitted. Otherwise, it will speed them up.

History 1

AlphaErosion

TypeDefault
NumberSequence0 0 0 1 0 0
This property is not browsable. It is not visible in Studio's object browser.

History 1

Tags: [NotBrowsable]

BaseWarpStrength

TypeDefault
NumberSequence0 1 0 1 1 0
This property is not browsable. It is not visible in Studio's object browser.

History 1

Tags: [NotBrowsable]

Blend

TypeDefault
float0

The Blend property determines the blending of the TextureContent colors with the colors behind them, the same role LightEmission plays on ParticleEmitter. A value of 0 uses normal blending mode while a value of 1 uses additive blending. When changed, this property instantly affects all particles owned by the emitter, both current and future.

History 1

Brightness

TypeDefault
float1

The Brightness property scales the brightness of all active particles. Values above 1 can be used to make particles appear to glow brighter than fully opaque white.

History 1

Clear

Parameters (0)
No parameters.
Returns (1)
null

This method instantly clears all existing particles that have been emitted by the ParticleEmitter2D through its natural emission (non-zero Rate on an Enabled emitter) or via Emit().

History 1

Color

TypeDefault
ColorSequence0 1 1 1 0 1 1 1 1 0

The Color property determines the color of all active particles over their individual lifetimes. The color applies to the TextureContent when rendering and it uses the texture alpha along with the emitter's Transparency.

Changing this property affects all particles emitted by the emitter, both current and future.

When this property uses a gradient ColorSequence, a particle's present color is determined by linearly interpolating on the sequence using the particle's age and its 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 ColorSequence.

History 1

DetailContent

TypeDefault
Content
This property is not browsable. It is not visible in Studio's object browser.

History 1

Tags: [NotBrowsable]

DetailEnabled

TypeDefault
boolfalse
This property is not browsable. It is not visible in Studio's object browser.

History 1

Tags: [NotBrowsable]

DetailRotSpeed

TypeDefault
NumberRange0 0
This property is not browsable. It is not visible in Studio's object browser.

History 1

Tags: [NotBrowsable]

DetailRotation

TypeDefault
NumberRange0 0
This property is not browsable. It is not visible in Studio's object browser.

History 1

Tags: [NotBrowsable]

DetailScrollSpeedX

TypeDefault
NumberSequence0 0 0 1 0 0
This property is not browsable. It is not visible in Studio's object browser.

History 1

Tags: [NotBrowsable]

DetailScrollSpeedY

TypeDefault
NumberSequence0 0 0 1 0 0
This property is not browsable. It is not visible in Studio's object browser.

History 1

Tags: [NotBrowsable]

DetailSize

TypeDefault
NumberSequence0 1 0 1 1 0
This property is not browsable. It is not visible in Studio's object browser.

History 1

Tags: [NotBrowsable]

DetailSquash

TypeDefault
NumberSequence0 0 0 1 0 0
This property is not browsable. It is not visible in Studio's object browser.

History 1

Tags: [NotBrowsable]

DetailWarpStrength

TypeDefault
NumberSequence0 1 0 1 1 0
This property is not browsable. It is not visible in Studio's object browser.

History 1

Tags: [NotBrowsable]

Drag

TypeDefault
float0

The Drag property determines the rate in seconds at which individual particles will lose half their speed via exponential decay. Drag is applied by scaling the expected velocity from Speed. Setting this property to a negative value will cause particles' velocities to grow exponentially.

History 1

EmissionAngle

TypeDefault
float0

The EmissionAngle property determines the angle, in degrees, that particles are emitted towards within the plane of the parent GuiObject. This angle is combined with the parent's own rotation, so rotating the parent also rotates the emission direction. SpreadAngle further randomizes the emission direction around this angle.

History 1

EmissionMode

TypeDefault
ParticleEmitter2DEmissionModeBoundingBox

The EmissionMode property determines the region of the parent GuiObject that particles emit from. It can be any value of the ParticleEmitter2DEmissionMode enum:

EmissionSpread further adjusts the size of the point or bounding box emission region, and EmissionOffset shifts it from the GuiObject parent's center.

History 1

EmissionOffset

TypeDefault
Vector20, 0

The EmissionOffset property determines the scalar translation of the particle emission region from the center of the parent GuiObject. It is a scalar translation, meaning the actual pixel offset is determined by the AbsoluteSize of the parent GuiObject. For example, a value of (1, 0) shifts the emission region horizontally to the right by a distance equal to the parent object's size.

History 1

EmissionSpread

TypeDefault
Vector20, 0

The EmissionSpread property determines the size of the particle emission region, depending on EmissionMode:

  • For BoundingBox, it adds to the width and height of the GuiObject parent's bounding box.
  • For Point, it adds to the width and height of an ellipse centered on the emission point. A value of (0, 0) results in true point emission.

History 1

Emit

Parameters (1)Default
particleCountint16
Returns (1)
null

This method will cause the ParticleEmitter2D to instantly emit the given number of particles.

History 1

Enabled

TypeDefault
booltrue

The Enabled property determines if particles emit from the emitter. Setting this to false stops further particles from spawning, but any existing particles remain active until they expire. This property is useful when you have a pre-made particle effect that you want to remain disabled until you need it to emit particles.

If you want to clear all particles from a disabled emitter, call Clear(). Then, if desired, call Emit() on the emitter to emit and render particles.

History 1

FastForward

Parameters (1)
numFramesint
Returns (1)
null

History 1

FlipbookBlendFrames

TypeDefault
booltrue

The FlipbookBlendFrames property determines whether the frames in the flipbook texture are blended between using a linear crossfade, or swapped instantly.

History 1

FlipbookFramerate

TypeDefault
NumberRange1 1

The FlipbookFramerate property determines how fast the flipbook texture animates in frames per second. You can set a minimum and maximum range to randomize the framerate of the flipbook, with a maximum of 30 frames per second.

History 1

FlipbookLayout

TypeDefault
ParticleFlipbookLayoutNone

The FlipbookLayout property determines the layout of the texture. It can be any value of the ParticleFlipbookLayout enum:

  • None — Disable flipbook features and use the texture as a single static texture over the particle's lifetime.
  • Grid2x2 — 2×2 frames for a 4-frame animation.
  • Grid4x4 — 4×4 frames for a 16-frame animation.
  • Grid8x8 — 8×8 frames for a 64-frame animation.
  • Custom — A custom grid size defined by FlipbookSizeX and FlipbookSizeY.

History 1

FlipbookMode

TypeDefault
ParticleFlipbookModeLoop

The FlipbookMode property determines the type of the flipbook animation. It can be any value of the ParticleFlipbookMode enum:

  • Loop — Continuously play through all frames, starting back at the first frame after playing the last.
  • OneShot — Play through the animation only once across the particle's lifetime. With this setting, the FlipbookFramerate property doesn't apply; instead, the framerate is determined by the particle's Lifetime divided evenly by the number of frames in the animation.
  • PingPong — Play from the first to the last frame, then in reverse from the last to the first, repeating throughout the Lifetime of the particle.
  • Random — Play the frames in a random order, blending/crossfading from one frame to the next.

History 1

FlipbookSizeX

TypeDefault
int1

The FlipbookSizeX property defines the number of horizontal frames (columns) in a custom flipbook layout. This property only applies when FlipbookLayout is set to Custom.

History 1

FlipbookSizeY

TypeDefault
int1

The FlipbookSizeY property defines the number of vertical frames (rows) in a custom flipbook layout. This property only applies when FlipbookLayout is set to Custom.

History 1

FlipbookStartRandom

TypeDefault
boolfalse

The FlipbookStartRandom property determines whether each particle begins at a random frame of the animation instead of always starting at the first frame. One use case is to enable this property and also set FlipbookFramerate to zero, causing each emitted particle to be a static frame chosen randomly from the flipbook texture.

History 1

Lifetime

TypeDefault
NumberRange5 10

The Lifetime property defines the maximum and minimum ages for newly emitted particles. Lifetimes are stored on a per-particle basis, so if this value is changed, existing particles will stay active until their randomly chosen lifetime ends. A lifetime of 0 will prevent particles from emitting at all.

History 1

LightInfluence

TypeDefault
float0

The LightInfluence property determines how much environmental light affects the color of individual particles when they render, the same role LightInfluence plays on ParticleEmitter. At 0, particles are not influenced by light at all and they retain full brightness. At 1, particles are fully influenced by light (in complete darkness, particles will be black).

This property only has an effect when the emitter's parent GuiBase2d renders in world space on a SurfaceGui or a BillboardGui, excluding always-on-top. On an emitter in a ScreenGui, BillboardGui with AlwaysOnTop set to true, or SurfaceGui with ClassSurfaceGui.AlwaysOnTop|AlwaysOnTop set to true, LightInfluence has no visible effect.

History 1

LockedToParent

TypeDefault
boolfalse

The LockedToParent property determines if particles "stick" to the emission source, the parent GuiObject. If true, active particles will move in lock step if the parent object moves.

History 1

Rate

TypeDefault
float20

The Rate property determines how many particles are emitted per second while the emitter is Enabled. It is the inverse of frequency, meaning that a rate of 5 emits a particle every 0.2 seconds. When changed, this property has no effect on any active particles.

History 1

RotSpeed

TypeDefault
NumberRange0 0

The RotSpeed property determines a random range of angular speeds for newly emitted particles, measured in degrees per second. Positive values spin particles in the clockwise direction, the same convention used by Rotation. A random angular speed is chosen upon emission, so changing this property doesn't affect active particles. This property, along with Rotation, affects the angle of the rendered particle image.

History 1

Rotation

TypeDefault
NumberRange0 0

The Rotation property determines the range of rotations in degrees for newly emitted particles, measured in degrees. Positive values are in the clockwise direction. This property is commonly set to [0, 360] to provide a completely random rotation to new particles. RotSpeed also influences the rotation of a particle over its lifetime.

Changes to this value only affect new particles. Existing particles maintain the rotation at which they were originally emitted.

History 1

Size

TypeDefault
NumberSequence0 32 0 1 32 0

The Size property determines the size of all active particles, in offset units, over their individual lifetimes. The value represents the half size (center-to-edge distance) of the square TextureContent for each particle. For example, a Size of 100 renders a particle that is 200×200 offset units across. It is a NumberSequence that works similarly to Transparency.

A particle's present size is determined by linearly interpolating on this sequence using the particle's age and its total lifetime. For example, if a particle spawned 2 seconds ago and has a 4 second lifetime, the size will be whatever is 50% of the way through the NumberSequence. For any NumberSequenceKeypoint with a non-zero envelope value, a random value in the envelope range is chosen for each keypoint for each particle when it emits.

History 1

Speed

TypeDefault
NumberRange64 64

The Speed property determines a random range of velocities (minimum to maximum) at which new particles will emit, measured in offset units per second. Each particle's velocity is chosen upon emission and it applies in the direction determined by EmissionAngle. Negative values cause particles to travel in reverse.

Note that changing Speed does not affect active particles and they retain whatever speed they already have. However, Acceleration and Drag can be used to affect the speed of active particles over their lifetime.

History 1

SpreadAngle

TypeDefault
float0

The SpreadAngle property determines the random angle, in degrees, over which a particle may be emitted around EmissionAngle.

Setting this to 360 will cause particles to emit in all directions around the emission point or region.

History 1

Squash

TypeDefault
NumberSequence0 0 0 1 0 0

Allows for non-uniform scaling of particles, curve-controlled over their lifetime. Values greater than 0 cause particles to both shrink horizontally and grow vertically, while values less than 0 cause particles to both grow horizontally and shrink vertically.

History 1

TextureContent

TypeDefault
Content

The TextureContent property determines the image rendered on particles. Supports asset URIs. The appearance of the texture is influenced by Color, Transparency, Blend, and LightInfluence. Textures with transparent backgrounds work best for particles.

History 1

TimeScale

TypeDefault
float1

A value between 0 and 1 that controls the speed of the particle effect. At 1, it runs at normal speed; at 0.5 it runs at half speed; at 0 it freezes in time.

History 1

Transparency

TypeDefault
NumberSequence0 0 0 1 0 0

The Transparency property determines the transparency of all active particles over their individual lifetimes. It works similar to Size in how it affects particles over time. In terms of rendering, a value of 0 is completely visible (opaque) and a value of 1 is completely invisible.

A particle's present transparency is determined by linearly interpolating on this sequence using the particle's age and its total lifetime. For example, if a particle spawned 2 seconds ago and has a 4 second lifetime, the transparency will be whatever is 50% of the way through the NumberSequence. For any NumberSequenceKeypoint with a non-zero envelope value, a random value in the envelope range is chosen for each keypoint for each particle when it emits.

History 1

WarpContent

TypeDefault
Content
This property is not browsable. It is not visible in Studio's object browser.

History 1

Tags: [NotBrowsable]

WarpEnabled

TypeDefault
boolfalse
This property is not browsable. It is not visible in Studio's object browser.

History 1

Tags: [NotBrowsable]

WarpRotSpeed

TypeDefault
NumberRange0 0
This property is not browsable. It is not visible in Studio's object browser.

History 1

Tags: [NotBrowsable]

WarpRotation

TypeDefault
NumberRange0 0
This property is not browsable. It is not visible in Studio's object browser.

History 1

Tags: [NotBrowsable]

WarpScrollSpeedX

TypeDefault
NumberSequence0 0 0 1 0 0
This property is not browsable. It is not visible in Studio's object browser.

History 1

Tags: [NotBrowsable]

WarpScrollSpeedY

TypeDefault
NumberSequence0 0 0 1 0 0
This property is not browsable. It is not visible in Studio's object browser.

History 1

Tags: [NotBrowsable]

WarpSize

TypeDefault
NumberSequence0 1 0 1 1 0
This property is not browsable. It is not visible in Studio's object browser.

History 1

Tags: [NotBrowsable]

WarpSquash

TypeDefault
NumberSequence0 0 0 1 0 0
This property is not browsable. It is not visible in Studio's object browser.

History 1

Tags: [NotBrowsable]

ZIndex

TypeDefault
int1

The ZIndex property determines the render order of this emitter's particles relative to other ParticleEmitter2D objects parented to the same GuiObject. Higher values render on top of lower values, similar to GuiObject.ZIndex.

History 1

Removed members 1

LightEmission

TypeDefault
float0

History 2

Settings