# Lifecycle the order node hooks fire, made visible. ```{raw} html ▶ Run in browser ``` **Tags:** `basics` `lifecycle` `node` Every node runs through the same hooks in the same order: `on_enter_tree` when it is attached to the running tree, `on_ready` once right after, then `on_update(dt)` every frame, and `on_exit_tree` when it leaves. Here a child node is spawned and later removed on a timer, and each hook appends to a shared log so the firing order is plainly readable on screen. ## What it demonstrates - Hook order: `on_enter_tree` -> `on_ready` -> `on_update(dt)` (every frame) -> `on_exit_tree`. - `on_enter_tree` / `on_exit_tree` bracket a node's time in the tree; `on_ready` fires exactly once. - `on_update(dt)` runs once per frame while the node is in the tree. - Removing a child (`remove_child`) fires its `on_exit_tree`. ## Source ```{literalinclude} ../../examples/features/basics/lifecycle.py :language: python :linenos: ```