@export var empty_spaces : PackedVector2Array
i can modify the v2 array from the editor then if i save my scene it works
but when i do from code

if Input.is_action_just_pressed("e_key") :
    empty_spaces.append(Vector2(debug_press.x,debug_press.y))
    print(empty_spaces)

i can see that vector2 gets added but sincei cant save the scene in game it doesnt persist and gets reset
this is for my level editor so i need to find a way to save the added values from code if i dont export it the array then it stops being unique to each level maybe exported variables are saved to nodes i have no idea 🐸
is there a way i can save the scene or the exported v2 array from code?

  • xyz replied to this.

    420mangojuice Make a custom resource class and define your array in there as a property. Now you can create objects of that class, initialize them with data and save/load via script using ResourceLoader::load() and ResourceSaver::save(). Instances of such class can also be easily created from within the editor, manually populated with data and saved for later use.