Jump to content

Cannot Run Update in Arcade.Group Object [ES6]


Daamiaan
 Share

Recommended Posts

Hey there everyone,
I have a class that extends from Phaser.Physics.Arcade.Group and have been attempting to run the updates for spawned objects. My class for the group looks like so:

export class ObjectPool extends Phaser.Physics.Arcade.Group
    {
    constructor(scene, key, objectType, amount)
        {
        super(scene.physics.world, scene, {runChildUpdate : true});

        this.createMultiple({
            key             : key,
            frameQuantity   : amount,

            active          : false,
            visible         : false,

            classType       : objectType,

            runChildUpdate  : true
            });
        }

    SpawnObject(x, y)
        {
        this.getFirstDead(false, x, y);
        }
    }

As you can see above I've attempted setting runChildUpdate to true in two places to attempt it to work.

However, the objects that are spawned do not run update:

export class Projectile extends Entity
    {
    constructor(scene, x, y, key)
        {
        super(scene, x, y, key);
        }

    update(time, delta)
        {        
        console.log("Test");
        }
    }

Is there anything I'm missing, or has it been deprecated to use updates within GameObjects and I just can't find the info on it somewhere?
 

Link to comment
Share on other sites

  • 1 year later...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...