See all glossary termsIn OOP parlance, the term "lifecycle" refers to the logic governing creation, lifetime, and destruction of an object.
For example, when opening a file, GDScript needs to:
- Get a handle to the file
- Read the file and store the results somewhere in memory
- Close the file
- Release the memory
Often, in GDScript, we talk of "lifecycle" when discussing the order in which functions are called during the node lifecycle. For example, when a node is added to the scene tree, the _enter_tree()
function is called. When the node is removed from the scene tree, the _exit_tree()
function is called. Other objects rarely have a lifecycle per se, even if all objects have at least the _init() function.See Also
Related terms in the Glossary
localhost:3000 - 0.3.5-2025-02-25T14:21:18.142Z-093239f5ec75d1161297ab83d6c5482f74320178-preview