Bolt supports prefabs with some minor caveats.

Machine Source Support

Prefab InstanceEmbedMacro
Created in editor
Instantiated at runtime

As this table indicates, there is full prefab support for every type of graph except for embed graph prefab instances created in the editor.

If you use a machine with an embed graph as a prefab, the edits you make on the prefab definition will not be automatically propagated to the prefab instances. This is because it's impossible to analyze a one-to-one hierarchical tree matching for two graphs, which are not necessarily hierarchical in nature. 

Bolt will display warning messages in the inspector and in the graph window when you try to do this:


You have two options in this case:

  • Recommended: Use a macro instead of an embed.
  • Manually Revert to Prefab from the machine component  cog dropdown on every prefab instance after editing the embed graph on the prefab definition.

Differentiation vs. Override

Bolt uses a custom serialization engine, FullSerializer, instead of Unity's default serialization. This is necessary because Unity's serialization is extremely limited in terms of nesting, extensibility and coverage. For this reason, prefabs are handled a little differently.

One minor consequence of this you might notice in prefabs is that when bolding inspector labels and values, it indicates differentiation rather than override. For example, an inspector field on a prefab instance will be never be bolded if it has the same value as the prefab definition, even if it has overridden this value.

Is this article helpful for you?