summaryrefslogtreecommitdiffstats
path: root/scene/2d/cpu_particles_2d.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'scene/2d/cpu_particles_2d.cpp')
-rw-r--r--scene/2d/cpu_particles_2d.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/scene/2d/cpu_particles_2d.cpp b/scene/2d/cpu_particles_2d.cpp
index e04e6d7dce..2cd59776ec 100644
--- a/scene/2d/cpu_particles_2d.cpp
+++ b/scene/2d/cpu_particles_2d.cpp
@@ -753,10 +753,10 @@ void CPUParticles2D::_particles_process(double p_delta) {
p.custom[0] = 0.0; // unused
p.custom[1] = 0.0; // phase [0..1]
p.custom[2] = tex_anim_offset * Math::lerp(parameters_min[PARAM_ANIM_OFFSET], parameters_max[PARAM_ANIM_OFFSET], p.anim_offset_rand);
- p.custom[3] = 0.0;
+ p.custom[3] = (1.0 - Math::randf() * lifetime_randomness);
p.transform = Transform2D();
p.time = 0;
- p.lifetime = lifetime * (1.0 - Math::randf() * lifetime_randomness);
+ p.lifetime = lifetime * p.custom[3];
p.base_color = Color(1, 1, 1, 1);
switch (emission_shape) {