ParticleEmitter

ParticleEmitter : Instance

Overview

The ParticleEmitter class is used to create and control particle effects, which are essential for adding visual flair and dynamic elements to games.

Description

Particle emitters are a Lua class designed to manage particle emitters and their behavior within a game environment. This class inherits properties from its higher class, instances. The main role of this class is to create and control particle effects, manipulate individual particle characteristics, and interact with other game components to create dynamic visual representations, such as explosions or smoke.

Properties

Acceleration

Vector3

Acceleration is used to control the acceleration of emitted particles.

Code Samples

local ParticleEmitter = script.Parent

ParticleEmitter.Acceleration = Vector3.new(0, 500, 0)

Brightness

number

Brightness determines how bright the particles look when visualized.

Code Samples

//NotWork//

Color

ColorSequence

Color is a property of type ColorSequence in the ParticleEmitter class. ColorSequence defines a sequence of colors that can vary over the lifetime of particles

Code Samples

//NotWork//

Drag

number

Drag represents a scalar value that determines how particles lose their speed through exponential decay over time. This property influences the motion and behavior of emitted particles, affecting how quickly they slow down or dissipate.

Code Samples

local ParticleEmitter = script.Parent

ParticleEmitter.Drag = 0.5

Enabled

bool

The Enabled property enables or disables the emission of particles depending on its boolean value (true or false).

Code Samples

local ParticleEmitter = script.Parent

ParticleEmitter.Enabled = false

EmissionDirection

Enum.NormalId

This property can be set to control the distribution of particles emitted from the emitter.

Code Samples

local ParticleEmitter = script.Parent

ParticleEmitter.EmissionDirection = Enum.NormalId.Right

FlipbookFramerate

NumberRange

Flipbook Framerate controls the frame rate range of animated flipbook textures used by particles. This property allows the user to adjust the animation rate of flipbook textures according to the range values defined for each particle effect.

Code Samples

//NotWork//

FlipbookLayout

Enum.ParticleFlipbookLayout

Enum.ParticleFlipbookLayout

It's associated with an enum type named Enum.ParticleFlipbookLayout that determines the layout of animation frames within a flipbook texture used during particle emission. This property can be set to various options such as None, Grid2x2, Grid4x4, and Grid8x8. The chosen value will affect the arrangement and display of animation frames as particles are emitted in the system.

Code Samples

local ParticleEmitter = script.Parent

print(ParticleEmitter.FlipbookLayout)

FlipbookMode

Enum.ParticleFlipbookMode

FlipbookMode determines how particles transition through their texture frames. This property allows users to select between different modes like Loop, OneShot, PingPong, or Random to control the animation behavior and visual appearance of the particle system

Code Samples

local ParticleEmitter = script.Parent

print(ParticleEmitter.FlipbookMode)

FlipbookStartRandom

bool

It determines whether flipbook animations start randomly or follow a specific pattern when using the FlipbookMode property.

Code Samples




### LifeTime 
`NumberRange`

The LifeTime property allows you to assign an arbitrary age range to newly released particles.

#### Code Samples
``` Lua
//NotWork//

LightEmission

number

LightEmission controls how much particles' colors blend with the colors behind them.

Code Samples

local ParticleEmitter = script.Parent

ParticleEmitter.LightEmission = 0.5

Orientation

Enum.ParticleOrientation

The "Orientation" property determines orientarion of paticles.

Code Samples

local ParticleEmitter = script.Parent

print(ParticleEmitter.Orientation)

Rate

number

Determines the number of particles emitted per second.

Code Samples

local ParticleEmitter = script.Parent

ParticleEmitter.Rate = 20

RotSpeed

number

Determines the rate at which the emitted particles rotate.

Code Samples

local ParticleEmitter = script.Parent

ParticleEmitter.RotSpeed = 3

Rotation

NumberRange

Specifies the range of rotation of the emitted particles.

Code Samples

local ParticleEmitter = script.Parent

print(ParticleEmitter.Rotation)

Shape

Enum.ParticleEmitterShape

It represents the desired shape for particle emission, allowing developers to select from various options such as box, sphere, cylinder, or disc.

Code Samples

local ParticleEmitter = script.Parent

print(ParticleEmitter.Shape)

ShapeInOut

Enum.ParticleEmitterShapeInOut

ShapeInOut determines how particles are emitted from the emitter shape based on three possible settings - outward only, inward only, or both directions simultaneously.

Code Samples

local ParticleEmitter = script.Parent

print(ParticleEmitter.ShapeInOut)

ShapeStyle

Enum.ParticleEmitterShapeStyle

ShapeStyle determines whether particles are emitted volumetrically or only on its surface.

Code Samples

local ParticleEmitter = script.Parent

print(ParticleEmitter.ShapeStyle)

Size

NumberSequence

Determines the size of the emitted particles. It is specified in Number Sequence form and can determine how the size changes over time.

Code Samples

//NotWork//

Speed

NumberRange

Specifies the rate at which the particles are emitted. NumberRange type, which allows you to specify the range of the rate at which particles are emitted.

Code Samples

//NotWork//

SpreadAngle

number

This property determines a random range of velocities or angles at which new particles are emitted.

Code Samples

//NotWork//

Squash

NumberSequence

The Squash property uses NumberSequence data type, which is a sequence of numbers that can be controlled using curve data to allow non-uniform scaling of individual particles over time.

Code Samples

//NotWork//

Texture

string

It represents an image or texture used for Particle effects

Code Samples

local ParticleEmitter = script.Parent

print(ParticleEmitter.Texture)

Transparency

NumberSequence

Transparency property is implemented using NumberSequence, which represents a sequence of numbers that can be used to control the transparency or opacity of particles over their individual lifetimes.

Code Samples

//NotWork//

TextureContent

Content

Content serves as an interface for managing content related to textures used for particle effects.

Code Samples

//NotWork//

Methods

Clear

The Clear is used to clear all particles.

Parameters

Return

void

Code Samples

Emit

The Emit method generates and emits a specified number of particles.

Parameters

number particleCount

Return

void

Code Samples

//NotWork//

Events