diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2019-11-09 18:53:34 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-11-09 18:53:34 +0100 |
commit | 7afa1a64eceae9a6a27d84335d79f3f9238bd277 (patch) | |
tree | e969abc3afa64140195e8090ad87451401ed13f3 /scene | |
parent | 52de63afc8661f1f0f82e190db9d01eba83aaa3b (diff) | |
parent | 530665197f04f08090e2dda92a50548fb5aca374 (diff) |
Merge pull request #33478 from nekomatata/particles-restart-glitch
Fixed Particles restart after visibility has been set to off and on again
Diffstat (limited to 'scene')
-rw-r--r-- | scene/3d/particles.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/scene/3d/particles.cpp b/scene/3d/particles.cpp index 241eb7d1ca..06b5613eb8 100644 --- a/scene/3d/particles.cpp +++ b/scene/3d/particles.cpp @@ -331,6 +331,13 @@ void Particles::_notification(int p_what) { set_process_internal(false); } } + + if (p_what == NOTIFICATION_VISIBILITY_CHANGED) { + // make sure particles are updated before rendering occurs if they were active before + if (is_visible_in_tree() && !VS::get_singleton()->particles_is_inactive(particles)) { + VS::get_singleton()->particles_request_process(particles); + } + } } void Particles::_bind_methods() { |