Skip to main content

Scenes, Nodes, and Scripts

Godot games are built using scenes, nodes, and scripts.

Understanding how these fit together is essential for:

  • building mechanics
  • organising projects
  • explaining how your game works

Nodes

A node is a single object in a game.

Examples of nodes include:

  • a player
  • an enemy
  • a platform
  • a button
  • a sound effect

Nodes - example game objects such as a player, enemy, platform, button, and sound effect

Each node has a specific role.


Scenes

A scene is a collection of nodes arranged together.

Scenes are used to:

  • build levels
  • group related objects
  • reuse parts of your game

A scene might represent:

  • a level
  • a menu
  • a player character
  • an enemy type

Scenes - grouping related nodes into levels, menus, characters, and reusable parts

Recommended video: Miss this and you won't understand Godot 4: Unity user explains - Godot Scenes and Nodes


Scripts

Scripts define behaviour.

A script:

  • is attached to a node
  • controls how that node behaves
  • responds to input and events

Scripts are written in GDScript.

Scripts - behaviour attached to a node through GDScript

Recommended video: How to program in Godot - GDScript Tutorial


How They Work Together

Scenes, nodes, and scripts work as a system:

  • nodes represent objects
  • scripts define behaviour
  • scenes organise objects

How They Work Together - a scene contains nodes and each node can have its own script

Recommended video: All There Is To Know About Godot's Scenes and Nodes

This structure helps keep games manageable as they grow.


Why This Structure Matters

Using scenes and nodes correctly:

  • reduces complexity
  • avoids duplicated code
  • makes testing easier
  • improves readability

Why This Structure Matters - reducing complexity, avoiding duplication, easing testing, and improving readability

Poor organisation leads to confusion and bugs.


Explaining Your Work

In assessment, you may be asked to:

  • explain how a scene is structured
  • describe what a script does
  • justify why objects are organised a certain way

Explaining Your Work - structure, script purpose, and design justification

Clear structure makes explanations easier.


Looking Ahead

Next, you will learn:

  • what game mechanics are
  • how mechanics affect player experience
  • how to design mechanics intentionally

Looking Ahead - moving from structure into mechanics and player experience

Scenes and scripts are the foundation for mechanics.


End of Scenes, Nodes, and Scripts