Symptoms: I’m not sure if this is a bug or intended behavior. It seems like the properties stored in BaseSettings and VariableSettings are referencing the same resource across all instances. As a result, any changes made to one instance affect all others.
Steps to reproduce: Let’s say I have a zombie NPC scene. When I add multiple instances of this zombie into the main scene and try to change the HP of just one of them, the HP value changes for all of them—including the original (parent) zombie scene.
This makes it difficult to create slight variations of the same NPC. If I want to tweak one instance (e.g., give one zombie more HP), I currently have to create a whole new scene or game object from scratch, which isn’t very efficient.
Is there a recommended workaround for this behavior? Or is there a way to make these settings unique per instance?
Out of curiosity are you duplicating the instances via CTRL+D or right-click duplicate? If so, can you delete the duplicates and, instead of duplicating, instantiate scenes either by:
Dragging out the scene from the File System to the scene
Right-clicking on the node you want it under and click Instantiate Child Scene
Unfortunately Godot resource properties share by default on duplication. While we have provided ways around it in the visual scripting, we don’t have ways around it while placing the objects onto the scene.
I have tried all the methods above. The end result is the same.
The issue is that the Variable Settings come with a Local to Scene option. Even when using the option the result is the same. The Local to Scene option does nothing. The variables are … not variable…
Have you tried with that ‘Local to Scene’ unchecked and it still happened? When I did Bazelot Quest sample I was able to even duplicate my zombies in the forest levels and they still worked. I didn’t have that option checked though.
Ok, this makes more sense of what’s going on. I’ll check and see if this is desired or not.
Until then, in a setup state you can ‘Apply To Instance’ a variable with ChangeObjectProperty and set that action individually in the scene you place them on and they won’t share (you cannot duplicate them though):
Good news! They are fixing the Sw/Var Setting nodes to be unique when using Editable Children. Not sure what patch it will come out in, but keep your eye out for it.