Export variable to the inspector: Array of PackedScenes

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

I want to have a node that takes an Array of PackedScenes in the inspector. I am aware that previously your could do this via a export(Array, PackedScene) var scenes; however, the syntax seems to have now changed. Any clue on how to reproduce this behavior in Godot 4 would be much appreciated!

:bust_in_silhouette: Reply From: crossbito

Hi, you can achieve that with the following code:

@export var scenes: Array[PackedScene] 

Here is the documentation that provides more information on exports in GDScript:

Thanks, I appreciate the documentation reference as well!

bruhman | 2023-05-29 23:59