I want to break the reference from one array to another so when I make changes to the latter, it doesn't update the original one

var home_players_duplicate = player_selections[home_team].duplicate()
print("home_players_duplicate? ", home_players_duplicate == player_selections[home_team]) # is true

I've also tried:

var home_players_duplicate = [] + player_selections[home_team]

..but same result.

I'm having issues as when I make changes to home_players_duplicate, it updates player_selections[home_team] too which i don't want it to do. Any ideas?

When you duplicate an array that contains references to objects, those references will be duplicated but objects themselves will not. You have to manually create object duplicates and put them in the new array.

In general if you duplicate an array of items that are references to objects, you are in charge of duplicating the objects, even in C++. A copy constructor will simplify your life.

I might suggest that you write a method on the objects in your array that you will be cloning, in order to make simplify making your clone.

a year later