Static Functions

Static functions are functions that belong to a class rather than an instance of the class. To define a static function, use the static keyword:

class_name  MyClass extends Node

static func my_static_function():
    print("This is a static function.")

func _init() -> void:
    my_static_function()
    MyClass.my_static_function()
Comments