1
I need to move a Sprite to the mouse position, I used the function game.physics.arcade.moveToPointer()
, but only works with sprites
who have the body of the type Phaser.Physics.Arcade
.
How do I use this function using a type body Phaser.Physics.P2JS
? https://codepen.io/salomaosnff/pen/LQXWPv
I even tried it this way, but then I can’t adjust some parameters like speed. The best solution I found was rewriting the functions moveToPointer, distanceToPointer and angleToPointer in a separate file.
– Salomão Neto