Things we should not duplicate

Crispy 11 months ago in Game Creator updated by Marti (Lead Developer) 11 months ago 1

Duplicating stuff speeds things up a lot, but there seems to be some things we shouldn't duplicate, like Behavior Graphs, because they will be referencing the same data, so changing one graph will affect the other.

Another example would be game objects with local variables -- I made sure to Regen the ID when duplicating objects, although I don't know if this is necessary as this is not covered in the docs. 

Should we duplicate States?...

I think you should give us a list of the components and files we should not duplicate currently. It's given me a lot of headaches. Sometimes I want to be safe so I don't duplicate, but I might just be wasting my time (and it's not just a little time).

Unity version:
Game Creator version:

This is something we hope to address in Game Creator 2.0. The reason why you can't duplicate certain items is that Unity doesn't support what it's called Polymorphic Data Serialization. This means that if you have a list of objects, each object must be equal to the rest.

This doesn't play well with Actions, Conditions and Triggers, where each element has different properties and behaviors. The only way we can do this, is by internally creating a prefab where each action is a MonoBehavior.

However, this has its problems. Unity's adding support for Polymorphic Data Serialization in 2019.3 and in 2020.4 it should be stable enough for production.

What does all this gibberish mean? That as a rule of thumb, anything that lives in the Project Panel and has an Actions list, should not be duplicated.