Fix particle not re-randomizing every emission

This commit is contained in:
Qbieshay
2025-02-20 13:04:11 +01:00
parent f42e612da2
commit 419e5c40fa
6 changed files with 39 additions and 11 deletions

View File

@@ -48,15 +48,22 @@ void CPUParticles3D::set_emitting(bool p_emitting) {
return;
}
if (p_emitting && !use_fixed_seed) {
set_seed(Math::rand());
}
emitting = p_emitting;
if (emitting) {
active = true;
set_process_internal(true);
_set_emitting();
}
}
// first update before rendering to avoid one frame delay after emitting starts
if (time == 0) {
_update_internal();
}
void CPUParticles3D::_set_emitting() {
active = true;
set_process_internal(true);
// first update before rendering to avoid one frame delay after emitting starts
if (time == 0) {
_update_internal();
}
}
@@ -251,7 +258,8 @@ void CPUParticles3D::restart(bool p_keep_seed) {
seed = Math::rand();
}
set_emitting(true);
emitting = true;
_set_emitting();
}
void CPUParticles3D::set_direction(Vector3 p_direction) {