Move sprite to the position of the mouse with Phaser

1

I need to move a sprite to the mouse position, I used the game.physics.arcade.moveToPointer() function, but only works with sprites that have the body of type Phaser.Physics.Arcade .

How do I use this function using a body of type Phaser.Physics.P2JS ? link

    
asked by anonymous 27.02.2018 / 06:19

1 answer

0

This method exists:

update() {
    this.player.x = game.input.x;
    this.player.y = game.input.y;
}
    
04.03.2018 / 17:38