Godot Foundations

Nodes and scenes

Godot games are built from nodes arranged into scene trees. Scenes can be instantiated as reusable objects.

gdscript
extends CharacterBody2D

@export var speed := 220.0

func _physics_process(_delta):
    var direction = Input.get_vector("ui_left", "ui_right", "ui_up", "ui_down")
    velocity = direction * speed
    move_and_slide()
  • Keep scene responsibilities focused.
  • Use exported variables for designer-friendly configuration.
  • Use signals to reduce direct dependencies.
Lesson complete?Use the next lesson to continue the learning path.