Why can't I save values from a specific point in time?

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

I can’t save a value of a dictionary at a specific time (like for a save system with multiple save slots). All slots just update with the variable they were copied from.

It looks like this:

var current_data = {“test”: 1} “test” += 1 #every frame increase the value

var slots = {
“1” = {},
“2” = {},
}

After saving current_data to a slot (once, by pressing a button), the value in these slots keeps updating.

Here’s link to a simple project with this problem:

:bust_in_silhouette: Reply From: TheRadMatt

I found an answer - I had to use .duplicate() after the variable. It should say somewhere that this fuction can be used fort variables as well as for nodes :confused: It would be less cofusing.