Placed instances in editor doesn't update with new declared variables

I created some objects and declared health variables for them “EnHealth” which I then placed a number of instances of in a scene.
Later, I decided to change the health variable to “EnBaseHealth” and “EnCurrHealth” to account for the initial base health and current health (for while the game runs) respectively.
But then I previewed the scene, I found that they all just disappeared. Turns out the instances that have previously been placed did not update to have the new variables. Instead they still had the previous “EnHealth” variables which were supposed to have been removed.

Also I tried to right click and select all instances and change their variables like posted here:

But it only changes the variable of one instance.
So, right now, I gotta reset each instance one by one.

Another way might be to update the variables in the events, but the previous “EnHealth” variable would still be in those old instances. While the number of instances I placed for now are still manageable, it would probably take a couple of hours or so to change them one by one, and it’s probably just a minor inconvenient thing for now. But will this come back with a vengeance to bite me in the future? I don’t really know.

So, yeah, is there any way to update multiple instances or all instances previously placed on the editor with the new variables?

Hi Levio,

Whenever you edit or add any variable on an object instance (through the left properties panel), this variable is set as instance variable and can only be changed or removed through the instance’s properties (left panel). Currently, GDevelop only lets you edit one object instance at a time.

Any variable that’s NOT edited in the instance’s properties (left panel), can be universally edited or removed for all the instances from inside the object’s properties panel.

Hope this makes sense.

1 Like

Hi insein,

Yeah, that’s what I found out the hard way. Lol.
I guess I was hoping that somewhere there’s a button I haven’t seen that says, “apply to all instances” or something to that effect. But I guess there’s wasn’t after all.
So alright, manual method it is.
Thanks for the reply.