Skip to content

Instantly share code, notes, and snippets.

@Gnumaru
Last active March 19, 2024 03:00
Show Gist options
  • Star 15 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save Gnumaru/9de86865e7497d176f8264f14d2ee9ee to your computer and use it in GitHub Desktop.
Save Gnumaru/9de86865e7497d176f8264f14d2ee9ee to your computer and use it in GitHub Desktop.
The sequence in which methods and signals gets called in gdscript
# as of godot 4.1
_static_init
_init
_notification 20 Node.NOTIFICATION_SCENE_INSTANTIATED # only on instantiated scene roots
_notification 18 Node.NOTIFICATION_PARENTED
_enter_tree
tree_entered signal
_notification 27 Node.NOTIFICATION_POST_ENTER_TREE
_ready
ready signal
_input
_gui_input # Control only
_unhandled_input
_unhandled_key_input
get_tree().physics_frame signal
mouse_entered signal # emited by CollisionObject2D
mouse_shape_entered signal # emited by CollisionObject2D
input_event signal # emited by CollisionObject2D
_physics_process
_draw # from CanvasItem
_init.call_deferred until _physics_process.call_deferred
body_entered signal # emited by Area2D
body_shape_entered signal # emited by Area2D
area_entered signal # emited by Area2D
area_shape_entered signal # emited by Area2D
_integrate_forces # from RigidBody2D
_integrate_forces.call_deferred # from RigidBody2D
get_tree().process_frame signal
_process
_process.call_deferred
_exit_tree
tree_exiting signal
tree_exited signal
_notification 1 Object.NOTIFICATION_PREDELETE
# after exit tree only deferred call from external callables work, but they still get called before the next frame
_exit_tree.call_deferred until NOTIFICATION_PREDELETE.call_deferred
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment