Reference API Roblox

Engine API

Website

Related

Reference API Roblox

Sparkles

A particle emitter with the visual aesthetic of sparkles.

Member index 6

HistoryMember
553Enabled: bool
553SparkleColor: Color3
553TimeScale: float
573FastForward(numFrames: int): null
inherited from Instance
553Archivable: bool
635Capabilities: SecurityCapabilities
553Name: string
553Parent: Instance
635Sandboxed: bool
616UniqueId: UniqueId
576AddTag(tag: string): null
573ClearAllChildren(): null
462Clone(): Instance
573Destroy(): null
486FindFirstAncestor(name: string): Instance
486FindFirstAncestorOfClass(className: string): Instance
486FindFirstAncestorWhichIsA(className: string): Instance
486FindFirstChild(name: string, recursive: bool = false): Instance
486FindFirstChildOfClass(className: string): Instance
486FindFirstChildWhichIsA(className: string, recursive: bool = false): Instance
486FindFirstDescendant(name: string): Instance
563GetActor(): Actor
486GetAttribute(attribute: string): Variant
462GetAttributeChangedSignal(attribute: string): RBXScriptSignal
631GetAttributes(): Dictionary
648GetChildren(): Instances
462GetDebugId(scopeLength: int = 4): string
486GetDescendants(): Array
486GetFullName(): string
641GetStyled(name: string): Variant
576GetTags(): Array
576HasTag(tag: string): bool
486IsAncestorOf(descendant: Instance): bool
486IsDescendantOf(ancestor: Instance): bool
580IsPropertyModified(name: string): bool
573Remove(): null
576RemoveTag(tag: string): null
580ResetPropertyToDefault(name: string): null
573SetAttribute(attribute: string, value: Variant): null
462WaitForChild(childName: string, timeOut: double): Instance
648children(): Instances
553clone(): Instance
573destroy(): null
553findFirstChild(name: string, recursive: bool = false): Instance
648getChildren(): Instances
553isDescendantOf(ancestor: Instance): bool
573remove(): null
462AncestryChanged(child: Instance, parent: Instance)
462AttributeChanged(attribute: string)
462ChildAdded(child: Instance)
462ChildRemoved(child: Instance)
462DescendantAdded(descendant: Instance)
462DescendantRemoving(descendant: Instance)
500Destroying()
553childAdded(child: Instance)
inherited from Object
647ClassName: string
647className: string
647GetPropertyChangedSignal(property: string): RBXScriptSignal
647IsA(className: string): bool
650isA(className: string): bool
647Changed(property: string)

Description

Sparkles is one of several particle-emitting classes. Like other particle emitters of its kind, Sparkles objects emit particles when parented to a BasePart (such as a Part) or an Attachment within such a BasePart. Compared to the ParticleEmitter class, Sparkles lacks many different customization properties and special methods, such as ParticleEmitter.Lifetime or ParticleEmitter:Emit(). It is useful to create a quick special effect in a pinch; for more detailed work it is preferable to use a ParticleEmitter instead.

When Sparkles.Enabled is toggled off, particles emit by this object will continue to render until their lifetime expires. When a Sparkles object's Instance.Parent is set to nil (and/or Instance:Destroy()ed), all particles will instantly disappear. If this effect is not desired, try hiding the parent object at a far away position, then removing the Sparkles after a few seconds using Debris to give the last particles a chance to expire. This object does not have a ParticleEmitter:Clear() method, but it is possible to set the Instance.Parent to nil and back to the exact same object for the same effect.

Sparkles particles are only emitted from the center of BasePart to which they are parented. Parenting a Sparkles object to an Attachment instead allows customization of the particles' start position.

History 18

Members 6

Enabled

TypeDefault
booltrue

The Enabled property, much like ParticleEmitter.Enabled, determines whether sparkle particles are emit. Any particles already emit will continue to render until their lifetime expires. This property is useful for keeping pre-made sparkle effects off until they are needed later. Since sparkle particles are destroyed when the Sparkle object's Instance.Parent is set to nil, this property is useful in allowing existing particles the opportunity to expire before destroying the Fire object altogether. See the function below.

local Debris = game:GetService("Debris")
local part = script.Parent
function stopSparkling(sparkles)
	sparkles.Enabled = false -- No more new particles
	Debris:AddItem(sparkles, 4) -- Remove the object after a delay (after existing particles have expired)
end
stopSparkling(part.Sparkles)

History 4

FastForward

Parameters (1)
numFramesint
Returns (1)
null

History 2

SparkleColor

TypeDefault
Color30.564706, 0.0980392, 1

This property functions identically to Sparkles.Color.

The SparkleColor property determines the color of all the particles emit by a Sparkles object (both existing and future particles). It behaves similarly to ParticleEmitter.Color, except that it is only one color and not a ColorSequence. Sparkles have a natural color sequence applied which is most apparent when this property is set to white; sparkles very faintly animate between a subtle green and red.

It should be noted that sparkles have a partial ParticleEmitter.LightEmission effect, so dark colors tend to render more transparent and white colors look very bright.

History 4

TimeScale

TypeDefault
float1

History 2

Settings