.. _doc_overridable_functions: Overridable functions ===================== Godot's Node class provides virtual functions you can override to update nodes every frame or on specific events, like when they enter the scene tree. This document presents the ones you'll use most often. .. seealso:: Under the hood, these functions rely on Godot's low-level notifications system. To learn more about it, see `doc_godot_notifications`. Two functions allow you to initialize and get nodes, besides the class's constructor: `_enter_tree()` and `_ready()`. When the node enters the Scene Tree, it becomes active and the engine calls its `_enter_tree()` method. That node's children may not be part of the active scene yet. As you can remove and re-add nodes to the scene tree, this function may be called multiple times throughout a node's lifetime. Most of the time, you'll use `_ready()` instead. This function is called only once in a node's lifetime, after `_enter_tree()`. `_ready()` ensures that all children have entered the scene tree first, so you can safely call `get_node()` on it. .. seealso:: To learn more about getting node references, read `doc_nodes_and_scene_instances`. Another related callback is `_exit_tree()`, which the engine calls every time a node exits the scene tree. This can be when you call `Node.remove_child()