Add Vortex Mechanism or Assembly to a Unity scene

After creating a Scene and associating a Vortex Scene document, the next step is to add a Vortex Mechanism or Assembly to your Unity scene.

Vortex Synchronization with the Vortex Scene

When the Unity scene is first associated with a Vortex scene, VortexMechanism and VortexAssembly components (and their Game Objects, if necessary) are automatically created for all Vortex Mechanism and Assemblies that are present in the Vortex Scene. This will help you build a complete Unity scene rapidly. The Game Objects created automatically will be recreated if necessary, or if the Vortex Scene document has been modified in the Vortex Editor.

In some cases, the Vortex Scene may activate or deactivate a Mechanism (and or Assembly) with a Configuration. If the Mechanism is deactivated in the simulation, the Game Object associated with it will be disabled and it will appear greyed out in the Unity hierarchy.

Adding an existing Vortex Mechanism or Assembly to a Unity Scene

It is possible to add a Vortex Mechanism or Assembly to the scene directly with the Unity Editor.

Use the Vortex menu and "Add Vortex Mechanism..." or "Add Vortex Assembly...", browse to the Vortex Mechanism or Assembly document, and select it. The Mechanism or Assembly will be added to both the Unity Scene and the Vortex Scene. 

Save the Unity scene to keep your changes.

If your Mechanism has a matching prefab in your project, adding it from the menu will instantiate the prefab in your scene, instead of adding blank game objects. Read more on the use of Vortex prefabs here: How to associate prefabs and Vortex documents in a Unity project.

Duplicating the game object containing a VortexMechanism or VortexAssembly will not work correctly. The only safe way to add another instance of a Mechanism or Assembly is to use the Vortex menu.

Remove a Vortex Mechanism or Assembly from a Unity Scene

It is possible to remove a Vortex Mechanism or Assembly to the scene directly in the Unity Editor. Just delete the Game Object, it will delete either the Vortex Mechanism or Assembly in the Vortex Scene and in the Unity Scene. 

Save the Unity scene to keep your changes.

Vortex Mechanism and Assembly components

The VortexMechanism component on a Game Object indicates that this Game Object corresponds to a Vortex Mechanism from the associated Vortex scene. It also acts as root of its object hierarchy. You can see the path of the corresponding Vortex Mechanism document in the properties of the Vortex Mechanism component. 

 

The VortexAssembly component on a Game Object indicates that this Game Object corresponds to a Vortex Assembly from the associated Vortex scene. It also acts as root of its object hierarchy. You can see the path of the corresponding Vortex Assembly document in the properties of the Vortex Assembly component.