1.
Preparation
This is the effect we are going to make in this tutorial.
Note: The main content of this tutorial comes from the Content Examples
that come with Unreal Engine
Tip: Use ⬆️ ⬇️ to turn the page up and down. We recommend browsing with a large screen for a better reading experience.
3.
Introduction
Transient
variables are local only to a given stack context (Particle Update
, for example) and are recalculated from scratch every frame, they do not persisit their value from frame to frame.
This makes them different from Particle.variables
which are saved in the particle payload and persist from frame to frame, which comes at a memory and performance cost.
4.
Goal
Here we make a transient variable representing the current distance from the emitter origin, and use that to drive a color and scale curve.
5.
Let's start the reconstruction
Right click and select FX
=> Niagara System
to create.
6.
Create Niagara System
Select Empty
template, click +
and Finish
7.
Create Niagara System
As a result, we get a Niagara System
asset, click to open it.
8.
Empty Niagara System
You can see that we have an empty Niagara system.
9.
Spawn Rate
Click on the +
sign to the right of the Emitter Update
to add the Spawn Rate
module.
Spawn Rate
: Number of particles per second to spawn.
10.
Spawn Rate
Set the Spawn Rate
value to 8.0
.
Spawn 8.0 particle per second.
11.
Spawn Burst Instantaneous
Click on the +
sign to the right of the Emitter Update
to add the Spawn Burst Instantaneous
module
12.
Spawn Burst Instantaneous
Set the value type of Spawn Count
to Random Range Int
13.
Spawn Burst Instantaneous
1. Set the Minimum value to 3
2. set the Maximum value to 10
3. set the Elevation Type to Every Frame
14.
Initialize Particles
Select Initialize Particles
and set:
1. Lifetime
to 8.0
2. Color Mode
to Direct Set
3. Sprite Size Mode
to Uniform
and its value to 5.0
15.
Add Velocity from Point
Add Add Velocity from Point
module to the Particle Spawn
section.
16.
Add Velocity from Point
Click the first Fix issue
button to add its dependency on the SolveForcesAndVelocity
module.
17.
Add Velocity from Point
Set the value type of Velocity Strength
to Random Range Float
18.
Add Velocity from Point
Set the minimum value to 10.0
and the maximum value to 85.0
.
19.
Point Attraction Force
Add Point Attraction Force
module to the Particle Update
section.
20.
Add Velocity from Point
1. Click the first Fix issue
button to fix the SolveForcesAndVelocity
module's dependency order issue.
2. Set the value of Attraction Strength
to 1.8
.
3. Set Attraction Radius
to 256.0
.
21.
NormalizedDistanceFromCenter
Add a Float
variable to the Stage Transients
module
22.
NormalizedDistanceFromCenter
Name this newly created variable: NormalizedDistanceFromCenter
23.
NormalizedDistanceFromCenter
Drag and drop NormalizedDistanceFromCenter
to Particles Update
.
24.
NormalizedDistanceFromCenter
Set the value type of NormalizedDistanceFromCenter
to Normalize Distance Range
25.
NormalizedDistanceFromCenter
Set Start Position
to Particles.Position
26.
NormalizedDistanceFromCenter
Set End Position
to Simulation Position
27.
NormalizedDistanceFromCenter
Set Distance
to 145.0
28.
Color
Add Color
module to the Particle Update
section.
29.
Color
Set the value type of Color
to Lerp Linear Color
30.
Color
1. Set the StartColor to (3, 0, 0, 1)
and the EndColor to (0, 0, 2, 1)
.
2. Set the LerpFactor to NormalizedDistanceFromCenter
31.
Scale Sprite Size
Add the Scale Sprite Size
module to the Particles Update
section.
32.
Scale Sprite Size
Edit the Scale Factor
's value to Vector 2DFrom Float
.
33.
Scale Sprite Size
Set the value type of Value
to Lerp Float
34.
Scale Sprite Size
1. Set A to 0.5
, B to 2.75
2. Set Alpha to NormalizedDistanceFromCenter