2018.3 prefabs macro source vs embed vs macro source w/ embeds

Kyuu 2 years ago updated by Lazlo Bonin (Lead Developer) 2 years ago 5

I'm just wanting to wrap my head around how the prefab workflow should work, particularly with prefabs in the latest beta of Unity. I don't have any nested prefabs atm in my Bolt playground I have set up.

In terms of a machine hierarchy I understand that a prefab's initial machine must be a Macro source as prefab variations will break an embedded machine. But what about Macro sources with embedded machines? By example a State Machine macro with an embedded flow state and some transitions, do these all need to be Macro sources for prefabs or can they be embedded?

Bolt Version:
Unity Version:
Scripting Backend:
.NET Version (API Compatibility Level):

Hi Kyuu!

Good question. Embed graphs *inside* a root macro are not a problem (they're basically still "inside" the macro asset as far as Unity is concerned). You should simply make sure to always use macros on machine components directly and it should be fine.

In Bolt 2, embed graphs on machine components ("root" embed graphs) will be deprecated, so it's a good habit to start moving away from them already. :)

Hello Lazlo

You say that the nested states will become obsolete, but then how do I work with prefabs? I have each level - this is a separate prefab, which I upload via Resources.Load (), respectively, I need to store links to the children objects of this prefab. But if I switch the type to macro - then I can’t drag child objects (links to them) to the graph ...


Hi Aleksandr!

Two things here:

  • If you are dragging an object definition directly from the project hierarchy, not the scene view instance, Bolt should let you refer to a child object even in a macro. (If not, that's a bug!) But alas, as you know, Unity has had terrible prefab workflow with grand-children (more than one level deep) not being visible in the project view... So that's bad.
  • In Bolt 2, when we obsolete root embed graphs, we'll also add a much more convenient system for variables that works much like C# scripts: you'll be able to put your object references in variables on the class itself, and fill those in from the inspector.

No, I don’t need links from the project, I just need links to the child objects of the prefab, in macro - this cannot be done. Yes, I can create a separate script, and create all the links in it, but then the convenience of working with the plugin is lost.

But I checked - they (nested state machines) work fine in Unity 2018.3, although I see a warning that synchronization will not work. But in fact, everything works, in the new prefab mode (2018.3).

I am watching the discord and waiting for the alpha version of Bolt 2 to check if it is suitable for my projects.

You make a very cool plugin, thanks for your work!

Child objects of the prefab are project objects, because the prefab itself is a project object. 

If your child objects are at the first level of nesting, Unity should display them in the project view. Those can then be dragged inside the graph window itself.