Skip to content

Pending items aren't removed from the update list #5803

@samme

Description

@samme

Version

  • Phaser Version: 3.50.0 to 3.55.2

Description

After either

this.add.sprite(/*…*/).destroy();

or

this.sys.updateList.remove(this.add.sprite(/*…*/));

the sprite will be on the active update list after the next update.

Example Test Code

https://codepen.io/samme/pen/LYyJOJw?editors=0010

Additional Information

It happens because items in the "destroy" list are removed only from "active" and not from "pending".

The fix is a bit complicated because e.g. this.add.existing(sprite) adds two (duplicate) items to the pending update list.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions