title: Godot 4 and GDScript - Part 3 (the lifecycle)
sources: https://www.youtube.com/watch?v=yGXZFSs0jt8
media_link: https://www.youtube.com/watch?v=yGXZFSs0jt8
Authors:
- "[[FencerDevLog]]"
contentPublished: 2023-10-06
noteCreated: 2024-11-26
description: "📖 Godot 4 book: https://filiprachunek.gumroad.com/l/godot4💡 Get exclusive content on Patreon: https://www.patreon.com/FencerDevLog🚀 Space Shooter tutorial..."
tags:
- clippings
- video
takeaways:
subjects:
- "[[Node Lifecycle in Godot]]"
publish: true
Status: 🔴 Dropped📖 Godot 4 book: https://filiprachunek.gumroad.com/l/godot4💡 Get exclusive content on Patreon: https://www.patreon.com/FencerDevLog🚀 Space Shooter tutorial...
_ underscore methods like: _ready()
virtual functions, provided by the library. _init()02:14:
MyNodeType.new()_enter_tree()02:55:
_ready()
_enter_tree() is called on each node from trunk to leaf_ready() is called from leaf to trunk
_enter_tree()_exit_tree():
remove_child()change_scene_to_file("res://scene.tscn")queue_free()func _exit_tree():
if thread.is_alive():
thread.wait_to_finish()
_process(delta):
_physics_process(delta):
_input(_event):
_unhandled_input(event)_notification(what):
func _notification(what):
if what == MainLoop.NOTIFICATION_APPLICATION_FOCUS_OUT:
pause_game()