Changing Instance changes original Scene

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Lobonlo

Hey, started on the 3.1 tutorials (Instancing — Godot Engine (3.1) documentation in English). Ran into some problems in the first one about instancing.

Basically, changing a property of an instance also changes the value of the original, and thus, all the other instances.

I tried this in 3.0.6 and there it worked as intended. I haven’t done any changes to the settings that the tutorial hasn’t told me to so can’t really say I know what’s up with that.

:bust_in_silhouette: Reply From: kidscancode

This is due to the new PhysicsMaterial feature. Rather than each node having its own “Bounce” property, it’s contained in a PhysicsMaterial resource. This means that you can save and duplicate these physics values easily without having to add them individually. However, Resources are shared between instances so this means that unless you choose “Make Unique” on it, changing a value on one object will change it on all of them.

The tutorial is in need of some clarification to reflect this new behavior.

Resources have the option to “make local to scene” too, which is the same as making unique, but affects all instances which may not be desired on most resources.

eons | 2019-04-21 17:36