an array of packed scenes

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By lowpolygon

How would I go about creating a public array of packed scenes ?
I tried
export (PackedScene) var packed = .
And I got some error about unable to convert type
and then I tried
export (Array) var packed =
but I cannot drag the scenes into inspector
Is there a way to create an array of specific type ?

Does anyone know the answer to this question in Godot 4? export(Array, PackedScene) is no longer valid syntax.

hunterloftis | 2023-04-07 15:01

I think I found it :

@export var my_ array:Array[PackedScene]

Bornide | 2023-04-10 06:58

:bust_in_silhouette: Reply From: Dlean Jeans

Use this:

export(Array, PackedScene) var scenes

Thank you so much.

lowpolygon | 2019-07-01 09:24

Godot 4.0 it might be :

@export var my_ array:Array[PackedScene]

Bornide | 2023-04-10 06:58