Skip to content

Particles

System · Particles · server and client scripts

Particles provides one-shot particle spawning, the built-in Sparks preset, and platform texture ids. Control individual effects and emitters through their component views (Play, Stop, Emit, Clear). See particle effects for how to build them.

PlayAt

Function
PlayAt(source: Entity | SpawnInit, position: Vector3, lifetime: number?, options: PlayAtOptions?) -> Entity

PlayAt clones a particle template entity or spawns a SpawnInit table at a world position, plays it, and marks it Transient with a Lifetime so it is removed after its particles finish. Continuous emitters require a positive lifetime in seconds; one-shot bursts can omit lifetime. Pass an optional PlayAtOptions table with Rotation and Parent.

Example

-- Server script in a part: play built-in sparks for 2 seconds at the part.
local pos = self.Position
if pos then
    local sparks = Particles.PlayAt(Particles.Sparks, pos, 2)
    print(sparks.Name)
end

Sparks

PropertyRead only
Sparks: SpawnInit

Sparks is a SpawnInit preset table for a burst of sparks, suitable for Particles.PlayAt or World.Spawn.

Example

local fx = Particles.PlayAt(Particles.Sparks, Vector3.new(0, 4, 0), 1.5)

Textures

PropertyRead only
Textures: { read Spark: string, read FireLoop: string, read SmokePuff: string }

Textures is a table of built-in platform particle texture asset ids (Spark, FireLoop, SmokePuff).

Example

local sparks = World.Spawn({
    ParticleEmitter = {},
    ParticleSpawnOnce = { Count = NumberRange.new(24) },
    ParticleSprite = { Texture = Particles.Textures.Spark },
})