Quick answer: Textures may be missing if they are not referenced by any scene or script that Godot's export system can detect. Godot only includes resources that are reachable through the dependency tree starting from your main scene. Resources loaded dynamically via string paths (e.g.
Here is how to fix Godot exported game missing resources. Your Godot 4 game runs perfectly in the editor, but the exported build is missing textures, audio files, or entire scenes. You get pink placeholder materials, silent audio, or outright crashes when the game tries to load a resource that does not exist in the exported package. This happens because Godot’s export system does not always include every file in your project — it follows the dependency tree, and anything it cannot trace gets left behind.
The Symptom
After exporting your Godot 4 project and running the resulting build, you encounter one or more of the following:
- Pink or magenta textures — The default fallback when a texture resource cannot be found. Materials that looked correct in the editor now display as solid pink.
- Missing scenes — Calling
get_tree().change_scene_to_file()with a scene path fails at runtime with a “Resource not found” error. - Silent audio — AudioStreamPlayer nodes play no sound because their stream resource was not included in the export.
- JSON or config file errors — Code that reads
.json,.txt,.csv, or other data files at runtime fails because these non-resource files were not bundled into the.pck.
The Godot output console in the editor will not warn you about this during export. The errors only appear at runtime when the exported game actually tries to load the missing files.
What Causes This
Godot’s export system builds a dependency graph starting from your project’s main scene and any scenes or resources explicitly referenced by scripts and scene files. If a resource is only loaded dynamically at runtime using string paths — for example, constructing a path with concatenation — the export system cannot detect it and will not include it.
Consider this common pattern:
# This dynamic path is invisible to the export system
var texture_path = "res://textures/enemies/" + enemy_name + ".png"
var tex = load(texture_path)
Because the full path is constructed at runtime, Godot’s static analysis during export cannot determine which files in res://textures/enemies/ will be needed. As a result, if no other scene or script directly references those textures via preload() or a resource property, they get excluded from the export.
The second major cause is non-resource files. Godot only exports files it recognizes as resources by default — scenes (.tscn), scripts (.gd), textures, audio, and similar formats. Plain data files like .json, .txt, .csv, and .cfg are not considered resources and are silently excluded unless you explicitly add them to the export filter.
A third, less obvious cause is unused resources in addon directories. If you use third-party addons and only reference some of their assets, the unreferenced ones may be excluded even if the addon expects them to exist at runtime.
The Fix
Step 1: Configure the export resource mode.
Open your export preset in Project → Export and navigate to the Resources tab. You have three options:
- Export all resources in the project — Includes everything in your
res://directory. This is the safest option and the right choice for most projects. - Export selected scenes and dependencies — Only includes scenes you explicitly select plus their detected dependencies. Use this for large projects where you want to minimize build size.
- Export selected resources and dependencies — The most granular option, letting you pick individual files.
If you are experiencing missing resources, switch to “Export all resources in the project” first to confirm that inclusion is the issue. If the problem goes away, you know your previous filter was too restrictive.
Step 2: Add non-resource file filters.
In the same Resources tab, find the field labeled “Filters to export non-resource files/folders”. Add glob patterns for any data files your game loads at runtime:
# Add these patterns to the non-resource filter field
*.json
*.txt
*.csv
*.cfg
data/*
Each pattern goes on a separate line or is comma-separated, depending on your Godot version. This tells the export system to bundle these files into the .pck even though Godot does not treat them as engine resources.
Step 3: Handle dynamically loaded resources.
For resources loaded via dynamic paths, you have two options. The preferred approach is to use preload() with constant paths wherever possible, which makes the dependency visible to the export system:
# Option A: Preload with constant paths (preferred)
const ENEMY_TEXTURES = {
"goblin": preload("res://textures/enemies/goblin.png"),
"skeleton": preload("res://textures/enemies/skeleton.png"),
"dragon": preload("res://textures/enemies/dragon.png"),
}
func get_enemy_texture(enemy_name: String) -> Texture2D:
return ENEMY_TEXTURES.get(enemy_name)
If you have too many resources to preload individually, use the export filter to include the entire directory. In the Resources tab, add the folder path to the inclusion filter:
# In the export preset → Resources tab
# Add to "Filters to export non-resource files/folders":
textures/enemies/*
Step 4: Verify with a test export.
After adjusting your filters, export the project and run through every scene and feature that loads resources. Pay special attention to:
- Level loading or scene transitions
- Character or enemy spawning that loads assets dynamically
- Save/load systems that read config or data files
- Localization files if you support multiple languages
Why This Works
Godot’s export system is designed to produce minimal builds by only including resources that are reachable through the static dependency tree. This is a smart default because it prevents shipping unused assets that inflate the download size. However, it means the system is inherently conservative — it will not include anything it cannot prove is needed.
By setting the export mode to “Export all resources,” you tell the system to skip the dependency analysis and include everything. The non-resource file filter extends this to file types that Godot does not manage through its import system. Together, these settings guarantee that every file in your project directory ends up in the exported .pck.
The preload() approach is ideal for dynamic resources because it converts a runtime lookup into a compile-time dependency. The export system can see the constant string path in the preload() call and includes the resource automatically. This gives you both the safety of static inclusion and the flexibility of a dictionary-based lookup in your code.
Related Issues
If your exported game cannot find its .pck file at all, see Fix: Godot PCK File Not Found Error After Export for details on PCK embedding and path configuration.
For custom fonts that render correctly in the editor but fail in exports, see Fix: Custom Fonts or Assets Not Loading in Godot Exported Build.
If you are seeing export template version errors instead, check Fix: Godot Export Template Version Mismatch Error.
Every file accounted for. Every texture where it belongs.