particle-emitter icon indicating copy to clipboard operation
particle-emitter copied to clipboard

`update(delta)` doesn't respect Ticker speed

Open reececomo opened this issue 4 months ago • 1 comments

Hey there 👋

When autoUpdate = true, we would expect the emitter to respect the speed property of the shared ticker (like other related concepts such as AnimatedSprite). ~It's almost like delta is ignored completely.~ Update: It is!

It's probably due to Emitter.ts#L563?

/**
     * Updates all particles spawned by this emitter and emits new ones.
     * @param delta Time elapsed since the previous frame, in __seconds__.
     */
    public update(delta: number): void
    {
        if (this._autoUpdate)
        {
            delta = ticker.elapsedMS * 0.001;
         // ^ 💥 delta param is discarded
        }

Do you think it might be unexpected that the delta parameter is discarded and the global const ticker's elapsedMS is used instead?

reececomo avatar Mar 27 '24 23:03 reececomo