Skip to content

Commit b15b24b

Browse files
committed
Merge pull request #101688 from TCROC/fix-gpu-particles-2d-set_one_shot-seed-randomization
Fix `gpu_particles_2d` not randomizing seed when `set_one_shot` is called
2 parents b298f6f + 3973c0b commit b15b24b

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

scene/2d/gpu_particles_2d.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -912,6 +912,8 @@ GPUParticles2D::GPUParticles2D() {
912912
one_shot = false; // Needed so that set_emitting doesn't access uninitialized values
913913
set_emitting(true);
914914
set_one_shot(false);
915+
set_use_fixed_seed(false);
916+
set_seed(0);
915917
set_amount(8);
916918
set_amount_ratio(1.0);
917919
set_lifetime(1);

scene/3d/gpu_particles_3d.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,6 @@ void GPUParticles3D::set_one_shot(bool p_one_shot) {
9292

9393
if (is_emitting()) {
9494
if (!one_shot) {
95-
if (!use_fixed_seed) {
96-
set_seed(Math::rand());
97-
}
98-
9995
RenderingServer::get_singleton()->particles_restart(particles);
10096
}
10197
}

0 commit comments

Comments
 (0)