Is it possible to stop the movement of a player?
I found this in the documentation: https://docs.rpgjs.dev/api/MoveManager.html#block-movement
But it works only if a player is not on the move.
I would want to stop player while he is in move and shoots an arrow.
I tried this:
// change direction of a player to the direction of an arrow
player.changeDirectionByNextPosition(new Vector2d(position.x, position.y));
// stop move
player.canMove = false;
// animation & throw arrow
ShowAnimation.withReplace(player, 'shoot', 'bow-shoot');
player.rangePhysicalAttack.attack(map, player, position);
// restore movement (if you did not key up the move button then keep moving)
player.canMove = true;