Skip to content

Particle Emitter API

Syntax-Sculptor edited this page Nov 24, 2026 · 3 revisions

ParticleEmitter

An individual Particle Emitter, which can be constructed through Palette:CreateParticleEmitter.

Methods

ParticleEmitter:AddSubEmitter(subEmitter, trigger, options)

Parameters

Parameter Type Description
subEmitter ParticleEmitter
trigger "Spawn" | "Death"
options SubEmitterOptions (optional)

Returns: nil

ParticleEmitter:Clear()

Deletes all of the particles spawned by the Particle Emitter.

Returns: nil

ParticleEmitter:Destroy()

Destroys the Particle Emitter. On deletion, all of its particles are cleared and the Particle Emitter can no longer be used.

Returns: nil

ParticleEmitter:Emit(count, positionOffset)

Manually spawns a set amount of particles. This works regardless of whether the Particle Emitter is continuously emitting particles or not. Does not spawn particles that would go over the emitter's cap defined by MaxParticles.

If the Particle Emitter is destroyed, an error will be thrown instead.

Parameters

Parameter Type Description
count integer The number of particles to spawn.
positionOffset Vector (optional)

Returns: nil

ParticleEmitter:FollowEntity(entity, followOffset)

Causes the Particle Emitter to have its position set to the provided entity's position every frame as long as the entity is alive.

Passing nil to the function will instead cause the Particle Emitter to stop following an entity.

Parameters

Parameter Type Description
entity Entity | nil The entity to follow.
followOffset Vector (optional)

Returns: nil

ParticleEmitter:GetFollowingEntity()

Returns the entity the Particle Emitter is following. Returns nil if it's following no entity.

Returns: Entity | nil

ParticleEmitter:GetParticleCount()

Returns: integer

ParticleEmitter:IsDestroyed()

Returns whether the Particle Emitter was destroyed.

Returns: boolean

ParticleEmitter:IsEmitting()

Returns whether the Particle Emitter is continuously emitting particles.

Returns: boolean

ParticleEmitter:IsFollowingEntity()

Returns whether the Particle Emitter is following an entity.

Returns: boolean

ParticleEmitter:IsPaused()

Returns: boolean

ParticleEmitter:IsPendingDestroy()

Returns: boolean

ParticleEmitter:IsPlaying()

Returns whether the Particle Emitter is continuously emitting particles or at least one particle belonging to it is alive.

Returns: boolean

ParticleEmitter:Pause()

Returns: nil

ParticleEmitter:Play()

Enables continuous particle emission.

Returns: nil

ParticleEmitter:Prewarm(frames)

Parameters

Parameter Type Description
frames integer (optional)

Returns: nil

ParticleEmitter:RemoveSubEmitter(subEmitter)

Parameters

Parameter Type Description
subEmitter ParticleEmitter

Returns: nil

ParticleEmitter:Restart()

Returns: nil

ParticleEmitter:Resume()

Returns: nil

ParticleEmitter:Stop()

Disables continuous particle emission.

Returns: nil

ParticleEmitter:Update()

Forces a Particle Emitter and its particles to update its logic one frame. Only used for niche situations.

Returns: nil

Properties

Property Type Default Description
AlignToVelocity AlignToVelocity -
Bursts PaletteBurst[] {}
ColorBySpeed ColorBySpeed -
ColorOverLifetime ColorOverLifetime - A reference to the Particle Emitter's ColorOverLifetime module, which handles how particle colors change over its lifespan.
DestroyOnFinish boolean false
DirectionSpread number 0 Determines how spread apart particles are relative to StartDirection, in degrees. The angle is between -DirectionSpread and +DirectionSpread.
Duration number 150
ForceOverLifetime ForceOverLifetime -
GravityModifier number | {Min: number, Max: number} 0
InheritVelocity InheritVelocity -
IsWorldSpace boolean true Whether particles are rendered using world coordinates or screen coordinates.
Lifetime integer | {Min: integer, Max: integer} 60 How many game update frames each particle is alive for before it's destroyed. 30 game update frames is equal to 1 second.
LimitVelocityOverLifetime LimitVelocityOverLifetime -
Looping boolean true
MaxParticles integer 100 The maximum amount of particles belonging to the Particle Emitter that can be alive. Additional particles from the Particle Emitter won't spawn while at that cap.
Noise Noise -
Orientation number 0 The orientation of the Particle Emitter, in degrees. Rotates the emission direction.
ParticleRate number 5 How many particles are spawned throughout one second (30 game update frames) while the Particle Emitter is continuously emitting particles.
PersistAcrossRooms boolean false Determines whether Particle Emitters are automatically destroyed when changing rooms or exiting a run.
Position Vector (0, 0) The position of the Particle Emitter.
RateOverDistance number 0
RenderMode RenderMode "AboveEntities"
RotationBySpeed RotationBySpeed -
RotationOverLifetime PaletteOverLifetime<number> - Controls particle rotation throughout its lifetime.
ScaleBySpeed ScaleBySpeed -
ScaleOverLifetime PaletteOverLifetime<Vector> - Controls particle size throughout its lifetime using multipliers.
Shader Shader | nil nil
ShaderParams table<string, number | number[]> {}
Shape Shape -
SpriteSheet SpriteSheet -
StartColor KColor | {Min: KColor, Max: KColor} KColor.White The initial color of the spawned particle.
StartDelay integer 0
StartDirection Vector (0, -1) The direction particles are spawned from relative to the Particle Emitter.
StartRotation number | {Min: number, Max: number} 0 The initial sprite rotation of the particle, in degrees.
StartScale Vector | {Min: Vector, Max: Vector} (1, 1) The initial size of particles when spawned. Acts as a scale multiplier to the particle's image file.
StartSpeed number | {Min: number, Max: number} 2 The initial speed of particles spawned.
VelocityOverLifetime VelocityOverLifetime - A reference to the Particle Emitter's VelocityOverLifetime module, which handles how the particle's velocity change over its lifespan.

Note

Certain properties, such as StartSpeed, Lifetime, StartColor, StartScale, and StartRotation, support randomized values using a { Min = ..., Max = ... } table. See Getting Started for an introduction to randomized particle properties.

Render Modes

RenderMode accepts the following values:

  • "Floor"
  • "BehindEntities"
  • "AboveEntities"
  • "AboveHUD"
  • "AbovePause"
  • "MainMenu"

Clone this wiki locally