StreamCubemapArray in Godot 4: Identifier not declared in the current scope
StreamCubemapArray is called CompressedCubemapArray in Godot 4. A Godot 3 script that names the old class fails to parse with Identifier "StreamCubemapArray" not declared in the current scope, and Godot 4.7.2 adds Did you mean to use "CompressedCubemapArray"?
AppImage, x86_64. Ubuntu 22.04, Debian 12, Fedora 39 or newer.
Intel or AMD Chromebook, with Linux turned on.
What Godot is checking
When GDScript loads a script it resolves every identifier. StreamCubemapArray is not a class in Godot 4, so the analyzer stops with Identifier not declared in the current scope and none of the script runs.
Before it reports the error, the analyzer looks the name up in the Godot 3 to 4 renames table, as long as the project setting debug/gdscript/warnings/renamed_in_godot_4_hint is on. That table maps StreamCubemapArray to CompressedCubemapArray, which is where Did you mean to use "CompressedCubemapArray"? comes from.
The class reference describes CompressedCubemapArray as a cubemap array loaded from a .ccubearray file, a format internal to Godot that the import system creates from other image formats. It inherits CompressedTextureLayered, which inherits TextureLayered; the fix printed that chain and the layered type, LAYERED_TYPE_CUBEMAP_ARRAY.
More on this: AudioStreamSample in Godot 4: Identifier "AudioStreamSample" not declared
Reproduce it
A Godot 3 script that makes a StreamCubemapArray in code, in a Godot 4 project. The scene is one Node with this script.
extends Node
func _ready():
var sky = StreamCubemapArray.new()
print(sky)
What Godot 4.7.2 prints
More on this: VisualShaderNodeVectorScalarSmoothStep in Godot 4: Identifier not declared in the current scope
Godot Engine v4.7.2.stable.mono.official.ed1daf0bf - https://godotengine.org
SCRIPT ERROR: Parse Error: Identifier "StreamCubemapArray" not declared in the current scope. Did you mean to use "CompressedCubemapArray"?
at: GDScript::reload (res://answers/streamcubemaparray-in-godot-4/repro.gd:4)
ERROR: Failed to load script "res://answers/streamcubemaparray-in-godot-4/repro.gd" with error "Parse error".
at: load (modules/gdscript/gdscript_resource_format.cpp:46)Fix it
Use CompressedCubemapArray. The script prints the class, its parent classes, and its layered type.
extends Node
func _ready() -> void:
var sky := CompressedCubemapArray.new()
print(sky.get_class())
print("parent: ", ClassDB.get_parent_class("CompressedCubemapArray"))
print("grandparent: ", ClassDB.get_parent_class("CompressedTextureLayered"))
print("cubemap array: ", sky.get_layered_type() == TextureLayered.LAYERED_TYPE_CUBEMAP_ARRAY)
What the fixed script prints
Godot Engine v4.7.2.stable.mono.official.ed1daf0bf - https://godotengine.org
CompressedCubemapArray
parent: CompressedTextureLayered
grandparent: TextureLayered
cubemap array: trueRun this fix with your agent
Flockbay is the Godot editor with an AI agent built in. Paste this into Flockbay's chat, or into Claude Code or Codex connected to Flockbay over MCP: the agent finds the cause in your project, applies the fix, runs the game headless and reads Godot's output to check it.
More on this: Physics2DServerSW in Godot 4: Identifier "Physics2DServerSW" not declared
My Godot project was written for Godot 3 and Godot 4 stops on this: "Parse Error: Identifier "StreamCubemapArray" not declared in the current scope. Did you mean to use "CompressedCubemapArray"?". Port every use to Godot 4. StreamCubemapArray is called CompressedCubemapArray in Godot 4. A Godot 3 script that names the old class fails to parse with Identifier "StreamCubemapArray" not declared in the current scope, and Godot 4.7.2 adds Did you mean to use "CompressedCubemapArray"? Then run the game headless and check Godot's output for errors.Verified on Godot 4.7.2
Both scripts on this page were run headless on Godot 4.7.2 (4.7.2.stable.mono.official.ed1daf0bf) on 6 October 2026, and the output above is what Godot printed, unedited.
Where the check lives in Godot's source: gdscript_analyzer.cpp lines 4680 to 4687, the rename hint and the message, renames_map_3_to_4.cpp line 1604, StreamCubemapArray to CompressedCubemapArray, CompressedCubemapArray class reference.
Questions
- What about StreamCubemap?
- It took the same rename: the Godot 3 to 4 renames table maps StreamCubemap to CompressedCubemap.
- How do I load one?
- CompressedCubemapArray is loaded from a .ccubearray file that the import system creates. Its parent CompressedTextureLayered has a load method and a load_path property that take the path.
Flockbay's agent reads Godot's debugger output and fixes errors like this one in your project, on the official Godot.
Download Flockbay free