Skip to content

Commit

Permalink
Merge pull request #75398 from newobj/issue-75218
Browse files Browse the repository at this point in the history
Update GPUParticles2D/3D speed scale on ENTER_TREE
  • Loading branch information
YuriSizov authored Mar 28, 2023
2 parents f818d2b + 4652fbd commit 1222d35
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions scene/2d/gpu_particles_2d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -538,6 +538,11 @@ void GPUParticles2D::_notification(int p_what) {
if (sub_emitter != NodePath()) {
_attach_sub_emitter();
}
if (can_process()) {
RS::get_singleton()->particles_set_speed_scale(particles, speed_scale);
} else {
RS::get_singleton()->particles_set_speed_scale(particles, 0);
}
} break;

case NOTIFICATION_EXIT_TREE: {
Expand Down
5 changes: 5 additions & 0 deletions scene/3d/gpu_particles_3d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,11 @@ void GPUParticles3D::_notification(int p_what) {
if (sub_emitter != NodePath()) {
_attach_sub_emitter();
}
if (can_process()) {
RS::get_singleton()->particles_set_speed_scale(particles, speed_scale);
} else {
RS::get_singleton()->particles_set_speed_scale(particles, 0);
}
} break;

case NOTIFICATION_EXIT_TREE: {
Expand Down

0 comments on commit 1222d35

Please sign in to comment.