You’re looking at documentation or examples for Godot 2.1. In 3.0, names and functionality was changed. For examples, abbreviations like “pos” and “rot” were changed to “position” and “rotation”.
In addition, you no longer need to use get/set methods to access node properties. You can use the variables directly. Your example script would become:
extends Node2D
func _ready():
print(position)
You can see the full list of a node’s properties in the docs. In addition, the editor’s autocomplete will suggest them. For example, here’s the Node2D list: Node2D — Godot Engine (3.0) documentation in English
Thanks!
The tutorial I watched must have been done in older version of the engine.
thiago | 2018-03-24 16:06
I was following the pong tutorial on documentation and faced the same issue.
Just swap get_pos with get_position and set_pos with set_position and you are good to go.
Thanks for the tip!