summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan Roden-Corrent <ryan@rcorre.net>2019-09-19 07:10:18 -0400
committerRyan Roden-Corrent <ryan@rcorre.net>2019-09-19 07:10:18 -0400
commit38fc09e6696b46cf5839e25dac5d19d6f03018fc (patch)
tree11d24e5bcefc6a99ca9857f37a6587c949adfa18
parenta1fcac640061c45e9dc55b1189e82aed3e2672fb (diff)
Clarify get_node vs get_node_or_null.
Fixes #2771. It is confusing to say get_node will "raise an error" if the node does not exist, as this phrase is used elsewhere in the godot docs (e.g. at several points in the GDScript overview) to indicate something that will completely stop execution. Saying it logs an error is more accurate.
-rw-r--r--doc/classes/Node.xml4
1 files changed, 2 insertions, 2 deletions
diff --git a/doc/classes/Node.xml b/doc/classes/Node.xml
index 097fa1f6e5..44dd0aa4bd 100644
--- a/doc/classes/Node.xml
+++ b/doc/classes/Node.xml
@@ -249,7 +249,7 @@
<argument index="0" name="path" type="NodePath">
</argument>
<description>
- Fetches a node. The [NodePath] can be either a relative path (from the current node) or an absolute path (in the scene tree) to a node. If the path does not exist, a [code]null instance[/code] is returned and attempts to access it will result in an "Attempt to call &lt;method&gt; on a null instance." error.
+ Fetches a node. The [NodePath] can be either a relative path (from the current node) or an absolute path (in the scene tree) to a node. If the path does not exist, a [code]null instance[/code] is returned and an error is logged. Attempts to access methods on the return value will result in an "Attempt to call &lt;method&gt; on a null instance." error.
[b]Note:[/b] Fetching absolute paths only works when the node is inside the scene tree (see [method is_inside_tree]).
[b]Example:[/b] Assume your current node is Character and the following tree:
[codeblock]
@@ -293,7 +293,7 @@
<argument index="0" name="path" type="NodePath">
</argument>
<description>
- Similar to [method get_node], but does not raise an error if [code]path[/code] does not point to a valid [Node].
+ Similar to [method get_node], but does not log an error if [code]path[/code] does not point to a valid [Node].
</description>
</method>
<method name="get_parent" qualifiers="const">