Collapse Sidebar




The Size property determines the world size in studs of all active particles over their individual lifetimes. This property represents the dimensions of the square ParticleEmitter/Texture for each particle. It is a DataType/NumberSequence that works similar to ParticleEmitter/Transparency and ParticleEmitter/Color.

Below is an animation of two default ParticleEmitter where the right one has a Size of 0 to 2. Note how the particles grow over their lifetime.
Animation of two default ParticleEmitters; the right one has a Size of 0 to 2

A particle’s present size is determined by linearly interpolating on this NumberSequence using the particle’s age and the particle’s 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 DataType/NumberSequence. For any DataType/NumberSequenceKeypoint with a nonzero envelop value, a random value in the envelop range is chosen for each keypoint for each particle when it spawns.

Changing this property applies changes to all particles present in the system. This is because the size of a particle is determined using its present lifetime and this NumberSequence (the Size at the time the particle was emit is not stored on a per-particle basis).

Design Note

When designing particle effects, size is probably the most important of all properties. Too large or too subtle can ruin a particle effect! The first thing you should do is decide how you want particles to enter and exit view - fade in/out, or grow/shrink from size 0? The choice is yours - start with a size NumberSequence from 0 to 3 or the reverse and go from there.

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

local emitter = Instance.new("ParticleEmitter")
-- Number of particles = Rate * Lifetime
emitter.Rate = 5 -- Particles per second
emitter.Lifetime = NumberRange.new(1,1) -- How long the particles should be alive (min, max)
emitter.Enabled = true 

-- Visual properties
emitter.Texture = "rbxassetid://1266170131" -- A transparent image of a white ring
-- For Color, build a ColorSequence using ColorSequenceKeypoint
local colorKeypoints = {
	-- API: ColorSequenceKeypoint.new(time, color)
	ColorSequenceKeypoint.new( 0, Color3.new(1, 1, 1)),  -- At t=0, White
	ColorSequenceKeypoint.new(.5, Color3.new(1, .5, 0)), -- At t=.5, Orange
	ColorSequenceKeypoint.new( 1, Color3.new(1, 0, 0))   -- At t=1, Red
emitter.Color = ColorSequence.new(colorKeypoints)
local numberKeypoints = {
	-- API: NumberSequenceKeypoint.new(time, size, envelop)
	NumberSequenceKeypoint.new( 0, 1);    -- At t=0, fully transparent
	NumberSequenceKeypoint.new(.1, 0);    -- At t=.1, fully opaque
	NumberSequenceKeypoint.new(.5, .25);  -- At t=.5, mostly opaque
	NumberSequenceKeypoint.new( 1, 1);    -- At t=1, fully transparent
emitter.Transparency = NumberSequence.new(numberKeypoints)
emitter.LightEmission = 1 -- When particles overlap, multiply their color to be brighter
emitter.LightInfluence = 0 -- Don't be affected by world lighting

-- Speed properties
emitter.EmissionDirection = Enum.NormalId.Front -- Emit forwards
emitter.Speed = NumberRange.new(0, 0) -- Speed of zero
emitter.Drag = 0 -- Apply no drag to particle motion
emitter.VelocitySpread = NumberRange.new(0, 0)
emitter.VelocityInheritance = 0 -- Don't inherit parent velocity
emitter.Acceleration = Vector3.new(0, 0, 0)
emitter.LockedToPart = false -- Don't lock the particles to the parent 
emitter.SpreadAngle = Vector2.new(0,0) -- No spread angle on either axis

-- Simulation properties
local numberKeypoints2 = {
	NumberSequenceKeypoint.new(0, 0);  -- At t=0, size of 0
	NumberSequenceKeypoint.new(1, 10); -- At t=1, size of 10
emitter.Size = NumberSequence.new(numberKeypoints2)
emitter.ZOffset = -1 -- Render slightly behind the actual position
emitter.Rotation = NumberRange.new(0, 360) -- Start at random rotation
emitter.RotSpeed = NumberRange.new(0) -- Do not rotate during simulation

-- Create an attachment so particles emit from the exact same spot (concentric rings)
local attachment = Instance.new("Attachment", script.Parent)
attachment.Position = Vector3.new(0, 5, 0) -- Move the attachment upwards a little
emitter.Parent = attachment