Skip to content

PartEmitter

PartEmitter is the primary class of the module, giving access to the basic high-level functionality of the system. PartEmitter will be returned from require(PartEmitter).



Creating a new PartEmitter


PartEmitter PartEmitter.new()

Creates a new PartEmitter, which represents a single ParticleEmitter from a single source.

Important

PartEmitters are disabled and their Parent property is set to nil by default. Enabling the emitter with PartEmitter.Enabled = true and setting its parent to a BasePart with PartEmitter.Parent = Part is required for particles to be shown. More about properties below.



Properties


string UUID

A unique identifier for this PartEmitter.


boolean IsRigidBody = false

If true, particles emitted will act like regular unanchored BaseParts.

Overrides property

This property overrides the Acceleration property.

Warning

Emitting a large number of rigid body particles may severely affect performance.


string CollisionGroup

The name of the collision group the Particles generated by the PartEmitter should use. If nil, Particles will use the global default collision group.


integer MaxEmissionsPerHearbeat = 1

Maximum number of Particles the PartEmitter is allowed to emit in a single Heartbeat.

Warning

Setting this and the Rate property high enough may cause severe lag.


Instance Parent

Where the Particles will be emitted from.

Important

Particles will only be emitted if Parent is a BasePart.


Instance (ParticleContainer)

An optional container object for the Particles. If nil, Parent will be used.


float LastEmission

Time when the latest Particle was emitted.

Important

Manually emitting Particles by calling PartEmitter:Emit() will not update this value.


RBXScriptConnection HeartbeatConnection

This PartEmitter's connection to the Heartbeat event. Used for repeatedly emitting new particles when Enabled is true and Parent is a BasePart.


Inherited from ParticleEmitter:

boolean Enabled

float Brightness

ColorSequence Color

float LightEmission

float LightInfluence

ParticleOrientation ParticleOrientation

NumberSequence Size

NumberSequence Squash

string Texture

NumberSequence Transparency

float ZOffset

Note

ZOffset is ignored by the Particle's collision box.

NormalId EmissionDirection

NumberRange Lifetime

float Rate

NumberRange Rotation

NumberRange RotSpeed

NumberRange Speed

Missing Feature

Support for SpreadAngle has not yet been implemented in the module.

ParticleEmitterShape Shape

Partial Support

Currently only Box and Sphere are supported.

ParticleEmitterShapeInOut ShapeInOut

ShapeStyle ShapeStyle

Vector3 Acceleration


Inherited from BasePart:

PartType PartType

boolean CanCollide = false

Important

If IsRigidBody is false, Particles can still move through solid objects even with CanCollide enabled.

boolean CanTouch = false

boolean CanQuery = false



Methods


void LoadPropertiesFromParticleEmitter(ParticleEmitter particleEmitter, boolean setParent?)

Sets the PartEmitter's properties to match those of the given ParticleEmitter. If setParent is true, the PartEmitter's Parent property will be set to the Parent of the given ParticleEmitter.


void Emit(integer emitCount? = 1)

Emits the given number of Particles. Uses the default value 1 if no emitCount is given.


void Clear()

Clears all Particles the PartEmitter still has.


void Destroy()

Clears the PartEmitter's Particles and removes the PartEmitter.



Events


RBXScriptSignal ParticleAdded(Particle particle)

This event fires when a new Particle is created by the PartEmitter. The returned newParticle is the Particle object that was created.


RBXScriptSignal ParticleRemoving(Particle particle)

This event fires when a Particle originally created by the PartEmitter is going to be destroyed. The returned value is the Particle that's being removed.


RBXScriptSignal Destroying()

This event fires when the PartEmitter's Destroy method is called.