Skip to content

Typo causes stopping particle systems to always throw TypeError #7787

@michaelfranzl

Description

@michaelfranzl

https://github.com/playcanvas/engine/blame/90fd1fe6c98bca9d6298d90372ece0fef361e32a/src/scene/particle-system/particle-emitter.js#L695

Here, shaderParticleUpdateOnStop should be assigned instead of shaderParticleUpdateNoRespawn. This was likely a copy-paste mistake.

shaderParticleUpdateOnStop is mistakenly always null, and stopping GPU particle systems always fails:

events.js:276 Uncaught TypeError: Cannot read properties of null (reading 'device')
    at new QuadRender (quad-render.js:19:27)
    at drawQuadWithShader (quad-render-utils.js:7:16)
    at ParticleGPUUpdater.update (gpu-updater.js:149:5)
    at ParticleEmitter.addTime (particle-emitter.js:1045:24)
    at ParticleSystemComponent.stop (component.js:1008:20)
    at thrust (my.svelte:150:20)
    at HTMLButtonElement.on_mouseup_9 (my.svelte:458:20)
    at HTMLDivElement.handle_event_propagation (events.js:251:10)
QuadRender @ quad-render.js:19
drawQuadWithShader @ quad-render-utils.js:7
update @ gpu-updater.js:149
addTime @ particle-emitter.js:1045
stop @ component.js:1008
on_mouseup_9 @ my.js:458

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions