Difference between revisions of "Bot Playground/Commands/walkTo"
From SmartBots Developers Docs
m (Gg moved page Bot Playground/Commands/walkto to Bot Playground/Commands/walkTo) |
|||
| Line 23: | Line 23: | ||
Bot does not "navigate" to the point. Instead, it walks straight to the specified point, hitting all obstacles on the way. If bot gets stuck for 2 seconds (for example, hitting the wall), the autopiloting ends. | Bot does not "navigate" to the point. Instead, it walks straight to the specified point, hitting all obstacles on the way. If bot gets stuck for 2 seconds (for example, hitting the wall), the autopiloting ends. | ||
| − | You can use [Bot_Playground/Commands/fly|fly] command to start flying and reach the higher destination point. | + | You can use [[Bot_Playground/Commands/fly|fly]] command to start flying and reach the higher destination point. |
| + | |||
| + | These events deliver the autopilot status: | ||
| + | |||
| + | * [[Bot_Playground/Events/autopilot_completed|autopilot_started]] - autopilot started | ||
| + | * [[Bot_Playground/Events/autopilot_completed|autopilot_completed]] - autopilot reached destination point | ||
| + | * [[Bot_Playground/Events/autopilot_completed|autopilot_stuck]] - autopilot got stuck (and stopped) | ||
== Examples == | == Examples == | ||
Revision as of 09:50, 7 December 2023
Walk to a position within the current region.
Bot.walkTo(x, y, z);
Reference
This command accepts the following parameters:
| Variable | Required | Description
| |
|---|---|---|---|
| Input: | |||
| x | yes | The X coordinate of the destination point | |
| y | yes | The Y coordinate of the destination point | |
| z | yes | The Z coordinate of the destination point | |
| Output: | |||
| Function returns a Promise with the following data: | |||
| success | bool | true if command completed successfully | |
| error | string | error string if command has failed | |
Details
Bot does not "navigate" to the point. Instead, it walks straight to the specified point, hitting all obstacles on the way. If bot gets stuck for 2 seconds (for example, hitting the wall), the autopiloting ends.
You can use fly command to start flying and reach the higher destination point.
These events deliver the autopilot status:
- autopilot_started - autopilot started
- autopilot_completed - autopilot reached destination point
- autopilot_stuck - autopilot got stuck (and stopped)
Examples
Bot.walkTo(128, 128, 20);