I have updated a project to Phaser 3.53.1 (from Phaser 3.4.something). I have some custom Groups which now return TypeScript errors when adding them to a scene using scene.add.existing(group).
Example code:
class GroupNew extends Phaser.GameObjects.Group {
constructor(scene: Phaser.Scene) {
super(scene);
this.scene.add.existing(this); // Returns "Argument of type 'this' is not assignable to parameter of type 'GameObject'."
}
}
I am not sure whether this is a typing problem in the latest version of Phaser or whether I should change my approach when adding custom groups to scenes.