Inventory Quest

Learn Resources, clean data, and modular inventory systems.

What Are Resources in Godot?

Learn the difference between Nodes (things in your game) and Resources (data templates).

0

of 100 DMG

What you’ll build

An InventoryUI.gd coordinator that spawns slot UI, listens toinventory_changed, and refreshes the grid.

Grid settings

Columns4
Slots12

Data → UI refresh

Inventory.gdInventoryUI.gdSlots
Teach → Practice → Check

Live preview

Learning Objectives

Finish these and you’ll know when to use Resources (data) vs Nodes (things in the scene).

0/6 done
Understand what a Resource is (data asset) vs a Node (scene instance).
Know why Resources are great for items (reusable, editable, savable).
Correctly classify examples as Node or Resource (and explain why).
Understand how many instances can share the same Resource reference.
Create a simple Item Resource script with exported fields.
Create at least one .tres item and assign it in the Inspector.

Part 1: Discover the Difference

Sort game elements into Nodes vs Resources

Watch: What's a Resource?

4 min

Key concept: Resources are reusable data assets — not scene Nodes.

Node = exists in scene tree
Resource = pure data template

Quick example: @export and @export_multiline

@export exposes a variable in the Inspector so each Resource instance can have different values.

extends Resource
class_name ItemData

@export var item_name: String = "Health Potion"
@export var max_stack: int = 5
@export var icon: Texture2D

@export_multiline is perfect for long text (like item descriptions), giving you a bigger multi-line text box in the Inspector.

@export_multiline var description: String = """Restores 25 HP.
Tastes suspiciously like blueberries.
"""

Sort the Game Elements

Click each item to discover if it's a Node or Resource.

Discovered: 0/6
Nodes: 0/3Resources: 0/3

Part 2: Master Resources

Sort, visualize, and code with Resources

🎯 Your Mission

Create a custom Resource that can store item data. Resources are reusable data containers that live in .tres files!

Building ItemData Resource0/5
1
Extend Resource

All custom resources extend the Resource class

2
Name Your Resource
3
Export Item Name
4
Export Icon
5
Export Stack Size
ItemData.gd
GDScript
1
2
3
Ln 1, Col 1Spaces: 4 • UTF-8 • GDScript
What is a Resource?

Resources are data containers that can be saved as .tres files. Unlike Nodes (which live in scenes), Resources are pure data - perfect for items, spells, stats, and more!

Part 3: Write Your First Resource

Build ItemData.gd step by step

Building ItemData.gd0/5
1
Extend Resource
2
Add class_name
3
Export name
4
Export icon
5
Export description
ItemData.gd
GDScript
1
2
3
4
Ln 1, Col 1Spaces: 4 • UTF-8 • GDScript

Go Deeper (Optional)

Course Overview