summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2022-06-09 08:50:30 +0200
committerGitHub <noreply@github.com>2022-06-09 08:50:30 +0200
commitae78928232bc309de571caab0e864b686c96e289 (patch)
treea27a20b59c40042534b9126aa5b0306cbefe74f0 /doc
parentfc5ae503aebe8af06e01006c28ec4b6deeab2a29 (diff)
parent9c7f03aefc7d6918002641447cb979502ebea686 (diff)
Merge pull request #61670 from smix8/navigation_navagent_patharray_use_4.x
Document the correct use of NavigationAgent path functions
Diffstat (limited to 'doc')
-rw-r--r--doc/classes/NavigationAgent2D.xml5
-rw-r--r--doc/classes/NavigationAgent3D.xml5
2 files changed, 6 insertions, 4 deletions
diff --git a/doc/classes/NavigationAgent2D.xml b/doc/classes/NavigationAgent2D.xml
index 942579f564..945947ad9f 100644
--- a/doc/classes/NavigationAgent2D.xml
+++ b/doc/classes/NavigationAgent2D.xml
@@ -5,6 +5,7 @@
</brief_description>
<description>
2D Agent that is used in navigation to reach a location while avoiding static and dynamic obstacles. The dynamic obstacles are avoided using RVO collision avoidance. The agent needs navigation data to work correctly. [NavigationAgent2D] is physics safe.
+ [b]Note:[/b] After [method set_target_location] is used it is required to use the [method get_next_location] function once every physics frame to update the internal path logic of the NavigationAgent. The returned vector position from this function should be used as the next movement position for the agent's parent Node.
</description>
<tutorials>
</tutorials>
@@ -24,7 +25,7 @@
<method name="get_nav_path" qualifiers="const">
<return type="PackedVector2Array" />
<description>
- Returns the path from start to finish in global coordinates.
+ Returns this agent's current path from start to finish in global coordinates. The path only updates when the target location is changed or the agent requires a repath. The path array is not intended to be used in direct path movement as the agent has its own internal path logic that would get corrupted by changing the path array manually. Use the intended [method get_next_location] once every physics frame to receive the next path point for the agents movement as this function also updates the internal path logic.
</description>
</method>
<method name="get_nav_path_index" qualifiers="const">
@@ -36,7 +37,7 @@
<method name="get_next_location">
<return type="Vector2" />
<description>
- Returns a [Vector2] in global coordinates, that can be moved to, making sure that there are no static objects in the way. If the agent does not have a navigation path, it will return the position of the agent's parent.
+ Returns the next location in global coordinates that can be moved to, making sure that there are no static objects in the way. If the agent does not have a navigation path, it will return the position of the agent's parent. The use of this function once every physics frame is required to update the internal path logic of the NavigationAgent.
</description>
</method>
<method name="get_rid" qualifiers="const">
diff --git a/doc/classes/NavigationAgent3D.xml b/doc/classes/NavigationAgent3D.xml
index db2210b6e3..7f7e058742 100644
--- a/doc/classes/NavigationAgent3D.xml
+++ b/doc/classes/NavigationAgent3D.xml
@@ -5,6 +5,7 @@
</brief_description>
<description>
3D Agent that is used in navigation to reach a location while avoiding static and dynamic obstacles. The dynamic obstacles are avoided using RVO collision avoidance. The agent needs navigation data to work correctly. [NavigationAgent3D] is physics safe.
+ [b]Note:[/b] After [method set_target_location] is used it is required to use the [method get_next_location] function once every physics frame to update the internal path logic of the NavigationAgent. The returned vector position from this function should be used as the next movement position for the agent's parent Node.
</description>
<tutorials>
</tutorials>
@@ -24,7 +25,7 @@
<method name="get_nav_path" qualifiers="const">
<return type="PackedVector3Array" />
<description>
- Returns the path from start to finish in global coordinates.
+ Returns this agent's current path from start to finish in global coordinates. The path only updates when the target location is changed or the agent requires a repath. The path array is not intended to be used in direct path movement as the agent has its own internal path logic that would get corrupted by changing the path array manually. Use the intended [method get_next_location] once every physics frame to receive the next path point for the agents movement as this function also updates the internal path logic.
</description>
</method>
<method name="get_nav_path_index" qualifiers="const">
@@ -36,7 +37,7 @@
<method name="get_next_location">
<return type="Vector3" />
<description>
- Returns a [Vector3] in global coordinates, that can be moved to, making sure that there are no static objects in the way. If the agent does not have a navigation path, it will return the origin of the agent's parent.
+ Returns the next location in global coordinates that can be moved to, making sure that there are no static objects in the way. If the agent does not have a navigation path, it will return the position of the agent's parent. The use of this function once every physics frame is required to update the internal path logic of the NavigationAgent.
</description>
</method>
<method name="get_rid" qualifiers="const">