diff --git a/docs/maps/api-player.md b/docs/maps/api-player.md index d9a89bd1..a8280a6c 100644 --- a/docs/maps/api-player.md +++ b/docs/maps/api-player.md @@ -173,6 +173,19 @@ Example: WA.player.state.toto //will retrieve the variable ``` +### Move player to position +Player will try to find shortest path to the destination point and proceed to move there. +```typescript +// Let's move player to x: 250 y: 250 with speed of 10 +WA.player.moveTo(250, 250, 10); +``` +You can also chain movement like this: +```typescript +// Player will move to the next point after reaching first one +await WA.player.moveTo(250, 250, 10); +await WA.player.moveTo(500, 0, 10); +``` + ### Set the outline color of the player ``` WA.player.setOutlineColor(red: number, green: number, blue: number): Promise;