Basically I'm trying to save the value of an array A on another variable B (the variable's names are just for example).
# A initialized elsewhere as an array
var B = A # executed once
I do that because A will be modified during the execution and I want to store its initial value for other purposes.
What happens is that B gets modified alongside with A; I've done my testings and I'm absolutely sure I store the value of A once, so B is not modified within my code.
I tried casting A's value in a String value C and it worked: C is not updated with A.
var C = String(A) # works
Is this a bug of am I missing something about GDScript? Perhaps declaring var A = []
means that A actually stores a pointer to the array's location? That would explain it, because the only thing that updates is the array stored in a memory location.
Anyway, can a person more experienced than me confirm this?