Skip to content

Instantly share code, notes, and snippets.

@tsraveling
Created September 23, 2024 22:24
Show Gist options
  • Save tsraveling/68fed744978cfbf3d1b241909d888f03 to your computer and use it in GitHub Desktop.
Save tsraveling/68fed744978cfbf3d1b241909d888f03 to your computer and use it in GitHub Desktop.
Godot Execution Order

Main Node Order

  1. _init is called first. .name is not accessible yet.
  2. _enter_tree is called starting at parent node, then descending vertically (ie, parent, parent.a, parent.a.1, parent.a.2, etc). All of these complete before next step.
  3. _ready is called for everybody -- but this happens children-first. Still vertically in terms of siblings. Aka, parent.a.1, parent.a.2, parent.a, parent.
  4. _input is called as a reverse vertical list of whole hierarchy, ie, parent.b.2, parent.b.1, parent.b, parent.a.2, parent.a.1 etc.
  5. Then _unhandled_input is called in the same order.
  6. Then _physics_process is called vertically starting w/ the parent (p, p.a, p.a.1, p.a.2, p.b).
  7. Then _process is called vertically starting with the parent.

Notes

  • Nodes have a _notification(what) method that is called when specific engine-level notifications (e.g. "draw") are sent. I don't yet know how to customize this method, or if you would generally ever need to
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment