# Cannot read property 'sys' of undefined

**URL:** <https://phaser.discourse.group/t/cannot-read-property-sys-of-undefined/3002>\
**Category:** Phaser 3\
**Created:** [July 4, 2019, 2:05pm UTC](https://phaser.discourse.group/t/cannot-read-property-sys-of-undefined/3002 "2019-07-04T14:05:08Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Faizan\_Ali](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/faizan_ali/32/964_2.png) [@Faizan\_Ali](https://phaser.discourse.group/u/Faizan_Ali)\
**Post date:** [July 4, 2019, 2:05pm UTC](https://phaser.discourse.group/t/cannot-read-property-sys-of-undefined/3002/1 "2019-07-04T14:05:08Z")

</div>

class Enemy extends Phaser.Physics.Arcade.Sprite {  
aTurret

```
constructor(scene, x, y, texture) {
    super(scene, x, y, texture = 'enemy', 'tank1')

    scene.add.existing(this)
    scene.physics.add.existing(this)

    scene.events.on('update', this.update, this)

    this.setVelocity(100, 0);
    this.setCollideWorldBounds(true);
    this.body.bounce.setTo(1, 1);
    this.body.immovable = false;
    this.health = 3;
    this.alive = true;

    this.aTurret = new aTurret(scene)
}

update() {

    this.aTurret.follow(this)
}

```

}

class aTurret extends Phaser.GameObjects.Sprite {  
constructor(scene, x, y, texture = ‘turret’){  
super(scene, x, y, texture)

```
scene.add.existing(this)

}

follow(demon) {
    this.setX(demon.x)
    this.setY(demon.y)
}

```

}

create() {

let demon = new Enemy(this, 100, 100);

demons = this.physics.add.group();  
for (var i = 0; i \< 20; i++)  
{  
var pos = demons.create(new Enemy);  
this.physics.add.existing(pos);  
}

}

I keep getting error “sys” of undefined and cannot seem to figure it out. The above code is causing this error but I do not know why!

---

<div class="post-metadata">

**Author:** ![ldd](https://avatars.discourse-cdn.com/v4/letter/l/9de0a6/32.png) [@ldd](https://phaser.discourse.group/u/ldd)\
**Post date:** [July 4, 2019, 4:06pm UTC](https://phaser.discourse.group/t/cannot-read-property-sys-of-undefined/3002/2 "2019-07-04T16:06:12Z")

</div>

there may be other things wrong with your code but  
`demons.create(new Enemy)` should be `demons.create(new Enemy(this,0,0))`
