See all glossary terms

Scene

In Godot, a scene is a file representing a blueprint for a self-contained part of a game, such as a character, a pickup, an enemy, or a level. It can be anything. A scene file is a template that can be instantiated to create a tree of nodes.
A scene is composed of one or more nodes and resources such as images, sounds, or other data. We typically build scenes in the Godot editor, which gives us a visual interface for creating and editing scenes. Then, we save them as files with the .tscn extension.
When Godot runs, it reads our scene files, which contain a description of nodes and resources, and recreates the corresponding node tree. Transforming a scene file into nodes is called instantiation.
For example, the following code creates a new instance of a pickup scene, which produces a new node hierarchy (a copy of the pickup scene template). Then, we add the created node hierarchy as a child of the current node, which is a common way to add new nodes to the scene tree in Godot:
const PickupScene = preload("pickup.tscn")

func _ready() -> void:
    var pickup = PickupScene.instantiate()
    add_child(pickup)
Scenes can contain instances of other scenes, which allows for creating complex structures by composing scenes. This promotes composition and allows us to reuse parts of our game across different scenes.
What is the difference between a scene and a node?
While nodes are the building blocks of a Godot game and exist in a running game, scenes are text files saved to the disk. When you run a game, Godot reads the scene files and creates instances of the nodes described in them. For convenience, we often call scene instances just "scenes" in the Godot community. But a scene is technically a template, and a scene instance is a concrete copy of that template.
When working in the Godot editor, you'll notice that scene instances appear as a single node with a camera slate icon in the Scene dock. It represents a scene instance with its child nodes hidden. With experience, you'll see that we can often treat scene instances as if they were a new node type we created ourselves. That's why they're represented as a single node in the editor.

See Also

Related terms in the Glossary