- Edited
I am developing a card game and I have a resource called "CardData" for each card that contains all the statistics. When I assign the CardData to a card in the game, I need to create a copy of the original resource and give it to the card, otherwise all the cards will have the same stats even though they should have different health values and so on. The data.duplicate() or data.duplicate(true) function does not work because it does not overwrite the variables. So my question is: How can I duplicate a resource whose variables I can modify later, without affecting all the other resources that share the same data?
EDIT: Solved. I just needed to add a @export in front of all my variables