Ready Runs Once
Part of the Nodes and Scenes section of Coddy's Godot journey. Lesson 2 of 27.
Godot calls _ready() once for each node, when the node joins the game. Use it for what a node does when it appears, like setting its place or printing a greeting.
Lines inside a function run from top to bottom. These two print() calls write two lines in the Console, in this order:
func _ready():
print("First")
print("Second")Every line inside a function starts with a tab. The tab tells Godot the line belongs to the function. A line with no tab is outside it.
Challenge
EasyWhen the game starts, make the robot print two lines, in this order:
Robot onlineSystems ready
Try it yourself
extends Node2D
func _ready():
print("Robot online")
This lesson includes a short quiz. Start the lesson to answer it and track your progress.
All lessons in Nodes and Scenes
1Your First Godot Game
What Is Godot?Ready Runs OncePrint in GodotThe Scene TreeSet a PositionMove a Node OncePractice on your own: Godot playground