Skip to content

fix: respect particle config z when ParticleTransform.Global is set (#3748) - #3749

Open
MohammadYusif wants to merge 1 commit into
excaliburjs:mainfrom
MohammadYusif:fix/issue-3748
Open

fix: respect particle config z when ParticleTransform.Global is set (#3748)#3749
MohammadYusif wants to merge 1 commit into
excaliburjs:mainfrom
MohammadYusif:fix/issue-3748

Conversation

@MohammadYusif

Copy link
Copy Markdown

===:clipboard: PR Checklist :clipboard:===

  • ๐Ÿ“Œ issue exists in github for these changes
  • ๐Ÿ”ฌ existing tests still pass
  • ๐Ÿ™ˆ code conforms to the style guide
  • ๐Ÿ“ new tests written and passing / old tests updated with new scenario(s)
  • ๐Ÿ“„ changelog entry added (or not needed)

==================

Closes #3748

Changes:

  • In src/engine/particles/particle-emitter.ts, changed the z assignment in _createParticle from this.z to (this.particle.z ?? this.z) so that a z value specified in the particle config takes precedence over the emitter-level z, while retaining backward compatibility for emitters that only set z on themselves
  • Added two regression tests to src/spec/vitest/particle-spec.ts โ€” one verifying that particle.z overrides the emitter's z when ParticleTransform.Global is active, and one verifying the emitter's z is still used as a fallback when no particle.z is set

โ€ฆxcaliburjs#3748)

When creating particles with ParticleTransform.Global, the z value from
the particle config (this.particle.z) was not being respected. The
_createParticle method only passed the emitter-level z (this.z) to each
particle, causing any z set in the particle config to be silently ignored.

The fix prefers this.particle.z when present and falls back to the
emitter's this.z, preserving backward-compatible behavior for users who
only set z on the emitter.
@github-actions

Copy link
Copy Markdown

This PR hasn't had any recent activity lately and is being marked as stale automatically.

@github-actions github-actions Bot added the stale This issue or PR has not had any activity recently label Jul 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stale This issue or PR has not had any activity recently

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Particles z index not working

1 participant