StreamCubemapArray in Godot 4: Identifier not declared in the current scope

By Eduardo Orellana · Updated

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.

Download for macOSDownload for Windows

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: Physics2DServerSW in Godot 4: Identifier "Physics2DServerSW" 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

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: true

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](https://github.com/godotengine/godot/blob/4.7.2-stable/modules/gdscript/gdscript_analyzer.cpp#L4680), [renames_map_3_to_4.cpp line 1604, StreamCubemapArray to CompressedCubemapArray](https://github.com/godotengine/godot/blob/4.7.2-stable/editor/project_upgrade/renames_map_3_to_4.cpp#L1604), [CompressedCubemapArray class reference](https://github.com/godotengine/godot/blob/4.7.2-stable/doc/classes/CompressedCubemapArray.xml).

More on this: AudioStreamSample in Godot 4: Identifier "AudioStreamSample" not declared

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.