Skip to content

Commit

Permalink
Merge pull request godotengine#101688 from TCROC/fix-gpu-particles-2d…
Browse files Browse the repository at this point in the history
…-set_one_shot-seed-randomization

Fix `gpu_particles_2d` not randomizing seed when `set_one_shot` is called
  • Loading branch information
Repiteo committed Jan 24, 2025
2 parents b298f6f + 3973c0b commit b15b24b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 2 additions & 0 deletions scene/2d/gpu_particles_2d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -912,6 +912,8 @@ GPUParticles2D::GPUParticles2D() {
one_shot = false; // Needed so that set_emitting doesn't access uninitialized values
set_emitting(true);
set_one_shot(false);
set_use_fixed_seed(false);
set_seed(0);
set_amount(8);
set_amount_ratio(1.0);
set_lifetime(1);
Expand Down
4 changes: 0 additions & 4 deletions scene/3d/gpu_particles_3d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,6 @@ void GPUParticles3D::set_one_shot(bool p_one_shot) {

if (is_emitting()) {
if (!one_shot) {
if (!use_fixed_seed) {
set_seed(Math::rand());
}

RenderingServer::get_singleton()->particles_restart(particles);
}
}
Expand Down

0 comments on commit b15b24b

Please sign in to comment.