Constructors are special methods that are called when an object is initialized. In GDScript, the constructor is named _init:

class MyClass:
    func _init():
        print("Object initialized!")
Comments