Skip to content

Commit 70def63

Browse files
authored
Clarify the global registration of named_classes (#10679)
* Add a clarification about named class registry
1 parent 40a5a09 commit 70def63

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

tutorials/scripting/gdscript/gdscript_basics.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1951,6 +1951,16 @@ If you want to use ``extends`` too, you can keep both on the same line::
19511951

19521952
class_name MyNode extends Node
19531953

1954+
Named classes are globally registered, which means they become available to use
1955+
in other scripts without the need to ``load`` or ``preload`` them:
1956+
1957+
.. code-block:: gdscript
1958+
1959+
var player
1960+
1961+
func _ready():
1962+
player = Character.new()
1963+
19541964
.. note::
19551965

19561966
Godot initializes non-static variables every time you create an instance,

0 commit comments

Comments
 (0)