> For the complete documentation index, see [llms.txt](https://gdquest.gitbook.io/godot-3-steering-ai-framework-reference/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://gdquest.gitbook.io/godot-3-steering-ai-framework-reference/code-reference/gsaipath.md).

# GSAIPath

**Extends:** Reference

### Description

Represents a path made up of Vector3 waypoints, split into segments path follow behaviors can use.

### Properties

| Type  | Name     |
| ----- | -------- |
| bool  | is\_open |
| float | length   |

### Functions

| Type    | Name                                                                 |
| ------- | -------------------------------------------------------------------- |
| void    | func create\_path(waypoints: Array) -> void                          |
| float   | func calculate\_distance(agent\_current\_position: Vector3) -> float |
| Vector3 | func calculate\_target\_position(target\_distance: float) -> Vector3 |
| Vector3 | func get\_start\_point() -> Vector3                                  |
| Vector3 | func get\_end\_point() -> Vector3                                    |

### Property Descriptions

#### is\_open

```gdscript
var is_open: bool
```

If `false`, the path loops.

#### length

```gdscript
var length: float
```

Total length of the path.

### Method Descriptions

#### create\_path

```gdscript
func create_path(waypoints: Array) -> void
```

Creates a path from a list of waypoints.

#### calculate\_distance

```gdscript
func calculate_distance(agent_current_position: Vector3) -> float
```

Returns the distance from `agent_current_position` to the next waypoint.

#### calculate\_target\_position

```gdscript
func calculate_target_position(target_distance: float) -> Vector3
```

Calculates a target position from the path's starting point based on the `target_distance`.

#### get\_start\_point

```gdscript
func get_start_point() -> Vector3
```

Returns the position of the first point on the path.

#### get\_end\_point

```gdscript
func get_end_point() -> Vector3
```

Returns the position of the last point on the path.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://gdquest.gitbook.io/godot-3-steering-ai-framework-reference/code-reference/gsaipath.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
