See all glossary termsIn programming, a method, often referred to as a member function, is a function that defined within a class and is associated with an object instance.
In Godot, every node is an object, and every function provided by this node is a method. For example, you can call the function start()
on a Timer
node: This start()
function is a method. It runs on one Timer
node instance and starts this specific timer.
In Godot's GDScript programming language, every function you define in a script is a method by default unless you make it a static function.
Generally speaking, we use methods to define the behaviors of an object, allowing it to perform actions, modify its data, or calculate and return data. Unlike static functions, methods have access to the data (properties) and other methods of the object they belong to.See Also
Related terms in the Glossary
school.gdquest.com - 0.3.5-2024-11-18T20:36:29.840Z-