Maybe You are mixing thing up
When You save a node as a .tscn file it is a shared blueprint for your instances. All nodes created from this scene using
instance()become unique, but start with the base variable You introduced in the blueprint. If You want instances to have unique values, You have to set them by code or introduce variables as
export and save instances as another scene.
Or do You mean You try to set value by code, but it gets back to 0 ?
If so, then make sure, if your variable is not set to 0 AFTER You set it to 1 ;)
for example if You set it to 1 in
init(), but class scene changes sets it to 0 in