In order to speed up the workflow of creating fields, inputs and outputs, Bolt 2 will allow you to promote any value port by dragging out a connection from it, then choosing one of the following promote options.
To Variable
To promote a value port to a variable, the connection has to be dragged to an empty area in the graph. Then, a Promote to Variable category will be shown in the fuzzy finder. This category will include one option for each scope of variable:
- Promote to Graph Field
- Promote to Object Field (if a Game Object is selected)
- Promote to Scene Field (if a Scene Singleton is available)
- Promote to Global Field
Choosing one of these options will:
- Create a new field definition in the matching scope’s fieldset that has the same label, type and default value (for Value Inputs) as the port
- Create a Get Field (for Value Inputs) or Set Field (for Value Outputs) unit under the cursor that references the newly created field
- Connect the Get/Set Field unit to the dragged port
To Input / Output
To promote a port to a graph input or output, the connection has to be dragged to the header of a Graph Input or Graph Output node. Confirming promotion will:
- Create a new port definition that has the same label, key, type (if applicable) and default value (if applicable) as the port
- Connect the port to the newly create Input / Output port