How do i make it so an enemy sprite follows the player sprite in Phaser 3?

create(){
this.player = this.physics.add.sprite(100, 450, ‘player’);
this.enemy = this.physics.add.sprite(100, 450, ‘enemy’);
this.physics.moveToObject(this.enemy, this.player, 100);
}

So far i have this but because i’m using this.physics.add.sprite and not this.physics.add.image it doesn’t work.

I specifically need to use this.physics.add.sprite

How can i do that?

:wave:

What doesn’t work? What happens?