Using Particles

# Course Introduction

Particles refer to many small elements, such as snow, rain, and dust. You can control the properties and state via ParticleComponent. Let's learn more about the concept of particles and how to use particle components.

##### API Reference

[BaseParticleComponent](/apiReference/Components/BaseParticleComponent) [AreaParticleComponent](/apiReference/Components/AreaParticleComponent) [BasicParticleComponent](/apiReference/Components/BasicParticleComponent) [SpriteParticleComponent](/apiReference/Components/SpriteParticleComponent) [UIBaseParticleComponent](/apiReference/Components/UIBaseParticleComponent) [UIAreaParticleComponent](/apiReference/Components/UIAreaParticleComponent) [UIBasicParticleComponent](/apiReference/Components/UIBasicParticleComponent) [UISpriteParticleComponent](/apiReference/Components/UISpriteParticleComponent) [ParticleEmitEndEvent](/apiReference/Events/ParticleEmitEndEvent) [ParticleEmitStartEvent](/apiReference/Events/ParticleEmitStartEvent) [ParticleLoopEvent](/apiReference/Events/ParticleLoopEvent) [ParticleService](/apiReference/Service/ParticleService)

# Using Particles

The movements of various particles can be expressed using particles. [gif](166330355094795e601dda1164aac848ae79d1496e768)

There are 3 ways to use particles. The creator can use particles in the method of their choice.

[{"Place in Preset List":"In \u0001 Preset List - Particle Effect, place the particles you want in the \u0001 Scene.","Add particle component to entity":"Add a particle component to the \u0001 property of the entity to generate particles","Add from Workspace":"In \u0001 Workspace, select the particle model, and place it in the \u0001 Scene."},{"Place in Preset List":"[png](16606313000388e7d4aa6e5374d6196f17bf2166b1b3e)","Add particle component to entity":"[png](16606314685787f65edd3774b494cb32c9f285a4abdbc)","Add from Workspace":"[png](1660285664348a8db102a53b142f9b04a4e043ab2bb09)"}]

# Types of Particle Components

Particle components are largely classified for world and for UI, and there are 3 particles.

  * Particle Component for World: [BasicParticleComponent](/apiReference/Components/BasicParticleComponent), [SpriteParticleComponent](/apiReference/Components/SpriteParticleComponent), [AreaParticleComponent](/apiReference/Components/AreaParticleComponent)
  * Particle Component for UI: [UIBasicParticleComponent](/apiReference/Components/UIBasicParticleComponent), [UISpriteParticleComponent](/apiReference/Components/UISpriteParticleComponent), [UIAreaParticleComponent](/apiReference/Components/UIAreaParticleComponent)



## BasicParticleComponent

The [BasicParticleComponent](/apiReference/Components/BasicParticleComponent) is a component controls the general particles. [png](16633078865839e5488d2c3574197a38db8ff29c04719)

[{"Property":"ParticleType","Description":"Sets the type of particle to be generated.  Supported properties vary depending on the particle type."},{"Property":"Color","Description":"Corrects the color of the particles to be rendered.  [gif](1660286156819e905e8074a604e01800aa653fb244c1c)"},{"Property":"Loop","Description":"Sets whether to play particles repeatedly."},{"Property":"ParticleCount","Description":"Sets the number of particles.  [gif](16602820708290573d1ebd7634d4491632ef67088c0f5)"},{"Property":"ParticleLifeTime","Description":"Sets the duration of particles. [gif](1660282419952c9bc08a01b6040ae929a90ddb867fc96)"},{"Property":"ParticleSize","Description":"Sets the size of particles. [gif](16602825979965f0f3af7b4304a6a9d3f220a9f645128)  If you want to control the size of the entire particle, let's adjust the scale of TransformComponent."},{"Property":"ParticleSpeed","Description":"Sets the speed of particles. [gif](1660284180137e517a7338d2f4482ba095199640f0fc5)"},{"Property":"PlayOnEnable","Description":"Sets whether to play particles when the particle component is Enable. Whether to repeat after playing should be set through the Loop property."},{"Property":"PlaySpeed","Description":"Sets the play speed of particles. If PlaySpeed = 0, the particle will appear stopped. PlaySpeed does not support negative numbers. Negative numbers are treated the same as 0. [gif](166028475387470172905ee5b4714b327f18bf21dce0c)"},{"Property":"Prewarm","Description":"If set as Enable, the maximum number of particles is loaded, and the particles play naturally. From the moment the particle first starts playing, it will look natural as if the particle was already playing before that."},{"Property":"SortingLayer","Description":"When two or more entities overlap, the priority is determined according to the Sorting Layer."},{"Property":"OrderInLayer","Description":"It determines the priority within the same Layer. A greater number indicates higher priority."},{"Property":"IgnoreMapLayerCheck","Description":"It does not perform automatic replace when designating the Map Layer name to SortingLayer."},{"Property":"AutoRandomSeed","Description":"Sets whether to create a new random seed whenever particle emission begins."}]

## SpriteParticleComponent

The [SpriteParticleComponent](/apiReference/Components/SpriteParticleComponent) is a component generates particles via Sprite. For instance, if you set c4839de6b7be438abf008b5f547cbe98 in SpriteParticleComponent - SpriteRUID, the particles will be generated as heart-shaped sprites as below. [gif](1663309554383b08e07180d384167a62f7383bcd4710b) Let's look at the main properties.

[{"Property":"ApplySpriteColor","Description":"Sets whether the Color property is applied to the Sprite to be used by the particle. Even if the property is false, the transparency value of Color is applied."},{"Property":"SpriteRUID","Description":"Sets the SpriteRUID to be used as the particle."}]

## AreaParticleComponent

[AreaParticleComponent](/apiReference/Components/AreaParticleComponent) is a component that can set the particle's generation area. Even if the particle's generation area is changed, the same number of particles will be generated. When the ParticleCount is also increased with the particle's generation area, the particle density can be kept at previous levels, and if only the particle generation area is increased, then the particle density will decrease. Let's look at the main properties.

[{"Property":"Bounds","Description":"By pressing the Edit button, you can adjust AreaOffset and AreaSize in the Scene. When Editing, the visible rectangular bounds are the creation range, not the existence range of particles. Depending on the movement of the particle after creation, it may go out of the bounds of the rectangle.  [png](166027977616209fce41236a24051a06ec41c99c44699)"},{"Property":"AreaOffset","Description":"Sets the location of the centerpoint of the creation range relative to the entity."},{"Property":"AreaSize","Description":"Specifies the width and height of the particle creation range."}]

## UIBasicParticleComponent

[UIBasicParticleComponent](/apiReference/Components/UIBasicParticleComponent) is a component that controls normal particles. It can only be used in UI. Let's look at the main properties.

[{"Property":"ParticleType","Description":"Set the type of particle to generate.  The supported property changes based on the particle type."},{"Property":"Color","Description":"Corrects the color of the rednered particle."},{"Property":"LocalScale","Description":"The size of the particle."},{"Property":"PlaySpeed","Description":"Set the playing speed of the particle. If PlaySpeed = 0, the particle will look like it's paused. PlaySpeed doesn't support negative numbers, and negative numbers will be treated the same as 0."},{"Property":"ParticleSize","Description":"Set the particle size."},{"Property":"ParticleSpeed","Description":"Set the particle's speed."},{"Property":"ParticleCount","Description":"Set the number of particles."},{"Property":"ParticleLifeTime","Description":"Set the particle's duration."},{"Property":"PlayOnEnable","Description":"When particle component is set to Enable, whether the particle will be played can be set. Whether it repeats after playing can be set from the Loop property."},{"Property":"Loop","Description":"Set the particle's repeat play status."},{"Property":"Prewarm","Description":"When set to Enable, the max numer of particles is called and naturally plays the particle. It will look natural as if it was being played before the particle was even first played."},{"Property":"AutoRandomSeed","Description":"Set if the random seed will be newly created each time the particle is released."}]

## UIAreaParticleComponent

[UIAreaParticleComponent](/apiReference/Components/UIAreaParticleComponent) is a component that can set the particle's generation area in the UI. Even if the particle's generation area is changed, the same number of particles will be generated in that area. Let's look at the main properties.

[{"Property":"AreaSize","Description":"Sets the particle generation area."},{"Property":"AreaOffset","Description":"Set the center point of the generation area based on the Entity."}]

## UISpriteParticleComponent

[UISpriteParticleComponent](/apiReference/Components/UISpriteParticleComponent) is a component that creates particles using sprites in the UI.

[{"Property":"SpriteRUID","Description":"Sets the SpriteRUID that will be used as a particle."},{"Property":"ApplySpriteColor","Description":"Sets if the the Color property will be used in the Sprite that will be used by the particle. Even if the property is set as false, the Color's transparency value will be applied."},{"Property":"LocalScale","Description":"Sets the size of the particle."}]