For Unity & Unreal Developers
Learn Godot 4
by building.
Interactive tutorials, hands-on labs, and copy-ready code — everything you need to go from zero to shipping games.
extends CharacterBody2D var speed = 300.0 func _physics_process(delta): var dir = Input.get_vector("left", "right", "up", "down") velocity = dir * speed move_and_slide()Try in Sandbox
Popular Guides
View AllLatest Articles
View AllLearning Hub
Everything you need to build games
Unreal to Godot Guide
Transitioning from Unreal Engine to Godot 4? Learn how Blueprints map to GDScript, Actors ...
Unity to Godot Guide
Switching from Unity to Godot? This migration guide maps Unity concepts to Godot equivalen...
Node Tree Explorer
Understand Godot's node and scene system from scratch. Learn how nodes work, how to compos...
Translation Game
Match Unity and Unreal Engine terms to their Godot equivalents in this interactive quiz ga...
Code Lab
Side-by-side code comparisons between C# (Unity) and GDScript (Godot). See how familiar co...
Input Guide
Learn about Input Actions, events, and handling player control in Godot 4. Master keyboard...
Physics Guide
Learn RigidBody, CharacterBody, collisions, and physics layers in Godot 4. Complete 2D and...
Save & Load Guide
Build robust save systems with JSON, FileAccess, and auto-save features in Godot 4....
Scene Builder
Drag and drop to build a Godot scene tree from scratch. Interactive exercise to practice n...
Input Playground
Real-time input testing playground. Press keys and see Godot's input system respond instan...
Code Sandbox
Write and run GDScript directly in your browser. Practice Godot scripting with instant fee...
Editor Guide
Master the Godot Editor: panels, shortcuts, hidden features, and productivity tips for eff...
Asset Pipeline Guide
Import 3D models, audio, textures, particles, and more into Godot 4. Complete asset pipeli...
Real World Patterns
Learn essential design patterns implemented in GDScript for Godot 4: Singleton, Observer, ...
GDScript Cheat Sheet
Complete GDScript cheat sheet for Godot 4. Variables, functions, signals, exports, types, ...
GDScript Recipes
Copy-ready code for common patterns
2D Player Movement
Basic WASD/arrow key movement for CharacterBody2D
extends CharacterBody2D var speed = 300.0 func _physics_process(delta): var direction = Input.get_vector("left", "right", "up", "down") velocity = direction * speed move_and_slide()Open Guide
Top-Down 8-Direction Movement
Normalized 8-direction movement with acceleration and friction
extends CharacterBody2D @export var max_speed := 200.0 @export var acceleration := 1200.0 @export var friction := 1000.0 func _physics_process(delta): var input_dir = Input.get_vector("left", "right", "up", "down")Open Guide
Smooth Camera Follow
Camera2D that smoothly tracks a target node with offset and dead zone
extends Camera2D @export var target: Node2D @export var smoothing := 5.0 @export var offset := Vector2(0, -40) @export var look_ahead := 50.0 func _process(delta):
Platformer Jump with Gravity
Variable-height jump with coyote time and jump buffering
extends CharacterBody2D @export var speed := 300.0 @export var jump_force := -400.0 @export var coyote_time := 0.12 @export var jump_buffer_time := 0.1 var gravity = ProjectSettings.get_setting("physics/2d/default_gravity")Open Guide
Health Bar with Tween
Animated health bar that smoothly transitions when health changes
extends ProgressBar @export var health_component: Node func _ready(): if health_component: health_component.health_changed.connect(_on_health_changed) max_value = 100
Damage Numbers Popup
Floating damage numbers that rise and fade out when enemies take hits
extends Node2D # Call this to spawn a damage number func show_damage(amount: int, pos: Vector2, is_crit := false): var label = Label.new() label.text = str(amount) label.position = pos label.horizontal_alignment = HORIZONTAL_ALIGNMENT_CENTER
Screen Shake Effect
Camera shake effect triggered by events like explosions or damage
extends Camera2D var shake_intensity := 0.0 var shake_decay := 5.0 func shake(intensity := 10.0, duration := 0.3): shake_intensity = intensity
Menu Slide Transitions
Smooth panel transitions for navigating between menu screens
extends Control @onready var panels = [$MainMenu, $SettingsMenu, $CreditsMenu] var current_panel: Control func _ready(): current_panel = $MainMenu for panel in panels:
Custom Signal with Data
Define and emit custom signals that carry typed payload data
extends CharacterBody2D signal health_changed(old_value: int, new_value: int) signal died signal item_collected(item_name: String, quantity: int) var health := 100Open Guide
Connecting Signals in Code
Connect signals programmatically with lambdas and bound arguments
extends Node func _ready(): # Basic connection $Player.health_changed.connect(_on_health_changed) $Player.died.connect(_on_player_died) # Lambda connectionOpen Guide
Signal Bus (Autoload)
Global event bus pattern using an autoload singleton for decoupled communication
# EventBus.gd — Add as Autoload in Project Settings extends Node # Game state signals signal game_started signal game_paused(is_paused: bool) signal game_over(score: int)Open Guide
JSON Save System
Save and load game data as JSON files with error handling
extends Node const SAVE_PATH = "user://savegame.json" func save_game(data: Dictionary) -> bool: var file = FileAccess.open(SAVE_PATH, FileAccess.WRITE) if not file: push_error("Cannot open save file: " + str(FileAccess.get_open_error()))Open Guide
Resource-Based Save
Type-safe save system using custom Resource classes
# save_data.gd class_name SaveData extends Resource @export var player_name := "Hero" @export var level := 1 @export var health := 100 @export var position := Vector2.ZEROOpen Guide
Config File Settings
Store user preferences (volume, resolution, keybinds) with ConfigFile
extends Node const CONFIG_PATH = "user://settings.cfg" func save_settings(settings: Dictionary): var config = ConfigFile.new() config.set_value("audio", "master_volume", settings.get("master_volume", 1.0))Open Guide
Raycasting from Code
Cast rays to detect walls, ground, or line-of-sight between objects
extends CharacterBody2D func check_line_of_sight(target: Node2D) -> bool: var space = get_world_2d().direct_space_state var query = PhysicsRayQueryParameters2D.create( global_position, target.global_position, 1 # Collision maskOpen Guide
Area2D Detection Zone
Detect when bodies enter/exit an area for pickups, triggers, or aggro zones
extends Area2D signal body_detected(body: Node2D) signal body_lost(body: Node2D) var bodies_in_range: Array[Node2D] = [] func _ready():Open Guide
Projectile Spawning
Spawn and fire projectiles with speed, direction, and lifetime
# bullet.gd extends Area2D var speed := 600.0 var direction := Vector2.RIGHT var damage := 10 func _ready():Open Guide
Play Sound Effects
Play one-shot SFX with pitch variation using AudioStreamPlayer
extends Node @export var sfx_library: Dictionary = {} # Preload your sounds var sounds = { "jump": preload("res://audio/sfx/jump.wav"), "hit": preload("res://audio/sfx/hit.wav"),
Background Music with Crossfade
Crossfade between background music tracks with volume tweening
extends Node var current_player: AudioStreamPlayer = null func play_music(stream: AudioStream, fade_duration := 1.0): var new_player = AudioStreamPlayer.new() new_player.stream = stream new_player.bus = "Music"
Sprite Animation State Machine
Simple state-based sprite animation using AnimatedSprite2D
extends CharacterBody2D @onready var sprite = $AnimatedSprite2D enum State { IDLE, RUN, JUMP, FALL } var current_state := State.IDLE func _physics_process(delta):
Tween UI Effects Collection
Reusable tween effects for punch scale, fade, slide-in, and bounce
extends Node # Punch scale (e.g., coin pickup, button press) static func punch_scale(node: Node, strength := 1.3, duration := 0.3): var tween = node.create_tween() tween.tween_property(node, "scale", Vector2.ONE * strength, duration * 0.4) tween.tween_property(node, "scale", Vector2.ONE, duration * 0.6).set_ease(Tween.EASE_OUT).set_trans(Tween.TRANS_ELASTIC)
Sprite Flash on Hit
Flash a sprite white briefly when the character takes damage
extends CharacterBody2D @onready var sprite = $Sprite2D # Requires a ShaderMaterial on the Sprite2D with a "flash_amount" uniform # Or use modulate for a simpler approach: func flash_damage(duration := 0.15, flashes := 3):
Simple Patrol AI
Enemy that walks between patrol points and waits at each one
extends CharacterBody2D @export var patrol_points: Array[Marker2D] = [] @export var speed := 100.0 @export var wait_time := 1.5 var current_point := 0 var waiting := false
Follow/Chase Player
Enemy that detects and chases the player within a detection radius
extends CharacterBody2D @export var speed := 120.0 @export var detection_radius := 200.0 @export var stop_distance := 30.0 var player: Node2D = null
State Machine NPC
Finite state machine for NPC behavior: idle, patrol, chase, attack
extends CharacterBody2D enum State { IDLE, PATROL, CHASE, ATTACK } var current_state := State.IDLE var player: Node2D = null @export var patrol_speed := 80.0 @export var chase_speed := 150.0Open Guide
Random Wander AI
NPC that picks random nearby positions and wanders between them
extends CharacterBody2D @export var wander_radius := 150.0 @export var speed := 60.0 @export var idle_time_min := 1.0 @export var idle_time_max := 3.0 var home_position := Vector2.ZERO
Interactive Labs
Learn by building, not by reading
Code Sandbox
Write and run GDScript in your browser
Open LabScene Builder
Drag & drop to build scene hierarchies
Open LabInput Playground
Test input handling with live feedback
Open LabTranslation Game
Match Unity/Unreal terms to Godot
Open LabFrom the Blog
Tutorials, deep dives & opinions
Unreal to Godot: The Complete Migration Guide
Everything Unreal Engine developers need to know about switching to Godot. Covers Actors vs Nodes, Blueprints vs GDScrip...
TutorialGodot Animation Tutorial: From Basics to Advanced
Master Godot's animation system. Covers AnimationPlayer, AnimatedSprite2D, Tweens, AnimationTree state machines, and pro...
TutorialGodot Physics Tutorial: Everything You Need to Know
Complete guide to Godot 4 physics. Covers body types, collision layers, raycasting, Jolt Physics in 4.6, and common phys...
GuideGDScript vs C#: Which Should You Learn for Godot?
Detailed comparison of GDScript and C# in Godot 4. Performance benchmarks, syntax examples, ecosystem support, and recom...
TutorialGodot 2D Platformer Tutorial: Complete Beginner Guide
Build a complete 2D platformer in Godot 4 from scratch. Covers CharacterBody2D, TileMaps, animations, collectibles, and ...
NewsWhat's New in Godot 4.6: Everything You Need to Know
A comprehensive guide to Godot 4.6's biggest changes: Jolt physics default, new Modern editor theme, IKModifier3D, lambd...
Track your progress as you learn
Earn XP, unlock achievements, and level up from Newbie to Legend across 15 guides.