From e70289c61d53ba2150880c141650fdec83ea3afc Mon Sep 17 00:00:00 2001 From: Hanusiak Piotr Date: Wed, 19 Jan 2022 15:28:49 +0100 Subject: [PATCH] add WA.player.moveTo command to the readme --- docs/maps/api-player.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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;