Iterating on an exported array

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

So I have code that looks like so:

export (Array) var skill_learn_id = []
var skill_list = []

func _ready():
    for i in skill_learn_id:
        skill_list.append(i)

skill_learn_id is set on the node in the editor, which just take integers.

However, when I try to do this, I get an error that says “Unable to iterate on object of type ‘Nil’”
I’m not entirely sure what’s causing this issue. I feel like it has to do with exporting the array, as it works just fine when I don’t (which is why there’s two arrays here, I used the second one as just a band-aid fix) but then I can’t have different ones for individuals. Any ideas how to get this to work?

:bust_in_silhouette: Reply From: hilfazer

Drop (Array)

See docs