Fix particle emitter gravity length action when it was 0 (#8520)

This commit is contained in:
D8H
2026-04-21 11:16:50 +02:00
committed by GitHub
parent fc1bf9ca28
commit f20f4670ef
@@ -847,8 +847,13 @@ namespace gdjs {
const oldLength = this.getParticleGravityLength();
if (oldLength !== length) {
this._gravityDirty = true;
this.gravityX *= length / oldLength;
this.gravityY *= length / oldLength;
if (oldLength === 0) {
this.gravityX = 0;
this.gravityY = length;
} else {
this.gravityX *= length / oldLength;
this.gravityY *= length / oldLength;
}
}
}