What Godot is
- Current stable
- 4.7.2
- Released
- 18 Aug 2026
- Licence
- MIT
- Install step
- None
Godot is a free, open-source engine for 2D and 3D games. Its licence terms don't apply to the games you make, so what you build stays yours, with no fee or royalty owed to the engine.
- Languages: GDScript (its own language, and the one to start with), C#, and C++ through GDExtension.
- Targets: desktop, mobile and web. Consoles go through third-party publishers.
- 2D: it has a dedicated 2D engine, so 2D isn't a flattened 3D scene.
- Organised by: a tree of small nodes. You'll learn this first, because everything else follows from it.
Games made with it include Slay the Spire 2, Brotato, Dome Keeper, Cassette Beasts, Buckshot Roulette and Until Then. All six appear on the official showcase.
Install and make a project
- Go to godotengine.org/download and get the standard Godot Engine build for your computer. Skip the .NET build, which you only need for C#.
- Unzip it and open it. There's nothing to install: Godot runs straight from the folder. On a Mac, move
Godot.appto Applications first. - Open it. The first window is the Project Manager, which lists your projects.
- Click Create, name it
CoinDash, and choose an empty folder. - Set the renderer to Compatibility. Web export only works with this renderer, and you'll want a browser build you can share with your audience.
- Confirm. The editor opens on your new project.
Tour the editor
Learn these six areas first. Most of what you do happens in Scene and Inspector.
res:// is the project root.The Script workspace swaps this for the code editor.
Signals tabBeside the Inspector. Lists events the selected node can send.
The exact arrangement can vary, and docks can be moved. The official editor overview has screenshots.
Mac shortcuts
| Action | Mac | Windows and Linux |
|---|---|---|
| Run the project (main scene) | ⌘ B | F5 |
| Run the scene you have open | ⌘ R | F6 |
| Stop the game | ⌘ . | F8 |
| Search built-in help | ⌥ Space | F1 |
Learn both columns. Most tutorials and audience members will say F5 and F6.
The four ideas
If you can explain these four in your own words, you understand how a Godot game is put together. They'll also be the backbone of your talk.
| Idea | What it is | Example |
|---|---|---|
| Node | One building block that does one job. | Sprite2D draws an image. Timer counts down. |
| Scene | A saved tree of nodes that you can reuse. It can be as small as one coin or as big as a level. | coin.tscn |
| Script | Code attached to a node that adds behaviour. A node holds one script at most. | player.gd |
| Signal | A message a node sends when something happens. Other nodes choose to listen. | Timer sends timeout. |
See it in the game you'll build
Click a node to see its job. Coin Dash is the small game in the build section.
How signals keep things separate
The coin doesn't know the score exists. It announces that it was collected, and Main decides what that means. You can change one without breaking the other.
- 1. PhysicsPlayer's body overlaps the coin's area.
- 2. Coin hears itBuilt-in
body_enteredfires. - 3. Coin announcesIt emits its own
collectedsignal and removes itself. - 4. Main reactsMain adds 1 to the score.
Coming from Unity
If you've used Unity before, use this table to translate. The main shift is that Unity stacks components on one object, while Godot uses a tree of single-purpose nodes.
| Unity | Godot |
|---|---|
| GameObject + components | Node with child nodes |
| Prefab | Scene (.tscn), used as an instance |
Start() | _ready() |
Update() | _process(delta) |
FixedUpdate() | _physics_process(delta) |
GetComponent / child lookup | $ChildName or get_node() |
Instantiate(prefab) | scene.instantiate(), then add_child() |
Destroy(obj) | queue_free() |
[SerializeField] | @export |
| C# events / UnityEvent | Signals |
| Trigger collider | Area2D |
| Character controller | CharacterBody2D |
| Tags | Groups |
| Asset Store | Asset Store (the docs call it the Asset Library) |
GDScript in ten minutes
It looks like Python, with indentation instead of braces, but it's a separate language built for the engine. Read this example line by line. You don't need to run it.
extends Node2D # This script controls a Node2D
signal died # An event other nodes can listen to
const MAX_HEALTH := 3 # A value that never changes
@export var speed := 200.0 # Editable in the Inspector
var health := MAX_HEALTH # := works out the type for you
@onready var sprite: Sprite2D = $Sprite2D # Finds a child node once it's ready
func _ready() -> void: # Runs once, when the node enters the game
print("Hello")
func _process(delta: float) -> void: # Runs every frame
position.x += speed * delta
func take_hit(amount: int) -> void: # Your own function
health -= amount
if health <= 0:
died.emit() # Send the signal
queue_free() # Remove this node safely| Term | Say it like this |
|---|---|
delta | The seconds since the last frame. Multiplying by it keeps speed the same on fast and slow machines. |
_process | Runs once per rendered frame. Use it for visuals and general logic. |
_physics_process | Runs at a fixed rate. Use it for movement and collisions. |
$Name | Shorthand for getting a child node by its path in the tree. |
@onready | Waits to set this variable until the node and its children are ready. |
@export | Puts the variable in the Inspector so you can tune it without touching code. |
Build Coin Dash
Move a character around, grab coins that appear every second, and see your score when the 30-second timer ends. It uses only icon.svg, the logo every new project ships with, so there's nothing to download. That also makes it safe to demo on a bad network.
Tested on Godot 4.7.2 on 6 Nov 2026. The game was built from these steps and played. The only errors along the way were typos, which are listed in the troubleshooting table at the end of this section.
Type the code instead of copying it if you can. You're going to demo this live, and typing it is how you'll remember it.
Step 1: Set up the controls
Actions give an input a name, so your code asks for move_left rather than a specific key.
Step 2: Player scene
CharacterBody2D is a physics body that you move with code.
extends CharacterBody2D
@export var speed := 400.0
func _physics_process(_delta: float) -> void:
var direction := Input.get_vector("move_left", "move_right", "move_up", "move_down")
velocity = direction * speed
move_and_slide()
position = position.clamp(Vector2.ZERO, get_viewport_rect().size)move_and_slide() applies delta for you, so this function doesn't use it. The underscore in _delta tells Godot that's deliberate. The last line keeps the player on screen.
Step 3: Coin scene
Area2D detects overlaps without blocking movement, which suits pickups.
extends Area2D
signal collected
func _on_body_entered(_body: Node2D) -> void:
collected.emit()
queue_free()A green icon appears in the script's left margin when a signal is connected. Look for it first when a signal seems dead.
Step 4: Main scene
extends Node2D
const COIN_SCENE := preload("res://coin.tscn")
var score := 0
var playing := true
@onready var spawn_timer: Timer = $SpawnTimer
@onready var round_timer: Timer = $RoundTimer
@onready var label: Label = $HUD/ScoreLabel
func _process(_delta: float) -> void:
if playing:
label.text = "Coins: %d Time: %d" % [score, ceili(round_timer.time_left)]
func _unhandled_input(event: InputEvent) -> void:
if not playing and event.is_action_pressed("ui_accept"):
get_tree().reload_current_scene()
func _on_spawn_timer_timeout() -> void:
var coin = COIN_SCENE.instantiate()
var size := get_viewport_rect().size
coin.position = Vector2(randf_range(40, size.x - 40), randf_range(40, size.y - 40))
coin.collected.connect(_on_coin_collected)
add_child(coin)
func _on_coin_collected() -> void:
score += 1
func _on_round_timer_timeout() -> void:
playing = false
spawn_timer.stop()
$Player.set_physics_process(false)
label.text = "Final score: %d. Press Space to play again." % scoreThis script holds the talk's best moment: coin.collected.connect(...). Coins don't exist when the game starts, so Main connects to each one in code as it spawns. Timers are in the scene from the start, so you connect them in the editor. Your audience sees both ways side by side.
Step 5: Run it
Step 6 (optional): Make it look good
Use the free Coin Dash asset pack (CoinDash-Assets.zip in the starter games folder). Its README has the same steps for students.
Step 7 (optional): Make it move
A Tween changes a property smoothly over time, such as a position, size or transparency. Each animation below works on its own, so do any of them.
func _ready() -> void:
# Grow from nothing to full size
var full_scale: Vector2 = $Sprite2D.scale
$Sprite2D.scale = Vector2.ZERO
var pop := create_tween()
pop.tween_property($Sprite2D, "scale", full_scale, 0.3).set_trans(Tween.TRANS_BACK).set_ease(Tween.EASE_OUT)
# Float up and down forever
var bob := create_tween().set_loops()
bob.tween_property($Sprite2D, "position:y", -6.0, 0.5).set_trans(Tween.TRANS_SINE)
bob.tween_property($Sprite2D, "position:y", 0.0, 0.5).set_trans(Tween.TRANS_SINE)func _on_body_entered(_body: Node2D) -> void:
collected.emit()
set_deferred("monitoring", false)
# Grow and fade out, then remove the coin
var burst := create_tween()
burst.tween_property(self, "scale", Vector2(1.8, 1.8), 0.15)
burst.parallel().tween_property(self, "modulate:a", 0.0, 0.15)
burst.tween_callback(queue_free)set_deferred("monitoring", false) stops the coin from counting twice while it fades. It's deferred because Godot doesn't allow changing collision settings during a collision signal.
$Sprite2D.rotation = lerpf($Sprite2D.rotation, direction.x * 0.25, 0.2)lerpf moves part of the way toward a target each frame, so the lean eases in and out instead of snapping.
If something breaks
| What you see | Likely cause |
|---|---|
| Error mentioning tabs or spaces | Copied code mixed the two. Make the file use tabs throughout. |
| Error that an InputMap action doesn't exist | A move_* name in Step 1 doesn't match the code exactly. |
| "Invalid access to property or key" | A misspelled property, such as timer_left instead of time_left. Type the dot and pick from the autocomplete list. |
| "Node not found" | A node's name doesn't match the script. Names are case-sensitive: ScoreLabel, SpawnTimer, RoundTimer, Player, HUD. |
| No coins appear | SpawnTimer's Autostart is off, or its timeout isn't connected. |
| Coins disappear but the score stays at 0 | coin.collected.connect(_on_coin_collected) is missing from _on_spawn_timer_timeout(). The coin sends its signal, but Main isn't listening. |
| "Cannot get return value of call to _on_coin_collected()" | Remove the brackets: connect(_on_coin_collected). Without brackets you pass the function to call later. With them, it runs immediately. |
| Coin sound is distorted, or louder on one side | Use an AudioStreamPlayer, not AudioStreamPlayer2D, and keep Volume dB at 0. |
| Touching a coin does nothing | The coin's body_entered isn't connected, or a CollisionShape2D has no shape. |
| Round never ends | RoundTimer's timeout isn't connected. |
Animation does nothing, or "Invalid get index" on $Sprite2D | The child node isn't named exactly Sprite2D, or the code is in the wrong script. |
| Connecting a signal created a second function | Delete the duplicate and keep one, with the name shown in the connection. |
Read the first red line in the bottom panel. It usually names the file and line.
Level it up without following a guide
Your real understanding starts here. Try each one with only the docs:
- Add a hazard scene that ends the round when touched.
- Play a sound on pickup with
AudioStreamPlayer. - Make coins vanish on their own after 3 seconds.
- Keep a high score between rounds using an autoload.
Practice builds
Once Coin Dash works, build these four from scratch. Each takes what you already know and adds one or two new ideas, ordered from easiest to hardest. The finished, tested projects are in the starter games folder, so open one when you're stuck and compare.
Tested on Godot 4.7.2. The scripts below are copied from the practice projects, which passed automated play-tests. One difference from Coin Dash: these use Godot's built-in ui_ actions (arrows, Space), so there's no Input Map step.
Practice 1: Spike Rain
Dodge falling spikes for as long as you can. New ideas: Spawning things that fall, ending the game on a hit, and making it harder over time.
Set up
Player
extends CharacterBody2D
@export var speed := 500.0
func _physics_process(_delta: float) -> void:
var direction := Input.get_axis("ui_left", "ui_right")
velocity = Vector2(direction * speed, 0)
move_and_slide()
position.x = clampf(position.x, 40, get_viewport_rect().size.x - 40)
$Sprite2D.rotation = lerpf($Sprite2D.rotation, direction * 0.25, 0.2)get_axis turns two actions into one number: -1 for left, 1 for right, 0 for neither.
Spike
extends Area2D
signal hit_player
var speed := 300.0
func _process(delta: float) -> void:
position.y += speed * delta
rotation += 2.0 * delta
if position.y > get_viewport_rect().size.y + 60:
queue_free()
func _on_body_entered(_body: Node2D) -> void:
hit_player.emit()The spike moves itself and deletes itself once it falls off the screen. Without that, thousands of invisible spikes would pile up.
Main
extends Node2D
const SPIKE_SCENE := preload("res://spike.tscn")
var survived := 0.0
var playing := true
@onready var spawn_timer: Timer = $SpawnTimer
@onready var label: Label = $HUD/ScoreLabel
@onready var message: Label = $HUD/Message
func _process(delta: float) -> void:
if playing:
survived += delta
label.text = "Survived: %.1f s" % survived
func _on_spawn_timer_timeout() -> void:
var spike = SPIKE_SCENE.instantiate()
spike.position = Vector2(randf_range(40, get_viewport_rect().size.x - 40), -60)
spike.speed = randf_range(250, 400) + survived * 10
spike.hit_player.connect(_on_hit_player)
add_child(spike)
# Spikes come faster the longer you survive
spawn_timer.wait_time = maxf(0.25, 0.8 - survived * 0.01)
func _on_hit_player() -> void:
if not playing:
return
playing = false
spawn_timer.stop()
$HitSound.play()
$Player.set_physics_process(false)
message.text = "Ouch! You survived %.1f seconds. Press Space to try again." % survived
func _unhandled_input(event: InputEvent) -> void:
if not playing and event.is_action_pressed("ui_accept"):
get_tree().reload_current_scene()
func _on_hint_timer_timeout() -> void:
if playing:
message.text = ""spawn_timer.wait_time = maxf(0.25, ...) shortens the gap between spikes the longer you survive, but never below a quarter of a second.
Practice 2: Run From Spiky
Grab coins while a spike ball chases you. New ideas: An enemy that follows the player, a variable that holds another node, and adding nodes safely during a collision.
Set up
Player
extends CharacterBody2D
@export var speed := 420.0
func _physics_process(_delta: float) -> void:
var direction := Input.get_vector("ui_left", "ui_right", "ui_up", "ui_down")
velocity = direction * speed
move_and_slide()
position = position.clamp(Vector2(40, 40), get_viewport_rect().size - Vector2(40, 40))
$Sprite2D.rotation = lerpf($Sprite2D.rotation, direction.x * 0.25, 0.2)Enemy
extends Area2D
signal caught_player
@export var speed := 150.0
var target: Node2D
func _process(delta: float) -> void:
if target:
position += position.direction_to(target.position) * speed * delta
rotation += 3.0 * delta
func _on_body_entered(_body: Node2D) -> void:
caught_player.emit()var target: Node2D stores the node to chase. Main fills it in. direction_to gives the arrow from Spiky toward the player.
Coin
extends Area2D
signal collected
func _on_body_entered(_body: Node2D) -> void:
collected.emit()
queue_free()Main
extends Node2D
const COIN_SCENE := preload("res://coin.tscn")
var score := 0
var playing := true
@onready var enemy = $Enemy
@onready var label: Label = $HUD/ScoreLabel
@onready var message: Label = $HUD/Message
func _ready() -> void:
enemy.target = $Player
label.text = "Coins: 0"
spawn_coin()
func spawn_coin() -> void:
var coin = COIN_SCENE.instantiate()
var size := get_viewport_rect().size
coin.position = Vector2(randf_range(60, size.x - 60), randf_range(60, size.y - 60))
coin.collected.connect(_on_coin_collected)
# Deferred, because physics nodes can't be added in the middle of a collision
add_child.call_deferred(coin)
func _on_coin_collected() -> void:
if not playing:
return
score += 1
label.text = "Coins: %d" % score
$CoinSound.play()
# Spiky gets faster with every coin
enemy.speed += 15
spawn_coin()
func _on_enemy_caught_player() -> void:
if not playing:
return
playing = false
enemy.set_process(false)
$Player.set_physics_process(false)
$HitSound.play()
message.text = "Caught! You got %d coins. Press Space to try again." % score
func _unhandled_input(event: InputEvent) -> void:
if not playing and event.is_action_pressed("ui_accept"):
get_tree().reload_current_scene()
func _on_hint_timer_timeout() -> void:
if playing:
message.text = ""add_child.call_deferred(coin) waits until the end of the frame to add the coin. Godot doesn't allow adding physics nodes in the middle of a collision, which is exactly when a coin gets collected.
Practice 3: Spike Blaster
Shoot stars at falling spikes before they get through. New ideas: Your own signal that carries a value, bullets hitting enemies (Area2D touching Area2D), groups, and lives.
Set up
Player
extends CharacterBody2D
signal shoot(from_position: Vector2)
@export var speed := 520.0
func _physics_process(_delta: float) -> void:
var direction := Input.get_axis("ui_left", "ui_right")
velocity = Vector2(direction * speed, 0)
move_and_slide()
position.x = clampf(position.x, 40, get_viewport_rect().size.x - 40)
func _unhandled_input(event: InputEvent) -> void:
if event.is_action_pressed("ui_accept"):
shoot.emit(position + Vector2(0, -50))signal shoot(from_position: Vector2) declares a signal that carries a value. The player doesn't create stars itself: it announces "shoot from here", and Main does the spawning.
Star
extends Area2D
var speed := 800.0
func _process(delta: float) -> void:
position.y -= speed * delta
rotation += 8.0 * delta
if position.y < -50:
queue_free()
func _on_area_entered(area) -> void:
if area.is_in_group("enemies"):
area.destroy()
queue_free()area_entered fires when one Area2D touches another. is_in_group("enemies") makes sure stars only hit spikes.
Spike
extends Area2D
signal destroyed
signal got_through
var speed := 180.0
func _ready() -> void:
add_to_group("enemies")
func _process(delta: float) -> void:
position.y += speed * delta
rotation += 2.0 * delta
if position.y > get_viewport_rect().size.y + 40:
got_through.emit()
queue_free()
func destroy() -> void:
destroyed.emit()
queue_free()
func _on_body_entered(_body: Node2D) -> void:
got_through.emit()
queue_free()add_to_group("enemies") tags every spike, like a Unity tag. The destroy() function is what the star calls on a hit.
Main
extends Node2D
const SPIKE_SCENE := preload("res://spike.tscn")
const STAR_SCENE := preload("res://star.tscn")
var score := 0
var lives := 3
var playing := true
@onready var spawn_timer: Timer = $SpawnTimer
@onready var label: Label = $HUD/ScoreLabel
@onready var message: Label = $HUD/Message
func _ready() -> void:
update_label()
func update_label() -> void:
label.text = "Score: %d Lives: %d" % [score, lives]
func _on_player_shoot(from_position: Vector2) -> void:
if not playing:
return
var star = STAR_SCENE.instantiate()
star.position = from_position
add_child(star)
$ShootSound.play()
func _on_spawn_timer_timeout() -> void:
var spike = SPIKE_SCENE.instantiate()
spike.position = Vector2(randf_range(40, get_viewport_rect().size.x - 40), -50)
spike.speed = randf_range(150, 250) + score * 5
spike.destroyed.connect(_on_spike_destroyed)
spike.got_through.connect(_on_spike_got_through)
add_child(spike)
func _on_spike_destroyed() -> void:
score += 1
update_label()
$CoinSound.play()
func _on_spike_got_through() -> void:
if not playing:
return
lives -= 1
update_label()
$HitSound.play()
if lives <= 0:
playing = false
spawn_timer.stop()
$Player.set_physics_process(false)
message.text = "Game over! Score: %d. Press Space to play again." % score
func _unhandled_input(event: InputEvent) -> void:
if not playing and event.is_action_pressed("ui_accept"):
get_tree().reload_current_scene()
func _on_hint_timer_timeout() -> void:
if playing:
message.text = ""Practice 4: Blob Jump
A one-screen platformer: jump between platforms and collect every coin. New ideas: Gravity, jumping with is_on_floor(), StaticBody2D platforms, finding nodes with groups, and a win condition.
Set up
Player
extends CharacterBody2D
signal fell
@export var speed := 380.0
@export var jump_velocity := -760.0
@export var gravity := 1800.0
func _physics_process(delta: float) -> void:
if not is_on_floor():
velocity.y += gravity * delta
var jump_pressed := Input.is_action_just_pressed("ui_accept") or Input.is_action_just_pressed("ui_up")
if jump_pressed and is_on_floor():
velocity.y = jump_velocity
$JumpSound.play()
var direction := Input.get_axis("ui_left", "ui_right")
velocity.x = direction * speed
move_and_slide()
$Sprite2D.rotation = lerpf($Sprite2D.rotation, direction * 0.2, 0.2)
if position.y > get_viewport_rect().size.y + 100:
fell.emit()Gravity adds to velocity.y every frame while you're in the air. Jumping sets it to a big negative number, because up is negative y in Godot 2D. is_on_floor() only works after move_and_slide() has run.
Platform
Coin
extends Area2D
signal collected
func _ready() -> void:
add_to_group("coins")
func _on_body_entered(_body: Node2D) -> void:
collected.emit()
queue_free()add_to_group("coins") lets Main find every coin in the level without knowing their names.
Level
Main
extends Node2D
var coins_left := 0
var playing := true
@onready var label: Label = $HUD/ScoreLabel
@onready var message: Label = $HUD/Message
func _ready() -> void:
for coin in get_tree().get_nodes_in_group("coins"):
coins_left += 1
coin.collected.connect(_on_coin_collected)
update_label()
func update_label() -> void:
label.text = "Coins left: %d" % coins_left
func _on_coin_collected() -> void:
coins_left -= 1
update_label()
$CoinSound.play()
if coins_left == 0:
playing = false
$Player.set_physics_process(false)
message.text = "You got every coin! Press Space to play again."
func _on_player_fell() -> void:
if not playing:
return
playing = false
$Player.set_physics_process(false)
$HitSound.play()
message.text = "You fell! Press Space to try again."
func _unhandled_input(event: InputEvent) -> void:
if not playing and event.is_action_pressed("ui_accept"):
get_tree().reload_current_scene()
func _on_hint_timer_timeout() -> void:
if playing:
message.text = ""get_nodes_in_group("coins") collects every coin in _ready, so you can add or remove coins in the editor and the count stays right.
Share it
- Open Editor → Manage Export Templates and install the templates for your version. They're a one-time download per engine version.
- Open Project → Export, click Add…, and choose Web.
- Export to an empty folder and name the file
index.html. - Zip that folder's contents and upload them to a host like itch.io as an HTML game.
Facts to have ready for web export:
- It requires the Compatibility renderer. Forward+ and Mobile don't work on the web.
- Single-threaded export has been the default since 4.3, which avoids the special server headers threaded builds need.
- C# projects can't export to the web in Godot 4. This is the most common surprise.
- Opening
index.htmlstraight from disk won't work. It has to be served over HTTP.
Test yourself
Answer out loud before opening each one. If you can answer all of them without peeking, you're ready for the jam.
What's the difference between a node and a scene?
A node is one building block. A scene is a saved tree of nodes that you can reuse and instance.
Why use a signal when the coin could just add to the score directly?
So the coin doesn't depend on Main. It announces what happened, and any node can respond. You can reuse the coin or change the score system without touching the other.
CharacterBody2D or Area2D: which for a pickup, and why?
Area2D. It detects overlaps without physically blocking anything. CharacterBody2D is for things you move by code and that collide.
What's the difference between _process and _physics_process?
_process runs every rendered frame. _physics_process runs at a fixed rate, which suits movement and collisions.
What does delta do?
It's the seconds since the last update. Multiplying movement by it keeps speed consistent regardless of frame rate.
Why does adding a coin in code take two steps?
instantiate() creates it, but it only joins the game once add_child() puts it in the tree.
Why call queue_free() rather than deleting a node on the spot?
It removes the node safely at the end of the current frame, after running code has finished using it.
Why did you connect timers in the editor but coins in code?
Timers exist when the scene loads, so the editor can connect them. Coins are created during play, so they have to be connected at that point.
What does @export give you?
The variable appears in the Inspector, so you can change it per instance without editing code.
Why might a web export fail for a C# project?
Godot 4 C# projects can't currently export to the web. Use GDScript for web games.
Next steps
Follow them in this order. They're all official and free.
- Step by step: the concepts from the docs' point of view.
- Your first 2D game: a bigger project with art, enemies and menus.
- GDScript reference: look things up as you need them.
- Your first 3D game: Squash the Creeps, for when you want 3D.
- Showcase: real games to cite in your talk.