Hello,
I have problem with moving player out of Canvas with help of moveToXY function. The canvas size is 400x600 and the tilemap is 2000x2000.
When I click on destination point the player is going to destination but he always stop on hidden barrier (Canvas bounds) and can't get further. When I move the player with keyboard he can go anywhere but with mouse click he can't make it.
Here is my code in update function:
if (this.game.input.activePointer.isDown) {
this.playerX = this.input.activePointer.x;
this.playerY = this.input.activePointer.y;
console.log("X: " + this.playerX + " Y: " + this.playerY);
}
if (this.game.physics.arcade.distanceToXY(this.player, this.playerX, this.playerY) > 5) {
this.game.physics.arcade.moveToXY(this.player, this.playerX, this.playerY, 60, 0);
}