CodeBlanks Logo Icon CodeBlanks

Saving the project

Learn to save scenes and projects and about auto-save.

Saving a scene

If you want the changes in your scene to be permanent you must save it with File > Save Scene; the shortcut is Ctrl+S. The saved scene is written to a file with the .tscn extension, and that file lives inside the project directory. While changes are not saved yet, an asterisk appears next to the file name in the Scene panel.

func _ready():
    print("Kayıt yolu: res://scenes/ana_sahne.tscn")

If your scene is saved at this path, you can find it from your code with the same path.

Saving the project and autosave

You must save not only the scene but the project settings too; project settings change in the Project > Project Settings window and are written to the project.godot file. Before running the game Godot handles unsaved scene changes for you: depending on the setting it performs autosave or asks whether you want to save. Even with this safety net, the strongest habit is to save often with Ctrl+S.

func _ready():
    print("Kayıt tamam: ana_sahne.tscn")

The scene and the project settings live in separate files; you should keep both up to date.

Practice Save report

Inside _ready, define the variable sahne_adi as "ana_sahne" and build the variable dosya from the combination of sahne_adi and ".tscn". Print the file name with the label Kayıt: res://scenes/, then print the line Durum: kaydedildi.

Starter code

Player.cs
func _ready():
    # 1) sahne_adi değişkenini "ana_sahne" olarak tanımla
    # 2) dosya değişkenini sahne_adi ile ".tscn" birleşiminden oluştur
    # 3) "Kayıt: res://scenes/" etiketiyle dosya adını yazdır
    # 4) "Durum: kaydedildi" satırını yazdır
    pass

Sample solution

Player.cs
func _ready():
    var sahne_adi = "ana_sahne"
    var dosya = sahne_adi + ".tscn"
    print("Kayıt: res://scenes/" + dosya)
    print("Durum: kaydedildi")

Expected output

Kayıt: res://scenes/ana_sahne.tscn
Durum: kaydedildi

Questions and answers

Review the lesson questions together with their answers. To test yourself, solve the lesson interactively.

1 Which mark appears next to the file name while a scene has unsaved changes?

  • A red dot
  • A green check mark
  • An asterisk Correct answer
  • An exclamation mark

Explanation: Unsaved changes are shown with an asterisk; it disappears when you save with Ctrl+S.

2 The scene file extension

Question
var dosya = "ana_sahne____"
Answer
var dosya = "ana_sahne.tscn"

Explanation: Godot scenes are saved with the .tscn extension; the .godot extension belongs to the project settings file.

3 Saving steps

Term Meaning
File > Save Scene Writes the scene to disk
Ctrl+S The shortcut for saving
Yıldız işareti Shows unsaved changes
Otomatik kayıt Saves changes for you

All lessons in Beginner