1
0
Fork 0

Fix example in `NodePath.get_name()` documentation

The output of `node_path.get_name(2)` is stated to be `Sprite`,
but the actual output is `Sprite2D`.
This commit is contained in:
Krazy_J 2023-11-22 14:07:17 -06:00 committed by GitHub
parent 923ef2b46a
commit b359f8e6f5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -121,13 +121,13 @@
var node_path = NodePath("Path2D/PathFollow2D/Sprite2D")
print(node_path.get_name(0)) # Path2D
print(node_path.get_name(1)) # PathFollow2D
print(node_path.get_name(2)) # Sprite
print(node_path.get_name(2)) # Sprite2D
[/gdscript]
[csharp]
var nodePath = new NodePath("Path2D/PathFollow2D/Sprite2D");
GD.Print(nodePath.GetName(0)); // Path2D
GD.Print(nodePath.GetName(1)); // PathFollow2D
GD.Print(nodePath.GetName(2)); // Sprite
GD.Print(nodePath.GetName(2)); // Sprite2D
[/csharp]
[/codeblocks]
</description>