The variable you read the value in to, must be a Scene variable and need to be created in the Scene Variable Editor. It is to make sure the variable is defined by the time the storage event is trying to use it. In this case, simply using the variable in event is not going to work, the variable must be created in the variable editor.
I believe it should work then.
But, I think you misunderstood the purpose of the ID and Locked variables I mentioned.
You should set the ID variable for each instance at the beginning and then use this value to identify the instance.
So for example you want to save the locked state of the first object, assuming it is ID 1 then you can reference the object in the Group name using the ID value.
“GroupLocked” + ToString(object.Variable(ID))
It is going to save GroupLocked1
So when you want to read the value for the first object with ID 1, you can use the ID value of the object to find the group storing it value.
Read “GroupLocked” + ToString(object.Variable(ID)) from storage “save” value in to locked
So if you look at the examples, this is what is happening, looping through all instances, get the ID, use the ID value to find the group, read the value from the group and use it and then move on to the next instance and do the same.
I’m not sure if I can explain this in an easy way. If we could share Functions already, I could and in-fact I have already created some functions to make this process as easy as pie, but it is not possible to share. You can find the example on my GitHub, I did not released on itch.io yet because I am waiting for the feature to be able to share or copy functions, it is just useless without the option to be able to copy or share, but take a look the events might help to get the idea:
github.com/GameTemplates/GDevel … -functions