Godot Version
4.6
Question
Note that I am currently using the Inspector, not code, to work with these objects/scenes.
Bear with me - this is a bit long…
I’ve made several resources (.tres), and each of them have the “Local to Scene” option checked.
I made a “pickup object” scene, and include one of these resources and then instantiate it in another scene, it behaves as expected. That is, I can change the quantity of the resource after instantiating, and it remains separate from all other instances within the same scene - so, behaves as intended.
This is fine when I use a “pickup object” scene that is intended to be a single item - like a power-up, or a weapon, or health potion. I can have multiples, and when I change a value for one of them, the others are unaffected.
However, I made a pickup that contains an array for holding multiple resources (a chest). When I instantiate the chest, I can add any number of resources and change their values.
Of course, when I instantiate another chest and add the same resources, they are still linked - changing the quantity of one resource in a chest changes the quantity of that same resource in a different chest.
I know this is normal behavior - to make them separate, the resource must be included in the ‘pickup’ scene with ‘Local to Scene’ checked prior to instancing in another scene.
My question is: Is there any way to add multiple resources to my ‘pickup’ object at design time and keep the resources ‘unlinked’?
The first thought I had was to add the possible resources to the chest scene array, all with values of ‘0’, then change the values after instantiating them into another scene.
However, this is cumbersome as I might have a dozen resources, and it may change later.
