This is the full developer documentation for realvirtual Unity Documentation # Building Digital Twins with Unity and realvirtual.io > Welcome to the realvirtual.io documentation Welcome to realvirtual.io, the ultimate framework for Automation Concept Design, Simulation, Virtual Commissioning, and 3D Human-Machine Interface (HMI) development based on Unity. We’ve combined the power of Unity with the flexibility of realvirtual.io to empower you to create stunning 3D models for various destination platforms, including Windows, Linux, MacOS, iOS, Web GL, and Android. Want to learn more about Digital Twins and the theoretical concepts behind them? Check out this free eBook:\\ ![](/doc/unity/assets/image.png) eBook - Building scalable industrial digital twins with Unity 🔗 If you want to see it in action without any installation,\ you can check out the demo model as a WebGL build here: 🔗 Note Formerly known as game4automation, we have rebranded our product to realvirtual. With realvirtual.io you can build models like this: [](/doc/unity/assets/newdemo.mp4) Digital twin runtime ui ### Getting Started [Section titled “Getting Started”](#getting-started) To embark on your realvirtual.io journey, follow these initial steps: 1. **Install Unity and realvirtual.io**: Refer to the installation instructions for a seamless setup. 2. **Explore the Demo Scene**: Open the demo scene and run the demo model to get a firsthand look at what you can achieve with realvirtual.io. 3. **Model Building Basics**: Learn how models are structured and discover the components used in the “How to build models like this” section. 4. **Conveyor Motion and Sensor Attachment**: Check out the tutorial on making a simple conveyor move and attaching a sensor for interactive functionality. 5. **User Interface, Asset Structure, and Physics**: Dive into the basics of the User Interface, Asset Structure, and Physics. These are essential aspects covered under the “Basics” section and can be further explored in the demo model. 6. **Explore Tutorials and Demos on YouTube**: Find more helpful tutorials and demonstrations on our YouTube channel. ### Our AI digital twin assistant for GPT4 users [Section titled “Our AI digital twin assistant for GPT4 users”](#our-ai-digital-twin-assistant-for-gpt4-users) If you are GPT4 user you can use our special training GPT. 🔗 [realvirtual.io Digital Twin Assistant](https://chat.openai.com/g/g-kMH9OlAfH-realvirtual-io-digital-twin-assistant) ### realvirtual.io Community on NPM [Section titled “realvirtual.io Community on NPM”](#realvirtualio-community-on-npm) Join our community on NPM to access additional assets and examples at[ ](https://www.npmjs.com/package/com.realvirtual.community). This platform also welcomes you to contribute and share your own assets with fellow realvirtual.io users.. ### To get support [Section titled “To get support”](#to-get-support) If you require assistance, encounter a bug, or have specific requests, please utilize our support resources: * **Support Forum**: For a collaborative learning experience, visit our support forum at [realvirtual.io Forum](https://forum.realvirtual.io/). Engaging on the public forum allows others to learn alongside you. ### For developers [Section titled “For developers”](#for-developers) Developing with Unity is a dynamic and thriving experience, supported by an active developer community. Before diving into realvirtual.io specifics, we recommend exploring these valuable resources: * **Unity Documentation**: For comprehensive guidance, refer to the [Unity documentation](https://docs.unity3d.com/Manual/index.html). * **Video Tutorials**: If you prefer video-based learning, check out [Unity’s video tutorials](https://unity3d.com/de/learn/tutorials). * **Unity Forum**: Engage with the Unity community on the [Unity Forum](https://forum.unity.com/) to find solutions and insights into game development. * **realvirtual.io Class documentation:** After gaining a solid understanding of Unity fundamentals through these resources, consult the “Starting your development” section for crucial information on organizing your project and commencing your own development within realvirtual.io. Thank you for choosing realvirtual.io as your Automation Concept Design and Simulation solution. We look forward to supporting your creative journey in the world of 3D modeling and virtual commissioning. © 2025 realvirtual GmbH [https://realvirtual.io](https://realvirtual.io/) - All rights reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or by any means, including printing, saving, photocopying, recording, or other electronic or mechanical methods, without the prior written permission of the publisher. # Assembly Definitions Unity gives the possibility to organize organize Scripts into different assemblies by using Assembly Definitions. See also the Unity Documentation: 🔗 If you use external libraries within realvirtual.io which are not installed with realvirtual.io you must include these external libraries into the top assembly definition of realvirtual.io. If you are programming your own scripts, it might be necessary to include Realvirtual.io into your own assembly definition to get access to the realvirtual.io (before 2022 game4automation) assemblies.\ Game4Automation is using the following assemblies: | Assembly defintion name | Description | | -------------------------------------------- | ------------------------------------------------- | | realvirtual.base | Base assembly for all realvirtual.io functions | | realvirtual.editor | realvirtual.io functions which run in editor mode | | realvirtual.interfaces.opocua | OPCUA interface | | realvirtual.interfaces.opocua.editor | OPCUA editor mode | | realvirtual.interfaces.plcsimadvanded | PLCSIM Advanced interface | | realvirtual.interfaces.plcsimadvanded.editor | PLCSIM Advanced editor mode | | realvirtual.interfaces.s7tcpip | S7 TCPIP interface | | realvirtual.interfaces.s7tcpip.editor | S7 TCPIP editor | | realvirtual.interfaces.sharedmemory | Shared Memory interface | | realvirtual.interfaces.sharedmemory.editor | Shared Memory editor | | realvirtual.cadlink | CADlink | | | | \\ # Class documentation Class documentation for developers can be found here: 🔗 # Compiler Defines realvirtual.io uses some compiler defines (also called Scripting Define Symbols) for managing different configurations. Compiler defines are switches which can be set to define which part of the C# source code are compiled or not. Sometimes it is necessary to use compiler defines to prevent unwanted compiler error messages.\ Which compiler defines needs to be set is depended on the Assets you purchased (realvirtual.io Starter, realvirtual.io Professional). Most compiler defines are usually created automatically once you install the realvirtual.io Asset. You can reset the realvirtual.io settings, including the compiler defines, by selecting `Tools > realvirtual > Apply standard settings`: ![](/doc/unity/assets/rvStandardSetting.png) You can find the current compiler defines under *`File > Build Settings > Player Settings > Other Settings > Scripting Define Symbols:`* ![](/doc/unity/assets/rvPlayerSettings.png) *`Compiler Defines (example setup - only use what is needed in your installation)`* Note Some interfaces are needing special Complier Defines - this is mentioned on the Interface documentation page. Here is a list and description of the used compiler defines. (before 2022 - GAME4AUTOMATION) | Compiler Define | Description | | ------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `REALVIRTUAL` | Standard compiler define which needs to be set to enable realvirtual.io Standard and professional | | `REALVIRTUAL_PROFESSIONAL` | Compiler define which needs to be set only for realvirtual.io Professional. The standard setting of the compiler defines for realvirtual.io Professional is GAME4AUTOMATION; GAME4AUTOMATION\_PROFESSIONAL | | `REALVIRTUAL_PLAYMAKER` | This compiler define needs to be set to be able to use the realvirtual.io Playmaker nodes. These nodes are only included in Professional version. You should set this define only if Playmaker is installed. See [Broken link](/doc/unity/advanced-topics/broken-reference/ "mention") | | `OPCUA4UNITY` | Compiler Define for [opcua.md](/doc/unity/components-and-scripts/interfaces/opcua/ "mention") | | `REALVIRTUAL_VISCUALSCRIPTING` | Compiler Define if Unity Visual Scripting package is installed and should be used by realvirtual.io. See [unity-visual-scripting.md](/doc/unity/components-and-scripts/defining-logic/unity-visual-scripting/ "mention") | | `CINEMACHINE` | Compiler Define if Unitys Cinemachine is installed and should be used. | | `REALVIRTUAL_AGX` | Turns on AGX Phyisics simulation capabilites in realvirtual.io if AGX Unity Plugin is installed | | `REALVIRTUAL_BESTHTTP` | Needed for BestHTTPV2 based interfaces like [twincat-hmi.md](/doc/unity/components-and-scripts/interfaces/twincat-hmi/ "mention") or [mqtt.md](/doc/unity/components-and-scripts/interfaces/mqtt/ "mention") | | `REALVIRTUAL_BESTMQTT` | Needed for BESTMQTT v1 base interfaces like [mqtt.md](/doc/unity/components-and-scripts/interfaces/mqtt/ "mention") | | `REALVIRTUAL_JSON` | Needed for JSON based interfaces like [twincat-hmi.md](/doc/unity/components-and-scripts/interfaces/twincat-hmi/ "mention") | | `REALVIRTUAL_BESTHTTP3` | Needed for BestHTTP V3 based interfaces like [twincat-hmi.md](/doc/unity/components-and-scripts/interfaces/twincat-hmi/ "mention") or [mqtt.md](/doc/unity/components-and-scripts/interfaces/mqtt/ "mention") | | `REALVIRTUAL_BESTMQTT3` | Needed for BESTMQT V3 based interfaces like [mqtt.md](/doc/unity/components-and-scripts/interfaces/mqtt/ "mention") | | REALVIRTUAL\_CUTTER | For the use of [Cutter ](/doc/unity/components-and-scripts/changing-mus/cutter/)component | | REALVIRTUAL\_TEST | Needs to be set if [Test automation](/doc/unity/advanced-topics/for-developers/testing/) should be used and Unity Test Framework is installed. | | REALVIRTUAL\_BURST | Needs to be set if Contact Detection should be used in the [Kinematic Tool](/doc/unity/basics/user-interface/kinematic-tool-pro/) and if Unity Burst Compiler package is installed. | \\ # For Developers In this section you find special information for developers. # Important Classes and Interfaces ## realvirtualBehavior [Section titled “realvirtualBehavior”](#realvirtualbehavior) #### Starting and Stopping Simulation [Section titled “Starting and Stopping Simulation”](#starting-and-stopping-simulation) The **realvirtualBehavior** class incorporates a **public bool ForceStop** property that can be accessed by all derived components. This property informs components whether the simulation is currently halted. The value of **ForceStop** is controlled by the **public SetForceStop(bool forcestop)** method, typically invoked by **realvirtualController**. Developers can customize the behavior of their components based on the simulation status by overriding two functions: * **OnStop()**: This function is called when the simulation is stopped. Developers can implement custom logic to execute specific actions when the simulation halts. * **OnStart()**: This function is invoked when the simulation starts. It allows developers to define custom logic that runs when the simulation resumes after being stopped. These functions provide flexibility for implementing unique behaviors tailored to the simulation’s current operational state within the **realvirtualIO** framework. ![](/doc/unity/assets/image%20\(21\).png) ## realvirtualBehaviorInterface [Section titled “realvirtualBehaviorInterface”](#realvirtualbehaviorinterface) #### implements ISignalInterface [Section titled “implements ISignalInterface”](#implements-isignalinterface) ![](/doc/unity/assets/image%20\(20\).png) ## realvirtualInterfaceBaseClass [Section titled “realvirtualInterfaceBaseClass”](#realvirtualinterfacebaseclass) ![](/doc/unity/assets/image%20\(23\).png) # realvirtual Init Sequence > Only Version 6.1.4+ Unity’s default execution order provides a solid foundation for initialization but often lacks the granular control needed for complex scenarios—particularly when integrating third-party solutions, orchestrating sequence events across different GameObjects, or dealing with additive scene loading. To address these challenges, **realvirtual** introduces an additional initialization sequence managed by the **realvirtualController**. *** ### Overview [Section titled “Overview”](#overview) By extending Unity’s built-in lifecycle, **realvirtual** ensures a more predictable and step-by-step setup process across complex multi-scene projects. This is especially helpful for coordinating dependencies among third-party plugins, custom systems, and multi-scene workflows. The extended lifecycle adds five main phases: 1. **InitStart** 2. **InitAwake** 3. **InitEnable** 4. **InitAllScenesLoaded** 5. **InitPostAllScenesLoaded** Each phase is opt-in; you only need to implement the corresponding interface or override the provided method in your scripts. > **Debugging Tip**\ > You can enable **DebugMode** on the **realvirtualController** (e.g., via the Inspector) to see detailed console logs showing the exact sequence of calls. This is especially useful if you need to confirm your **InitStart**, **InitAwake**, **InitEnable**, and **InitAllScenesLoaded** methods are running at the expected times. ![](/doc/unity/assets/debugmode.png) *** ### Sequence Flow [Section titled “Sequence Flow”](#sequence-flow) 1. **Scene Load (Unity)** 2. **realvirtualController Recognition** 3. **InitStart → InitAwake → InitEnable → (Additive Scenes Load) → InitAllScenesLoaded → InitPostAllScenesLoaded** Below is a closer look at each phase. *** ### 1. InitStart [Section titled “1. InitStart”](#1-initstart) * **Triggered When**: The **realvirtualController** is first recognized. * **Key Tasks**: * Reads and applies any saved settings (e.g., `DebugMode`, `ConnectionMode` from `PlayerPrefs`). * Invokes any script that implements the `IInitStart` interface. #### Code Example [Section titled “Code Example”](#code-example) ```csharp using realvirtual; using UnityEngine; public class MyInitStartExample : MonoBehaviour, IInitStart { public void OnInitStart() { // Perform essential setup, e.g., loading configuration from PlayerPrefs Debug.Log("InitStart: Essential setup complete."); } } ``` *** ### 2. InitAwake [Section titled “2. InitAwake”](#2-initawake) * **Triggered When**: **realvirtualController**’s standard Awake method is called. * **Key Tasks**: * Unity’s standard `Awake()` can happen before or after this, depending on Unity’s internal ordering. * Use `IInitAwake` for additional initialization logic that should pair with Unity’s Awake but be orchestrated by **realvirtualController**. #### Code Example [Section titled “Code Example”](#code-example-1) ```csharp using realvirtual; using UnityEngine; public class MyInitAwakeExample : MonoBehaviour, IInitAwake { public void OnInitAwake() { // Perform Awake-like setup, e.g., references or data initialization Debug.Log("InitAwake: More initialization logic here."); } } ``` *** ### 3. InitEnable [Section titled “3. InitEnable”](#3-initenable) * **Triggered When**: **realvirtualController** is enabled (similar to Unity’s `OnEnable()`). * **Key Tasks**: * Standard `OnEnable()` may occur before or after this, again depending on Unity’s internal ordering. * Regardless of the active status of your script derived from `realvirtualBehavior`, this will still be called. #### Code Example [Section titled “Code Example”](#code-example-2) ```csharp using realvirtual; using UnityEngine; public class MyInitEnableExample : MonoBehaviour, IInitEnable { public void OnInitEnable() { // Setup activation-related logic, e.g., attaching event listeners Debug.Log("InitEnable: Components are ready to be enabled."); } } ``` *** ### 4. InitAllScenesLoaded [Section titled “4. InitAllScenesLoaded”](#4-initallscenesloaded) * **Triggered When**: All scenes (including additive scenes) have been loaded. * **Key Tasks**: * If no additional scenes are loaded, this runs immediately after `InitEnable`. * Typically used for final cross-scene references or enabling/disabling systems that depend on every scene being ready. * Implement `IAllScenesLoaded` or override `OnAllScenesLoaded` in your `realvirtualBehavior`. #### Code Example [Section titled “Code Example”](#code-example-3) ```csharp using realvirtual; using UnityEngine; public class MyAllScenesLoadedExample : realvirtualBehavior, IAllScenesLoaded { public void OnAllScenesLoaded() { // Access objects across multiple scenes, finalize cross-scene references, etc. Debug.Log("All Scenes Loaded: Multi-scene references can now be set up."); } // If overriding in realvirtualBehavior, you can also do: // protected override void OnAllScenesLoaded() { ... } } ``` *** ### 5. InitPostAllScenesLoaded [Section titled “5. InitPostAllScenesLoaded”](#5-initpostallscenesloaded) * **Triggered When**: Immediately after `InitAllScenesLoaded`. * **Key Tasks**: * Allows “late-late” initialization logic—when you want to ensure everything in `InitAllScenesLoaded` (including other scripts) has completed. #### Multi-Phase Example [Section titled “Multi-Phase Example”](#multi-phase-example) Below is an example of a script that handles multiple phases by implementing multiple interfaces: ```csharp using UnityEngine; using realvirtual; public class MyMultiStageScript : MonoBehaviour, IInitStart, IInitAwake, IInitEnable, IAllScenesLoaded { public void OnInitStart() { Debug.Log("OnInitStart: Reading configuration..."); } public void OnInitAwake() { Debug.Log("OnInitAwake: Setting up references..."); } public void OnInitEnable() { Debug.Log("OnInitEnable: Attaching event listeners..."); } public void OnAllScenesLoaded() { Debug.Log("OnAllScenesLoaded: Final cross-scene linking..."); } } ``` *** ### Summary of Customizable Methods [Section titled “Summary of Customizable Methods”](#summary-of-customizable-methods) | Method / Interface | Description | | ----------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | | **InitStart**`IInitStart` | Earliest moment after the **realvirtualController** is recognized. Useful for reading config or setting global states. | | **InitAwake**`IInitAwake` | Pairs with Unity’s `Awake()` for orchestrated initialization. | | **InitEnable**`IInitEnable` | Pairs with Unity’s `OnEnable()`, for activation-related logic. | | **InitAllScenesLoaded**`IAllScenesLoaded` | Ensures all scenes (including additive scenes) are loaded before proceeding. Ideal for cross-scene references. | | **InitPostAllScenesLoaded** | Late-late initialization after all scenes and logic in `InitAllScenesLoaded`. | # realvirtualBehavior Lifetime Methods When you inherit from **realvirtualBehavior** in your scripts, the **realvirtualController** automatically invokes several core lifecycle methods at key moments. This mechanism ensures a consistent flow for starting, stopping, and updating your simulation logic. *** ### Overview of Methods [Section titled “Overview of Methods”](#overview-of-methods) 1. **AwakeAlsoDeactivated()** * Called by **realvirtualController** in its own `Awake()` method. * Runs even if the `realvirtualBehavior` component (or its GameObject) is not active. * Ideal for any early setup logic that normally would run in `Awake()`, but needs to occur even if disabled. 2. **PreStartSim()** * Called once **realvirtualController** is ready to start the simulation. * Use this to finalize any pre-simulation configuration, such as resetting positions or clearing caches. 3. **StartSim()** * Immediately after **PreStartSim()**. * Begin your runtime logic here—start animations, open connections, spawn objects, etc. 4. **StopSim()** * Called when the simulation is being paused or stopped (for instance, via the pause button). * Ideal for halting coroutines, stopping movements, and closing any active connections. *** ### Typical Flow [Section titled “Typical Flow”](#typical-flow) 1. **realvirtualController.Awake()** * Calls `AwakeAlsoDeactivated()` on every `realvirtualBehavior`. 2. **realvirtualController.Start()** * Eventually calls `StartSim()` (after running `PreStartSim()`). 3. **realvirtualController.Pause() / StopSim()** * Invokes `StopSim()` on every `realvirtualBehavior`. Here’s a simplified timeline: ```plaintext Unity Loads Scene └──> realvirtualController: Awake() ├──> Calls AwakeAlsoDeactivated() on all realvirtualBehavior scripts └──> Additional Initialization Steps Later, realvirtualController: Start() ├──> PreStartSim() on all realvirtualBehavior └──> StartSim() on all realvirtualBehavior When Pausing or Stopping: └──> StopSim() on all realvirtualBehavior ``` *** ### Example Script [Section titled “Example Script”](#example-script) Below is an example of how you might extend `realvirtualBehavior` to respond to these calls: ```csharp using UnityEngine; namespace realvirtual { // Inherit from realvirtualBehavior public class MyMachine : realvirtualBehavior { // Called by the controller in Awake(), even if 'MyMachine' is not active public override void AwakeAlsoDeactivated() { base.AwakeAlsoDeactivated(); Debug.Log("MyMachine: AwakeAlsoDeactivated - Basic setup done."); } // Called just before the simulation actually starts public override void PreStartSim() { Debug.Log("MyMachine: PreStartSim - Final checks before sim begins."); } // Called immediately after PreStartSim public override void StartSim() { Debug.Log("MyMachine: StartSim - Simulation logic begins."); } // Called when the simulation is being paused or stopped public override void StopSim() { Debug.Log("MyMachine: StopSim - Cleaning up and halting movements."); } } } ``` *** ### When to Use These Methods [Section titled “When to Use These Methods”](#when-to-use-these-methods) * **AwakeAlsoDeactivated()** * Use for setting references or configuration that must exist **regardless** of the GameObject’s active state. * Useful for bridging dependencies or preparing data needed by other scripts. * **PreStartSim()** * Use for last-minute preparation just before the simulation becomes “live.” * E.g., ensuring internal caches or object pools are ready, resetting the environment, etc. * **StartSim()** * Your “go” signal for the main logic—starting animations, enabling physics-based behaviors, or beginning timers. * **StopSim()** * Graceful shutdown: stopping animations, saving states, cleaning up. * Called when the user pauses, or the simulation is otherwise halted by **realvirtualController**. *** ### Debugging with DebugMode [Section titled “Debugging with DebugMode”](#debugging-with-debugmode) By enabling **DebugMode** on the **realvirtualController**, you will see logs in the Unity console showing precisely when each of these methods is invoked. This is an excellent way to confirm: * Whether your scripts are receiving these calls in the expected order. * If certain scripts remain disabled and thus never receive the calls. ### # Testing > Test automation for Digital Twins Based on Unity’s test automation framework (more information can be found in the [Unity documentation](https://docs.unity3d.com/Packages/com.unity.test-framework@1.4/manual/index.html)), we have integrated a testing extension for our customers. All test scenes are defined in a scriptable asset, allowing you to extend tests by adding additional scenes as needed. We provide two standard test tools: 1. **Counting Destroyed MUs on Sinks**: Verifies the number of Modular Units (MUs) destroyed on sinks. 2. **Counting MUs Passed on a Sensor**: Counts the number of MUs that pass through a sensor. Please note that physics behavior may vary across different computers, so test results may differ between your machine and our testing environment. The realvirtual.io test extension allows you to define tests without the need for programming custom scripts or logic. ## Prerequisites [Section titled “Prerequisites”](#prerequisites) By default, testing is not enabled as it requires additional Unity packages. To enable testing: 1. **Install Unity Test Framework**: * Install **Unity Test Framework Version 1.1.33** via the Unity Package Manager. ![](/doc/unity/assets/testing-packagemanager%20\(1\).png) Installing Unity Test Framework via Unity Package Manager 2. **Set Compiler Define**: * Navigate to **Project Settings** > **Player**. * Under **Scripting Define Symbols**, add `REALVIRTUAL_TESTS`. ![](/doc/unity/assets/testing-projectsettings%20\(1\).png) Enable testing in the Project Settings ## Test window [Section titled “Test window”](#test-window) After enabling testing as described above, follow these steps to run and manage your tests: 1. **Open the Test Window**: * Select **Testing** from the **realvirtual.io** main menu. This will open a new window displaying all defined tests. ![](/doc/unity/assets/testing-ok.png) Testing window with successfull tests 2. **View Test Status**: * Tests that have passed successfully will be indicated by green buttons. * Tests that have failed will be shown with red buttons, and a message will provide additional information. ![](/doc/unity/assets/testing-failure.png) Test window with failures 3. **Run Tests**: * Click the **“Run Tests”** button to execute all defined tests. * If a test fails, you can select the test button to open the scene associated with the test. 4. **Filter Tests**: * You can define filters to narrow down the tests displayed. * When filters are applied, only the filtered tests will be executed when you select **“Run Tests”**. ## Defining your own tests [Section titled “Defining your own tests”](#defining-your-own-tests) To define your own tests, follow these steps: 1. **Create a Test Scene List**: * In the Unity Project window, right-click in the desired project folder. * Select **Create** > **realvirtual** > **TestScenes** from the context menu. 2. **Default Test Scenes**: * The default test scenes provided are located under `realvirtual > private > Resources > Testing`. Add each test scene you wish to include in your testing setup. For each scene listed, ensure the “Run Scene” checkbox is set to **true**. This setting specifies that the scene should be executed as part of the test process. ![](/doc/unity/assets/testing-demoscenescriptableasset%20\(1\).png) Standard test scenes The testing window will automatically detect all **Test Scene List** assets in your project. ## Preparing a Scene for Tests [Section titled “Preparing a Scene for Tests”](#preparing-a-scene-for-tests) To prepare a scene for testing, you need to include a **Test Model Controller** in each test scene. You can add this controller to your project by using the prefabs located under `realvirtual > private > Resources > Testing`. **Test Model Controller** The **Test Model Controller** manages several test parameters: * **Run Test**: Determines if the test should be executed. * **TimeScale**: Adjusts the speed at which the test runs, allowing it to run faster or slower than real time. * **Test Time**: Specifies the duration of the test in seconds. * **Fixed Timestep**: Sets the fixed timestep to be used during the test. You can manually start the test by selecting **Run Test** (this applies only to the current scene). The **Test Model Controller** will also call all methods implementing the `ITestCheck` interface. **Standard `ITestCheck` Implementations** We provide two standard implementations of the `ITestCheck` interface: * **TestSensorCount**: Counts the Modular Units (MUs) passing through sensors where `TestSensorCount` is attached. The **Test Model Controller** automatically checks all `TestSensorCount` components in the scene. * **TestSinkCount**: Counts the MUs destroyed by sinks where `TestSinkCount` is attached. The **Test Model Controller** automatically checks all `TestSinkCount` components in the scene. ## Implementing Your Own `ITestCheck` [Section titled “Implementing Your Own ITestCheck”](#implementing-your-own-itestcheck) To create a custom `ITestCheck` implementation, follow these steps: 1. **Create a New MonoBehaviour**: Implement the `ITestCheck` interface in a new MonoBehaviour script. 2. **Implement the `Check` Method**: Define the `Check` method to return an empty string if the test is successful, or a descriptive message if the test fails. Here’s a sample implementation of a custom `ITestCheck` for counting sensor events: ```csharp namespace realvirtual { using NaughtyAttributes; using UnityEngine; public class TestSensorCount : MonoBehaviour, ITestCheck { [InfoBox("This is just for internal realvirtual.io Development and Test automation", EInfoBoxType.Warning)] public int DueSensorCount; // Expected count of MUs passing the sensor public int Tolerance = 0; // Allowed tolerance in the count public string Check() { // Get the current count of MUs passing the sensor var counter = GetComponent().Counter; // Calculate the difference between the expected and actual count int difference = Mathf.Abs(counter - DueSensorCount); // Check if the count is within the allowed tolerance if (difference <= Tolerance) { return ""; // Test passed } else { // Return a descriptive failure message if (Tolerance == 0) return "Sensor count at " + this.name + " is " + counter + " but should be " + DueSensorCount; else return "Sensor count at " + this.name + " is " + counter + " but should be within " + Tolerance + " of " + DueSensorCount; } } } } ``` #### Key Points [Section titled “Key Points”](#key-points) * **Attach to Component**: You can attach this script to any relevant component in your scene. * **Automatic Invocation**: The `Check` method will be called automatically by the `Test Model Controller` once the test time is finished. * **Success and Failure**: Return an empty string for a successful test or a descriptive message if the test fails. By implementing your own `ITestCheck` classes, you can extend the testing capabilities to fit your specific needs. # Improving Performance ## Introduction[](#introduction) [Section titled “Introduction ”](#introduction) Unity is a very powerful platform and you can reach much higher simulation and visualization performance than in most traditional engineering tools. But you can still reach performance limits with models and scenes with 10 millions and more triangles. Unity provides a lot of things to improve. We describe here just our experience and our performance recommendations but there are for sure a lot of additional things you can do for improving performance. ## Quick overview [Section titled “Quick overview ”](#quick-overview) Please always follow these rules - in order of the importance Note Use **lowest possible mesh quality** when importing the CAD data. You should always take care about that first - changing later on could be quite some work Do you want to create **reusable components** - export them as an FBX after export - or is it just a one time CAD model import and you don’t need to create a prefab? Set Gameobject **static settings** for everything which is not moving Use not more than **3 lights in a scene** If you are an expert, change the render pipeline to **URP** (see below) Replace the imported instantiated Material after the CAD import by **shared Materials** (Materials which are shared by all the meshes and which you can find in the Assets folder) - you can use [MaterialWindow](/doc/unity/basics/user-interface/material-window-pro/) (only available in Professional version) or [SelectionWindow](/doc/unity/basics/selection-window/) for quickly assigning new materials. **Combine meshes** which are in one kinematic hierarchy or which are not moving to one mesh by using the [Performance Optimizer](/doc/unity/advanced-topics/improving-performance/#performance-optimizer) (only available in Professional version) ## Gameobject Static settings [Section titled “Gameobject Static settings”](#gameobject-static-settings) Note This is a very important setting with high performance impact - you should consider this always. This is the most important performance recommendation. You should set all objects which are not moving (e.g. connected to a Drive) to Static. ![](/doc/unity/assets/performance-static.png) Static settings on non moving Gameobjects ## Changing Physics Settings [Section titled “Changing Physics Settings”](#changing-physics-settings) You could also change the physics settings, e.g. the fixed update cycle time, to improve performance. More information can be found in section [physics.md](/doc/unity/basics/physics/ "mention") ## Simplifying meshes [Section titled “Simplifying meshes”](#simplifying-meshes) The number of triangles in total in your project has also a huge performance impact. You should only import CAD data which are needed and you should simplify the meshes as much as possible. In smaller projects you don’t need to care about that, because Unity is per formant enough to visualize a lot of meshes. But if your project reaches more than 1 million meshes and if you encounter graphic cycle times bigger than 50ms you should thing about improving the performance of you meshes. For improving the performance please follow these steps. ### Importing [Section titled “Importing”](#importing) You should use a mesh quality while importing (e.g. with [CADLink](https://game4automation.com/documentation/current/cadlink.html)) which is good enought for a good visual appearance but not to high. ### Checking your meshes with CADChecker (Professional version only) [Section titled “Checking your meshes with CADChecker (Professional version only)”](#checking-your-meshes-with-cadchecker-professional-version-only) With [CADChecker](https://game4automation.com/documentation/current/cadchecker.html) you can analyze your meshes, find the biggest ones where performance improvements makes sense and detect unnecessary duplicates. You should first optimize the meshes of your [MUs](https://game4automation.com/documentation/current/mu.html) and the bigger meshes of non static moving objects. ### Simplifying already imported meshes [Section titled “Simplifying already imported meshes”](#simplifying-already-imported-meshes) If you already imported your CAD data and you want to simplify single meshesy you can use 3rd party tools like for example Mesh Simplify (see ) ## Lights and shadows [Section titled “Lights and shadows”](#lights-and-shadows) ights and shadows play a critical role in creating immersive visual experiences in Unity, but they also have a significant impact on performance, especially when calculated dynamically by non-static objects during simulation. When considering performance optimization: * **Reducing the Number of Lights**: Each light source in Unity adds computational overhead, as each light calculates its influence on objects within its range. By minimizing the number of active lights in your scene, you can alleviate this burden on the CPU and GPU, thereby improving overall performance. Evaluate whether all lights are necessary and consider combining multiple lights or using baked lighting where feasible. * **Disabling Shadows**: Shadows cast by lights enhance realism but can also be computationally expensive, especially when calculated in real-time for moving objects. Disabling shadows for lights can significantly reduce GPU workload. If visual fidelity allows, consider turning off shadows or adjusting shadow settings to balance visual quality with performance. * **Static and Baked Lighting**: Utilizing static lighting and baked shadows can provide substantial performance benefits. Static objects and environments can be precomputed for lighting and shadows, reducing runtime calculations during simulation. This approach is particularly effective for scenes with mostly static elements where real-time lighting calculations are unnecessary. * **Optimizing Light Settings**: Unity offers various light settings and parameters that can be adjusted to balance visual quality and performance. Experiment with light intensity, range, and attenuation settings to achieve the desired visual effect while minimizing performance impact. ## Colliders [Section titled “Colliders”](#colliders) In Unity, colliders play a crucial role in determining how objects interact with each other within the game world. When considering colliders, the choice between using Box Colliders and Mesh Colliders can significantly impact performance. **Box Colliders** are simple geometric shapes that approximate the bounds of an object using axis-aligned bounding boxes. They are efficient because they require minimal computational resources to calculate collisions. Box Colliders are ideal for objects with simple shapes like cubes or rectangular prisms, where the shape closely matches the collider. **Mesh Colliders**, on the other hand, use the actual mesh geometry of an object to define collision boundaries. This provides precise collision detection for complex shapes that cannot be accurately represented by primitive colliders like boxes or spheres. However, Mesh Colliders are computationally more expensive because they require detailed mesh data for collision calculations. This can impact performance, especially when used on numerous objects or complex meshes. **Impact on Unity Performance:** * **Box Colliders** are lightweight and efficient, making them suitable for objects with simple shapes. They contribute minimally to performance overhead, making them a preferred choice in scenarios where precise collision detection is not crucial. * **Mesh Colliders**, while offering accurate collision detection for complex shapes, can introduce performance overhead due to the computational resources required to process collisions based on detailed mesh data. Using Mesh Colliders extensively or on high-polygon models can lead to increased CPU usage and reduced frame rates, impacting overall game performance. **Best Practices:** * **Use Box Colliders** for objects with simple shapes whenever possible to optimize performance. * **Consider Mesh Colliders** only when precise collision detection is necessary for complex geometry that cannot be approximated by primitive colliders. * **Optimize Mesh Colliders** by simplifying mesh geometry where feasible to reduce computational load without sacrificing collision accuracy. ## Changing the rendering pipeline to Universal Render Pipeline [Section titled “Changing the rendering pipeline to Universal Render Pipeline”](#changing-the-rendering-pipeline-to-universal-render-pipeline) Note Universal Render pipeline is a little bit more complex than standard Render Pipeline. You should use it, when you need very good performance and very good visual quality. Caution Please note that this section is outdated. It explains the manual process of switching render pipelines which you can still do but since version 2022.11 you can automatically switch - for more information see section [Render Pipelines](/doc/unity/advanced-topics/render-pipelines/) Our experience is, that by changing your project to Universal Rendering Pipeline you can improve your performance about 30%. But you should do this only if you are already a Unity expert and if you really need the additional performance. You should follow these steps to change to Universal Rendering Pipeline. For more information please check the Unity online documentation. #### Install URP [Section titled “Install URP”](#install-urp) * Open the Package Manager window (*Window > Package Manager*). * In the Package Manager window, in the Packages field, select Unity Registry. * Select Universal RP from the list of packages. * In the bottom right corner of the Package Manager window, select Install. Unity installs URP into your Project. #### Creating the Universal Render Pipeline Asset [Section titled “Creating the Universal Render Pipeline Asset”](#creating-the-universal-render-pipeline-asset) The Universal Render Pipeline Asset controls the global rendering and quality settings of your Project, and creates the rendering pipeline instance. The rendering pipeline instance contains intermediate resources and the render pipeline implementation. To create a Universal Render Pipeline Asset: * In the Editor, go to the Project window. * Right-click in the Project window, and select Create > Rendering > Universal Render Pipeline > Pipeline Asset. Alternatively, navigate to the menu bar at the top, and select *Assets > Create > Rendering > Universal Render Pipeline > Pipeline Asset*.\ You can either leave the default name for the new Universal Render Pipeline Asset, or type a new one. #### Adding the Asset to your Graphics settings [Section titled “Adding the Asset to your Graphics settings”](#adding-the-asset-to-your-graphics-settings) To use URP, you need to add the newly created Universal Render Pipeline Asset to your Graphics settings in Unity. If you don’t, Unity still tries to use the Built-in render pipeline.\ To add the Universal Render Pipeline Asset to your Graphics settings:\ Navigate to *Edit > Project Settings… > Graphics*.\ In the Scriptable Render Pipeline Settings field, add the Universal Render Pipeline Asset you created earlier. When you add the Universal Render Pipeline Asset, the available Graphics settings immediately change. Your Project is now using URP. #### Upgrade your Shaders [Section titled “Upgrade your Shaders”](#upgrade-your-shaders) Your Project uses shaders from the built-in render pipeline, and you want to switch your Project to use the Universal Render Pipeline instead, you must convert those Shaders to the URP Shaders. Open your Project in Unity, and go to Edit > Render Pipeline > Universal Render Pipeline.\ According to your needs, select either Upgrade Project Materials to URP Materials or Upgrade Selected Materials to URP Materials. > If the Preview thumbnails in Project View are incorrect after you’ve upgraded, try right-clicking anywhere in the Project View window and selecting Reimport All. #### Change the Shaders in your scenes [Section titled “Change the Shaders in your scenes”](#change-the-shaders-in-your-scenes) You might still see pink objects in your scene. This is because the materials in your scene might still have a standard shader set.\ You need to change all your materials in your scene to a new URP shader like for example *Universal Render Pipeline/Lit*. ![](/doc/unity/assets/performance-shader.png) Universal render pipeline shader You can do this manually but for bigger models you can use the [Selection Window](https://game4automation.com/documentation/current/selectionwindow.html) to automatically change the Shaders of all selected Gameobjects. \\ ![](/doc/unity/assets/performance-changeshader.png) Changing shaders to new render pipeline in scene with SelctionWindow ## Profiler [Section titled “Profiler”](#profiler) For experts, Unity has an included Profiler. It is possible to measure all frames and to identify what functions are needing the most part of the time. Unity Profiler is started by `Window > Analysis > Profiler` ![](/doc/unity/assets/performance-profiler.png) `Profiler for analyzing in detail performance bottlenecks` See more in Unitys documentation about the Profiler: 🔗 ## Performance Optimizer (only included in Professional Version) [Section titled “Performance Optimizer (only included in Professional Version)”](#performance-optimizer-only-included-in-professional-version) The Performance Optimizer is a component that you can add to your imported CAD geometries. It combines meshes into a mesh with multiple materials to improve the runtime performance of your scene. The original meshes will be set inactive during the process. This combined mesh can be saved as a separate object. This object can then also be defined as static to achieve further improvements. You can also define kinematic groups to be included in the combined mesh. For further optimisation, you can also delete meshes that are represented by the combined mesh. Be aware that the undo-function don’t cover the rebuild if deleted meshes. ![](/doc/unity/assets/performanceoptimizer%20\(1\).png) Performance Optimizer #### Properties [Section titled “Properties”](#properties) **Create sub object for mesh:** this option will create an empty game object to store the merged meshes.\ **Create static mesh:** the new created mesh will static. A static will only be caculated ones during runtime.\ **Include non static elements:** the merged mesh will also include non static meshes. Non-static meshes belong to objects that can be moved or move themselves during runtime.\ **Exclude groups:** Objects with the component group are not considered in the merge.\ **Delete combined meshes:** the original meshes used for the combined mesh are deleted after merging. Attention: This function CANNOT be undone.\ **Included groups for mesh optimizer:** Within this list you can define groups whose meshes may be merged.\ \ The Button “Optimize Meshes” starts the optimisation. The button “Undo mesh optimize” dissolves the newly created mesh. # Mixed Reality with Meta Quest3 > Using realvirtual.io and Meta Quest 3 - A Quick Guide The Meta Quest 3 stands as an affordable and versatile Mixed Reality device, streamlining the development process for immersive applications. However, the plethora of installations and dependencies can sometimes pose a challenge. To mitigate this, we offer a concise, step-by-step guide detailing the essential steps for building applications for the Meta Quest XR Device. [Example application created with Meta Quest 3 ](https://www.youtube-nocookie.com/embed/JIZQmuc4O2Y) Example application created with Meta Quest 3 **Key Features of Meta Quest 3:** * **Standalone Capability**: Supports both local applications and PC streaming, offering flexibility in how content is delivered and experienced. * **Passthrough Functionality**: Utilizes the front camera to blend digital and physical worlds, paving the way for compelling Mixed Reality applications. * **Hand Tracking**: Offers intuitive interaction within the virtual environment, allowing for a more natural and immersive experience. ![](/doc/unity/assets/image%20\(2\)%20\(1\)%20\(1\).png) Meta Quest 3 Headset ## Prepare Meta Quest Account and Meta Quest Device settings [Section titled “Prepare Meta Quest Account and Meta Quest Device settings”](#prepare-meta-quest-account-and-meta-quest-device-settings) ### 1. Meta Developer Account Setup [Section titled “1. Meta Developer Account Setup”](#1-meta-developer-account-setup) To deploy applications to your Meta Quest 3, it is essential to have a Meta Developer Account. Follow these steps to set up your account and ensure proper permissions for deploying Unity applications. 1. **Account Creation or Login:** * Visit [Meta Auth Portal](https://auth.meta.com/) to create a new account or log in to an existing one. 2. **Account Configuration on Meta Quest 3:** * Add your developer account to the Meta Quest 3 device. * Ensure that the account possesses admin privileges, particularly for Unity app uploads. ### 2. Developer Mode Activation [Section titled “2. Developer Mode Activation”](#2-developer-mode-activation) Developer Mode needs to be activated on your Meta Quest 3 to enable development features and app deployment. The Meta Quest mobile app is required for this process. 1. **Meta Quest App Installation:** * Install the Meta Quest App on your mobile phone from the respective app store. 2. **Activate Developer Mode:** * Follow the detailed instructions provided here to activate Developer Mode on your Meta Quest 3 via the Meta Quest App. ### 3. Meta Quest Developer Hub Installation - optional [Section titled “3. Meta Quest Developer Hub Installation - optional”](#3-meta-quest-developer-hub-installation---optional) The Meta Quest Developer Hub is a crucial tool for managing your development workflow, including app deployment and performance monitoring. 1. **Device Connection:** * Connect your Meta Quest 3 to your PC using a compatible USB cable. 2. **Software Installation:** * Download and install the Meta Quest Developer Hub from [Meta Quest Developer Hub](https://developer.oculus.com/meta-quest-developer-hub/). ### 4. USB Driver for Debugging (Windows) - optional [Section titled “4. USB Driver for Debugging (Windows) - optional”](#4-usb-driver-for-debugging-windows---optional) For adb (Android Debug Bridge) debugging on Windows, the Google USB Driver is required. This driver facilitates the connection and communication between your Meta Quest 3 and the PC. 1. **Driver Download and Installation:** * Download the Google USB Driver from [Google USB Driver](https://developer.android.com/studio/run/win-usb). * Follow the installation instructions provided on the website. ## Install needed Unity Packages [Section titled “Install needed Unity Packages”](#install-needed-unity-packages) ### 1. Add Android Build Support [Section titled “1. Add Android Build Support”](#1-add-android-build-support) 1. **Unity Hub**: Use UnityHub to add Android build support to your specific Unity version. ### 2. Configure Unity for XR Development [Section titled “2. Configure Unity for XR Development”](#2-configure-unity-for-xr-development) 1. **Project Settings**: In Unity, go to `Edit > Project Settings > XR Plugin Management`. 2. **Install XR Plugin**: Install the XR Plugin Management. 3. **Enable Oculus Plugin**: Enable the Oculus plugin for both PC and Android platforms under the plugin providers section. ![](/doc/unity/assets/image%20\(14\).png) XR Plugin Management Installation via Package Manager ![](/doc/unity/assets/image%20\(15\).png) Enabled Oculus support (for Windows and Android) in XR Plug-in Management ### 3. Install Meta XR SDK [Section titled “3. Install Meta XR SDK”](#3-install-meta-xr-sdk) 1. **Unity Asset Store**: Locate the Meta XR All-in-One SDK asset on the Unity Asset Store: Meta XR All-in-One SDK (). 2. **Asset Acquisition**: Click on “Add to My Assets”. When prompted, select “Open in Unity”. ### **4. Setup Oculus Integration** [Section titled “4. Setup Oculus Integration”](#4-setup-oculus-integration) 1. **Accessing Oculus Setup**: * After Unity restarts, find the Oculus logo at the bottom right of the Unity Editor. * Click the logo to launch the Oculus Setup tool. 2. **Configuration**: * Use the “Fix All” and “Apply All” options under both the PC and Android tabs to ensure proper setup. ### **5. Prepare for Android Builds** [Section titled “5. Prepare for Android Builds”](#5-prepare-for-android-builds) 1. **Build Settings**: * Navigate to `File` > `Build Settings`. * Change the target platform to Android. 2. **Scene Configuration**: * Disable any active cameras in your scene to avoid conflicts. ### **6. Configure Camera Rig** [Section titled “6. Configure Camera Rig”](#6-configure-camera-rig) 1. **Setup OVRCameraRig**: * In your Project files, find and drag the `OVRCameraRig` into your scene. 2. **Configure Tracking**: * Select the `OVRCameraRig` GameObject. * In the Inspector panel, under Tracking, set the Tracking Origin Type to “Floor Level”. * Ensure you enable support for the Quest 3 in Target Devices. ### **7. Building to the Quest** [Section titled “7. Building to the Quest”](#7-building-to-the-quest) 1. **Access Build Settings**: * Go to `File` > `Build Settings`. * Ensure the relevant scenes are added by clicking “Add Open Scenes”. 2. **Connect Quest**: * Connect your Quest to your PC using a USB cable. * Verify that the Quest is in developer mode. You will see a message in the Quest asking if you trust the connected PC * In Unity, set your Quest as the Run Device. ![](/doc/unity/assets/image%20\(16\).png) Quest set as Run Device in Build Settings 3. **Build and Run**: * Click “Build and Run” to compile your application and deploy it directly to the Quest. ## Debugging Quest Applications [Section titled “Debugging Quest Applications”](#debugging-quest-applications) For debugging Android Applications in general and Meta Quest Applications we recommend using Android Logcat. Android Logcat is displaying live the Android log in the Unity Editor, while the Quest is connected. You can filter here for all Unity Console Log messages in a Android Application which is running on the Quest. 🔗 Install Android Logcat via the Unity Package Manager: ![](/doc/unity/assets/image%20\(1\)%20\(1\)%20\(1\)%20\(1\)%20\(1\)%20\(1\)%20\(1\)%20\(1\)%20\(1\)%20\(1\).png) Installing Logcat via the Unity Package Manager To open the Android Logcat window in the Unity Editor: * Menu: **Window** > **Analysis** > **Android Logcat**. # Newtonsoft JSON [Newtonsoft JSON](https://www.newtonsoft.com/json) is a very common library in C# for working with JSONs. Some interfaces (currently Open Digital Twin Interfaces as well as TwinCAT HMI) are depending on Newtonsoft JSON library. Formerly we had this library directly included in our delivery. Latest Unity started in adding dependencies to this library in some of the packages in the standard packages and in the standard project setting. This caused collissions with our delivery because only one DLL with the same name is allowed to be included in a project. From the newest release on, we don’t include any more Newtonsoft JSON in our delivery. For making our scripts to be compiled, in the case that in your project there is no Newtonsoft JSON included, we are having a Scripting Define Symbol (Compile Switch) which is REALVIRTUAL\_*JSON*. Note You only need to set this scripting define symbol if you want to use one of our interfaces which is depending on it (currently [TwinCAT HMI](/doc/unity/components-and-scripts/interfaces/twincat-hmi/) and [Open Digital Twin Interface](/doc/unity/advanced-topics/page-5/)). If yo don’t have any dependency in your project to Newtonsoft JSON you can manually add the dependency by adding this line to *manifest.json* (can be found in the folder Packes): ![](/doc/unity/assets/manifest-newtonsoft.png) As soon as you are sure, that Newtonsoft.JSON is available in your project, *REALVIRTUAL\_JSON* needs to be set in Scripting Define Symbols: ![](/doc/unity/assets/newtonsoftjson) Newtonsoft compile switch in Scripting Define Symbols (in Project Settings > Player) # Open Digital Twin Interface > Version 1 - Connecting Digital Twin design and simulation applications Note This document is a draft document for connecting external CAD Systems. Exchanging data between design and simulation tools is not always easy. Even though we are in the times of Industrie4.0, the data exchange from the CAD system to different simulation tools is mostly based on Step. All additional information about kinematics (design structures are often not kinematic oriented), sensors and actuators are lost. The idea of the Open Digital Twin Interface is to make it relatively easy for any external system to send extended data beyond the design to and from realvirtual.io. Other systems are also invited to use this open standard. The goal is that with some macro programming within the CAD system, an exporter can be easily created. The data structure of the Open Digital Twin Interface consists of a relatively simple and readable [JSON](https://de.wikipedia.org/wiki/JavaScript_Object_Notation) which transmits additional information to the 3D data. The 3D data can be designed as JT, Step, OBJ or FBX. An exporter from the CAD system is therefore relatively simple, since usually one of the formats can already be written by the CAD system. The data in the JSON references elements contained in the CAD data and thus supplements them with additional information on drives, kinematics and sensors. If required, additional individual properties can be attached to the JSON objects, but their interpretation must then be implemented individually. Realvirtual.io Professional implements the standard described here. The OpenDigitalTwin interface is a result of ITEA Project AITOC (). This is our example model from which the JSON data (see below) was generated: ![](/doc/unity/assets/opendigitaltwin.png) This robot can be generated and exported with the Open Digital Twin Interface ### Why not AutomationML or the Asset Administration Shell? [Section titled “Why not AutomationML or the Asset Administration Shell?”](#why-not-automationml-or-the-asset-administration-shell) Caution **This section was written in 2021 and no longer describes what realvirtual does.** realvirtual WEB reads AutomationML today — see [What changed since 2021](#what-changed-since-2021) directly below. The original reasoning is kept because it explains why the Open Digital Twin Interface exists, not because it is still a description of our AutomationML support. You may object that this is exactly what [AutomationML ](https://www.automationml.org)or the [Asset Administration Shell ](https://www.plattform-i40.de/IP/Redaktion/DE/Downloads/Publikation/Details_of_the_Asset_Administration_Shell_Part1_V3.html)are for. From our point of view AutomationML is too complex to write an exporter from the CAD system. The XML structure is very difficult to understand, exporters are hardly available and even exporting [Collada](https://www.khronos.org/collada/) from the CAD system is an extremely high development effort. The Asset Administration Shell, on the other hand, tries to describe all aspects of a digital twin in data terms, the kinematics, sensor and actuator side for simulation environments plays only a minor role. Also the format is relatively complex. So we where looking for a simple solution that “everyone” can implement. Not something which covers everything, but something that is simple and offers the most important things. ### What changed since 2021 [Section titled “What changed since 2021”](#what-changed-since-2021) Two of the three objections above have not aged well, and one has. To be precise about which is which: **The plant topology is no longer a problem.** realvirtual WEB reads the CAEX part of AutomationML — the `InstanceHierarchy`, its nesting, the `Frame` placements and the CAEX attributes — and turns it into an editable asset tree. The XML is indeed verbose, but it is regular, and reading it is a solved problem on our side. Our reference is the official AutomationML e.V. *Robot Cell* tutorial package: 323 elements, 168 frames, 223 external references, imported without a blocker. **“Exporters are hardly available” is no longer true for the topology, either.** Siemens TIA Portal exports its hardware configuration as AutomationML, EPLAN exchanges I/O and network data with Mitsubishi iQ Works through it, Beckhoff TwinCAT imports and exports it, and tarakos taraVRBuilder and eks-intec RF::Suite write it including geometry. Notably, Siemens — which does *not* export PLCopen XML — does export AutomationML. **The COLLADA objection still stands, and it is the expensive part.** AutomationML references its geometry as COLLADA, and that is where the real work is. Reading it well means going beyond what off-the-shelf loaders do: in our reference package, 84 % of all triangles are stored as ``/``, which the common browser loader silently drops, and the 219 geometry references are only seeds of a file graph that reaches 406 documents through cross-file `instance_node` links. Both had to be implemented. So “exporting COLLADA from the CAD system is a high development effort” remains a fair description of the format’s cost — it simply is not a reason for us not to read it. **The Asset Administration Shell assessment is unchanged.** It describes a digital twin’s data comprehensively, but the kinematic, sensor and actuator side that a simulation needs remains a minor part of it. **And one honest correction about this page itself:** the Open Digital Twin Interface described below was specified and published, but the transport layers announced under *“The interfaces are currently in development”* were never implemented in realvirtual. The specification stands, and the MIT license on it stands; there is no shipping ODT importer or exporter behind it. If you are looking for a working structured import path today, AutomationML in realvirtual WEB is it. **Current scope of the AutomationML import (realvirtual WEB):** plant structure, frames, CAEX attributes and the complete referenced COLLADA geometry, as an editable asset tree. Kinematics — which this package carries inside COLLADA rather than in CAEX — and signals/PLCopen logic are not read yet. The importer is an internal preview and is not part of a customer build. ### Supported se cases [Section titled “Supported se cases ”](#supported-se-cases) The Open Digital Twin Interface supports the following use cases * Offline (file-based) export of 3D and kinematic data from other systems, e.g. the design system * “Live-Link” with the CAD system, i.e. data is transmitted in the background, e.g. via TCP-IP, and is automatically updated in the scene * Creating signals in Unity Editor mode * Setting signals in simulation mode (like other realvirtual.io automation interfaces) * Reading signals in simulation mode * Connecting signals to components on objects (e.g. to connect a *PLCOutputSignal* to the Motors behavior model and its property *DestinationSpeed*) * Instantiating new objects in the digital twin model * Setting properties on components in the digital twin model ### Optional properties [Section titled “Optional properties”](#optional-properties) A lot of properties are optional and does not need to be transferred. E.g. if you would like to only read and write signal values from and to realvirtual.io you could create the *OpenDigitalTwin* class and inside this class you could only set the property Signals and the Signals array itself within the class signals.The rest of the *OpenDigitalTwin* class properties (*parts*, *assembly*, *kinematicassembly* and so on) stay null. Or you could only instantiate the class Parts if you only would like to transfer 3D Data and the Part hierarchy to realvirtual.io. ### Basic concepts [Section titled “Basic concepts”](#basic-concepts) #### Separated assembly and kinematic structure [Section titled “Separated assembly and kinematic structure”](#separated-assembly-and-kinematic-structure) CAD designs are mostly not kinematic structured. Therefore, the *KinematicAssembly* optionally builds a parallel kinematic structure. Each part in the design structure can be assigned to an element Kinematic in the *KinematicAssembly*. Drives and Sensors can be attached to the Assembly as well as to the Kinematic Structure. ![](/doc/unity/assets/opendigitaltwin-kinematic.png) Separated assembly and kinematic structure #### Transforms (Positions and Rotations) [Section titled “Transforms (Positions and Rotations)”](#transforms-positions-and-rotations) A transform contains the position and rotation, always in the global coordinate system related to the zero point of the *Assembly* and *KinematicAssembly*. *Assembly* and *KinematicAssembly* must have the same origin as the exported 3D data. Directions of drives and sensors are always referenced to the local coordinate system to which the drives or sensors are assigned. #### Referencing 3D Data [Section titled “Referencing 3D Data”](#referencing-3d-data) Each part in the assembly structure can reference a construction element in the exported 3D data file (*partfile* and *partcomponent*). If *partcomponent* is empty or null, then the entire 3D data is assigned to the *part* in the assembly. So it is possible either to export all 3D data in one export, e.g. as Step, and then to reference them in the assembly structure or to export one 3D file (*partfile*) per assembly level. #### Objects, Components and Properties [Section titled “Objects, Components and Properties”](#objects-components-and-properties) The entire digital twin is build by a hierarchy of objects. Each object can have multiple child objects. Each object only has one parent object. Objects including the hierarchy could be imported into the digital twin by importing Part Assemblies or Kinematic Assembly. So a Kinematic as well as a Part is an object in the hierarchy. Each Object itself can have different components on it. A component can be for example a drive, a sensor or a behavior model. The component (itself) has different properties which are defining the behavior of the component. A very special property of a component is a Signal. It is possible to connect signals in the signal list with the behavior behavior models (components) on the object. Another way for creating Objects inside of the model is to instantiate new objects based on so called *Prefabs*. *Prefabs* are blueprints for simple or complex objects). With the Open Digital Twin Interface you could create new objects at certain positions and afterwards set properties of these components. ### Licensing, Usage [Section titled “Licensing, Usage”](#licensing-usage) We release the Open Digital Twin interface under MIT license. The import and export functions in realvirtual.io Professional itself are subject to the realvirtual.io license terms. Every user and CAD manufacturer is invited to use the Open Digital Twin Interface. If you want to become an official supporter, you will get a license realvirtual.io for testing and development purposes and support from our side for free. If you are interested, please send a mail to . ### Transport layers in realvirtual.io for the Open Digital Twin Interface [Section titled “Transport layers in realvirtual.io for the Open Digital Twin Interface”](#transport-layers-in-realvirtualio-for-the-open-digital-twin-interface) realvirtual.io is implementing three different transport layers for importing and exporting the OpenDigitalTwin data. These layers are file based (JSON and CAD-Date), TCP-IP (realvirtual.io will be a TCP-IP server) and MQTT. All interfaces are going to run in Unity Editor mode as well as in playmode. > The interfaces are currently in development. More information will follow soon. ### C# Classes [Section titled “C# Classes”](#c-classes) The following C# class structure can be used to serialize JSONS in the OpenDigitalTwin format or to get from a JSON back to the class structure. We have explained the most necessary in the source code, more explanations will follow here soon. ```csharp /// OpenDigitalTwin class definition version 1 /// Copyright (c) 2022 realvirtual.io - In2sight GmbH // MIT License // Permission is hereby granted, free of charge, to any person obtaining a copy of this source code, to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: // The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. // THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. namespace OpenDigitalTwin { public class OpenDigitalTwin // the frame classs, all components are optional, e.g. it is possible to import, read and write only signals without sending or receiving the other properties { public Header header; public Assembly assembly; public KinematicAssembly kinematicassembly; public Signals signals; } public class Assembly // The cad Assembly of parts - the structure the designer used in the cad system - very often not kinematic structured { public List parts; } public class Part // the part inside an Assembly which has a global position and rotation in relation to Assembly origin point, referencing to a part fild { public string id = ""; public string partname=""; public string occurenceid =""; public string partfile =""; // can be collada, jt, step, obj public string partcomponent =""; // can be a valid path /assembly1/subassembly/part if only a part of the partfile is a representation of the part (if just one file is exported) or keep it empty if the partfile ia a full representation of the part public string lastchange=""; public string parentid=""; public string kinematicreference=""; // optional -references this part into a structural level in the kinematics hierarchy, multiple parts can be assigned to the same kinematic reference (kinematic reference does not needs to be unique in the part structure) public List materials; //optional - if not defined standard materials of partfile import are used public Transform transform; public Drive drive; //optional - Drive might be also attached in kinematic chain public Sensor sensor; //optional - Sensor might be also attached in kinematic chain public string behaviormodel=""; // optional - might be used for attaching automatically for example FMUs } public class KinematicAssembly // a kinematic Assembly, parts can be linked to single compontents in kinematic chain { public List kinematics; } public class Kinematic // a single kinematic component in the kinematic chain { public string id=""; // might be referenced by a part public string kinematicname = "kinematic"; // name of the structural component in the kinematic chain - is NOT unique and not referenced - just for information public string kinematicreference=""; // the kinematic referance of this kinematic component - needs to be unique in the kinematic chain public string parentid=""; // the parent kinematic component public Transform transform; public Drive drive; // optional public Sensor sensor; // optional } public class Header // the header info for Assembly and kinematic Assembly { public string reference = ""; // a reference for the digitaltwin interface public int odtversion = 1; // version of odf file definition, currently 1 public string lastchange=""; // optional public string cadystem=""; // optional public string csys=""; // lefthanded / righthanded } public class Signals // a list of all automation signals { public List signals; } public class Transform // the global position and rotation in relation to Assembly origin point { public float posx; public float posy; public float posz; public float rotx; public float roty; public float rotz; } public class Drive // Drives can be connected to assemly hierarchy or kinematic hierarchy { public string type=""; // "linear, rotational,linearsurface,rotationsurface" public string direction="x"; // "x,y,z" in local coordinate system public float maxspeed=0; // optional public float maxacceleration=0; // optional public float lowerlimit=0; // optional public float upperlimit=0; // optional public string behaviormodel = ""; // optional e.g. for defining FMUs or realvirtual behavior models } public class Sensor // a sensor which can be connected to assembly or kinematic hierarchy { public string direction = "x"; // "x,y,z" in local coordinate system public float length; // the length of detection, a sensor is a straight line (raycast) from the origin point of the part or kinematic transform public string behaviormodel = ""; // optional e.g. for defining FMUs or realvirtual behavior models } public class Signal // a signal for reading and writing signals, if a signal list is send on edit mode the signals are created if not existing { public string signalname = ""; // signalname needs to be unique public string internalname = ""; // optional, if internalname empty than it equals signalname, for some interfaces (e.g. SiemensS7) internal name needs follow certain conditions to be a hardware adress public string folder = ""; // optional, if given certain hierarchy / folder path or organizing the signals public string direction = "input"; // input,output public string type = "bool"; //bool,int,float,text public string comment =""; public string value; } }# ``` ### Example JSON [Section titled “Example JSON”](#example-json) This is a part of the resulting JSON as an example. The full json can be found here: 📎 [Open Digital Twin example JSON](/doc/unity/assets/opendigitaltwin.json) ### Change notes [Section titled “Change notes”](#change-notes) 16.10.2022 - added optional classes for connections (connecting signals to components), instantiations (creating prepared objects on certain positions) and opbject properties (reading and writing object values) # Render Pipelines > Improving visual quality of your Digital Twins ## Introduction [Section titled “Introduction”](#introduction) Unity’s rendering technology provides various ways to achieve outstanding visual quality in your projects, starting with the Built-In Render Pipeline and advancing to the Universal Render Pipeline (URP) and the High Definition Render Pipeline (HDRP). Realvirtual.io is built on the Built-In (Standard) render pipeline, Unity’s original rendering path. This pipeline is well-suited for a wide array of Digital Twins and offers the simplest entry point for beginners. Despite its broad applicability, it faces limitations in scalability and visual features compared to newer pipelines. Beginners are encouraged to start here, with the option to later upgrade to URP or HDRP for enhanced visual fidelity. * **Built-In Pipeline**: Perfect for newcomers, it supports essential post-processing but is limited in scalability and advanced features. As a beginner you should stay on this render pipeline because it is easier to use. You can always transfer your project later on if needed. * **URP (Universal Render Pipeline)**: Strikes a balance between performance and visual quality, making it ideal for cross-platform projects and mid to high-end devices. Recommended for projects needing post-processing, high performance, and improved visual quality. ![](/doc/unity/assets/image%20\(1\)%20\(1\)%20\(1\)%20\(1\)%20\(1\)%20\(1\)%20\(1\)%20\(1\).png) UR30 robot in URP * **HDRP (High Definition Render Pipeline)**: Aimed at achieving top-tier visuals with sophisticated lighting and materials, HDRP is best for projects focused on marketing, sales applications, and rendered videos, requiring high-performance graphics cards. ![](/doc/unity/assets/image%20\(2\)%20\(1\).png) UR30 robot in HDRP For more information about render pipelines please check the Unity docs. 🔗 [Unity documentation about rendering pipelines](https://docs.unity3d.com/Manual/render-pipelines.html) [Example of a UR30 robot with HDRP render pipeline](https://www.youtube-nocookie.com/embed/ADeab3c9db4) Example of a UR30 robot with HDRP render pipeline ## Switching render pipelines [Section titled “Switching render pipelines”](#switching-render-pipelines) With the release of version 2022.11, transitioning between render pipelines in Unity has been simplified, catering to both newcomers and seasoned developers. However, beginners are advised to continue using the Standard Render Pipeline due to its straightforward settings and ease of use. **Steps for Switching Render Pipelines:** 1. **Access Through Main Menu**: The option to switch render pipelines is available directly from the main menu `Tools > realvirtual > RenderPipelines` 2. **Backup Your Project**: It’s crucial to create a backup of your project before proceeding with the switch. This precaution ensures that you can revert to your original settings should the need arise, preserving your work. 3. **Confirmation Prompt**: Upon initiating the switch, you’ll receive a prompt confirming your decision. This process installs all necessary packages and updates the materials in your current scene, along with those in any packages and project materials, to be compatible with the selected pipeline. ![](/doc/unity/assets/image%20\(1\)%20\(3\)%20\(1\).png) \\ # Starting your development > Developing your own custom digital twin solutions with c# This page gives you some hints on how you should organize your own developments. For more information about development, in general, please check the Unity documentation or tutorials. ## Selecting a Unity Version [Section titled “Selecting a Unity Version”](#selecting-a-unity-version) We strongly recommend using, as we do, the latest Unity LTS (Long Term Stable Release - ). This gives you a stable base Version of Unity for your own developments. For sure you can use also newer Unity Versions but this is riskier and we can’t guarantee full compatibility of all realvirtual.io features and functions. ## Create your own solution folder [Section titled “Create your own solution folder”](#create-your-own-solution-folder) To separate your own development from the realvirtual.io standard Asset it is recommended to organize your own developments in your own folder under the Unity Asset folder. For example, create a Folder *MyDevelopment*: ![](/doc/unity/assets/ownproject-newfolder.png) Put your development in your own folder As soon as updates for realvirtual.io are available you can import the Asset without risking to override anything of your developments. ## Set the assembly definition [Section titled “Set the assembly definition”](#set-the-assembly-definition) Note You don’t need to use assembly definition but we recommend it for larger projects, because it reduces compile time and increases the separation of your classes. The realvirtual.io framework is organized in different assemblies which are defined by Assembly Definitions. You must create your own Assembly and reference the game4automation assembly definition. For doing this you must create your assembly definition on the top level of your folder.\ In your assembly definition you must reference game4automation.base to be able to use the realvirtual.io scripts and classes. ![](/doc/unity/assets/ownproject-assemblydef.png) Create a assembly definition ## Use a new namespace [Section titled “Use a new namespace”](#use-a-new-namespace) It is recommended to use your own namespace for example *MyNamespace* to separate your classes from the standard classes. To use the realvirtual.io classes you need to include *game4automation* in your using statement. A base MonoBehavior of your solution could look like this: ```csharp using UnityEngine; using realvirtual; namespace MyNamespace { public class myownbehaviour : MonoBehaviour { // Start is called before the first frame update void Start() { } // Update is called once per frame void Update() { } } }c ``` ## realvirtual.io base component [Section titled “realvirtual.io base component”](#realvirtualio-base-component) Most realvirtual.io scripts are based on the Game4AutomatiohBehaviour Class and most of them are using settings that are stored in the Game4AutomationController inside the realvirtual.io prefab.\ Your scene should include at least the Game4AutomationController . After dragging the Game4AutomationController Asset into your scene you could parts of it if you don’t want to use the UI functions, the lights, the camera or the Scene Navigation. If you delete all this you will need to define your own camera script with mouse navigation and your own lights. ## Build your own behavior models [Section titled “Build your own behavior models”](#build-your-own-behavior-models) One important part of realvirtual.io are Behavior Models. They link the inputs and outputs to generic [Drives ](/doc/unity/components-and-scripts/motion/drive/)and [Sensors](/doc/unity/components-and-scripts/sensors/sensor/). In the Behavior Models you can define your own behavior (e.g. your very special motor) and link this to the base[ Drive](/doc/unity/components-and-scripts/motion/drive/). For doing so your own class must inherit from `BehaviorInterface`. Here is a very simple example of a Drive behavior which is controlling the Drive with one single Signal (a boolean): ```csharp using game4automation; using UnityEngine; namespace MyNamespace { [RequireComponent(typeof(Drive))] public class myownbehaviour : BehaviorInterface { public PLCOutputBool StartMotor; private Drive drive; // Start is called before the first frame update void Start() { drive = GetComponent(); } // Update is called once per frame void Update() { if (StartMotor.Value == true) drive.JogForward = true; else drive.JogForward = false; } } ``` With the `RequireComponent` tag, you are defining that your script needs a Drive attached to the same Gameobject. If not a Drive will automatically be added. > GetComponent is a time-consuming method, this is why it is better to get a reference at startup (here the private variable drive) If you attach your Behavior to a component you will automatically see the Icon in the Hierarchy window: ![](/doc/unity/assets/ownproject-ownbehaviour.png) > Please note, that in the example the `PLCOutputBool` must be assigned. If not a NULL error will happen. To do a null check like *`PLCOutputBool!=null`* is possible, but Null checks are also expensive. It is better to check at the `Start` or `Awake` function if it is Null and set a local variable. Rider as and advanced development framework is even automatically able to do this. This is how the final and runtime optimized code is looking like: ## Derive your classes from base classes [Section titled “Derive your classes from base classes”](#derive-your-classes-from-base-classes) In more advanced use cases you might want to develop your own Drive. You could derive your class from the standard Drive or if you want to start from scratch you could derive from the class `BaseDrive`. If you derive from the `BaseDrive` you will need to develop the full kinematic and positioning functions yourself. ## Improve the inspector appearance of your scripts [Section titled “Improve the inspector appearance of your scripts”](#improve-the-inspector-appearance-of-your-scripts) realvirtual.io is using in more and more components NaughtyAttributes for better user experience with the public script attributes. You will need to include the `naughtyattributes` namespace in your using statement for being able to use NaughtyAttributes. You can get the documentation of NaughtyAttributes here: 🔗 \\ # Supported Platforms A Unity project can be compiled to different destination platforms like Android, Windows, IOs, WebGL and so on. Please check Section [publishing-the-digital-twin.md](/doc/unity/basics/publishing-the-digital-twin/ "mention")about changing your destination platform. Because realvirtual.io includes some very special interfaces to automation systems, not every platform is supporting all automation interfaces and you might need to delete some things which can’t be compiled to a certain destination platform. On this page you will get an overview on the possibilities and limitations. ### Known platform limitations [Section titled “Known platform limitations”](#known-platform-limitations) The following table lists all currently known limitations. You need to remove the folder if “needs to be removed” is listed in the table. You can remove the folder if “not working” is listed in the table. | Function | Folder | Windows | Android | iOS | UWP | WebGL | | ---------------------------- | -------------------------------------------------------- | ---------------- | ------------------ | ------------------- | ------------------- | ------------------- | | **ZIP Tool** | game4automation/Tools/ZIP | works | not working | not working | needs to be removed | not working | | **CADLink** | Assets/game4automation/CADLink | works (Step/3MF) | only 3MF | only 3MF | needs to be removed | needs to be removed | | **Parts4CAD** | Assets/game4automation/parts4cad | works | not working | not working | needs to be removed | needs to be removed | | **Simit Interface** | Assets/game4automation/private/Interfaces/SharedMemory | works | not working | not working | works | needs to be removed | | **OPCUA Interface** | Assets/game4automation/private/Interfaces/OPCUA4Unity | works | only mono compiled | needs to be removed | needs to be removed | needs to be removed | | **TwinCAT Interface** | Assets/game4automation/private/Interfaces/TwinCAT | works | not working | not working | not working | needs to be removed | | **Simulink Interface** | Assets/game4automation/private/Interfaces/Simulink | works | not working | not working | not working | needs to be removed | | **S7-TCPIP Interface** | Assets/game4automation/private/Interfaces/S7TCPIP | works | works | works | works | needs to be removed | | **PLCSimAdvanced Interface** | Assets/game4automation/private/Interfaces/PLCSimAdvanced | works | not working | not working | not working | needs to be removed | | **Modbus Interface** | Assets/game4automation/private/Interfaces/Modbus | works | works | works | works | needs to be removed | | **FMI Interface** | Assets/game4automation/private/Interfaces/FMI | works | not working | not working | needs to be removed | needs to be removed | | **TwinCAT HMI Interface** | Assets/game4automation/private/Interfaces/TwinCATHMI | works | works | works | works | works | | **RobotIK** | Assets/game4automation/Professional/RobotIK | works (Mono) | works (Mono) | not working | not working | needs to be removed | ## # Troubleshooting ## What You Should Do First [Section titled “What You Should Do First”](#what-you-should-do-first) Unity projects are complex and can sometimes encounter issues when upgrading, moving files, or installing/uninstalling packages. If you’re upgrading from an existing version, it’s essential to review the release notes for any known issues related to the upgrade. Additionally, our forum can guide you through common problems. Here are some general steps to follow for troubleshooting: 1. **Check the Console Log**:\ Start by reviewing the console log to see if any messages give you a hint about the problem. 2. **Clear Cached Data**: * Close Unity. * Delete the `Library` folder in your project directory to clear cached data and force Unity to rebuild the project. * Restart Unity. Unity will regenerate the necessary files from scratch. 3. **Upgrading to New Versions**: * If issues persist after upgrading, close Unity again. * Delete the entire `realvirtual` folder from your project. This will remove all realvirtual.io assets and configurations. * Open Unity again. Your scene references should remain intact. * Re-import the realvirtual.io Asset to restore all components and preserve references in your scenes. Following these steps should resolve most issues while maintaining the integrity of your references to realvirtual.io components in your user scenes. ## Contacting Support [Section titled “Contacting Support”](#contacting-support) If you still experience issues, please post on our public support forum at [forum.realvirtual.io](http://forum.realvirtual.io). This allows others to learn from your experience. When posting a support issue, please include the following: * **Version Information**: Always provide the version of realvirtual.io Professional/Starter and realvirtual.io Simulation you are using (search for “version” in your project folder to find the version numbers and check the properties in the inspector). ![](/doc/unity/assets/image%20\(24\).png) Getting the version numbers. * **Full Console Log**: Include your full console log. On Windows, you can find it at `%LOCALAPPDATA%\Unity\Editor\Editor.log`. For other systems, refer to Unity’s documentation: [Unity Log Files](https://docs.unity3d.com/Manual/LogFiles.html). * **Reproducible Project**: Prepare a project where the issue can be reproduced. Specify the scene where the issue occurs and ensure it’s directly visible when starting the scene. * **Upload Your Project**: Upload the full project, including the scene, to [realvirtual.io/send](https://realvirtual.io/send). The upload will be private and only visible to our support team. In the upload comments, specify which scene we should open to check your issue. # Upgrade Guide This section describes how to upgrade from older version. For upgrading to 2022 please check [Upgrade to 2022](/doc/unity/advanced-topics/upgrade-to-2022/). ## Upgrading from realvirtual.io 2022 to realvirtual.io 6 [Section titled “Upgrading from realvirtual.io 2022 to realvirtual.io 6”](#upgrading-from-realvirtualio-2022-to-realvirtualio-6) This guide will walk you through the process of upgrading your project from **realvirtual.io 2022** to **realvirtual.io 6**. Caution **Important: Two-Step Upgrade Process** The upgrade must be done in two separate steps: 1. **First:** Upgrade your existing project (including the old realvirtual version) to Unity 6 and verify it works correctly 2. **Second:** Once the project runs successfully in Unity 6, then upgrade the realvirtual framework itself Do not attempt to upgrade both Unity and realvirtual simultaneously. Each step must be completed and verified before proceeding to the next. *** **Step 1: Prepare Your Unity Environment** 1. **Ensure Unity 6 is Installed:** Use the Unity Package Manager to install the latest Unity 6 version. 2. **Select Your Project in Unity Hub:** Open Unity Hub, select your existing project, and change the **Editor Version** to the latest version (6000.X). 3. **Confirm Version Change:** A warning will appear regarding the version change. Select **Change Version** to proceed. ![](/doc/unity/assets/upgrade-openwith6.png) *** **Step 2: Open and Update Your Project** 1. **Open the Project:** Unity will open your project with Unity 6. 2. **Accept Compatibility Warnings:** * **Continue Warning:** Accept the next warning by selecting **Continue**. ![](/doc/unity/assets/upgrade-saveddifferent.png) * **Old API Warning:** You may receive a message about scripts using an older API. Confirm this and proceed. These scripts will be updated when you import realvirtual.io 6. 3. **Project Appearance:** Your project will open in Unity 6 and may initially appear different due to rendering pipeline changes. ![](/doc/unity/assets/upgrade-2023-in6.png) *** **Step 3: Update Materials to URP** 1. **Pink Materials Issue:** Materials in your scene might appear pink. This happens if your previous project used the Standard Rendering Pipeline. 2. **Convert Materials to URP:** Go to **Tools > realvirtual > RenderPipelines > Switch to Universal Render Pipeline (URP)**. This action will convert all materials in your project to be compatible with URP. ![](/doc/unity/assets/upgrade-switchtourp.png) Caution **Important:** Update materials to URP before importing the realvirtual.io 6 package to ensure proper rendering and avoid material conflicts. *** **Step 4: Import realvirtual.io 6 Package** 1. **Import Custom Package:** Go to **Assets > Import Custom Package** and select the latest **realvirtual.io 6** package. 2. **Expect Compilation Errors:** After import, you will likely see compilation errors in the Unity console. This is normal during the upgrade process. 3. **Close Unity:** Close the Unity Editor completely. 4. **Clean Project Cache:** * Delete the **Library** folder in your project directory * Delete the **Assets/realvirtual** folder (the old version) 5. **Reopen Project:** Open your project again in Unity 6. This will regenerate the Library folder with updated settings. 6. **Import Package Again:** Import the **realvirtual.io 6** package once more via **Assets > Import Custom Package**. 7. **Verify Import:** After the second import, compilation errors should be resolved, and the new realvirtual.io 6 framework will be properly integrated. Note **Why delete Library and realvirtual folders?** * **Library folder:** Ensures all cached metadata and assembly definitions are regenerated for Unity 6 compatibility * **realvirtual folder:** Removes old scripts that remain after the first import, preventing conflicts between old and new framework versions Don’t worry - **all references in your scenes and prefabs will be preserved** during this process. Unity automatically maintains these references through GUIDs, even when folders are deleted and reimported. *** After following these steps, your project should be fully upgraded to realvirtual.io 6 with URP compatibility, restoring the correct material and scene appearance. ![](/doc/unity/assets/upgrade-final.png) # Upgrade to 2022 > Upgrading from realvirtual (game4automation) 2021 to 2022 In our latest release, realvirtual.io 2022, we have changed all previous naming conventions from “game4automation” to “realvirtual. As a result, upgrading to the new version may not be as straightforward as before. This upgrade guide will provide you with instructions on how to upgrade your projects to Version 2022. Unless necessary, we recommend using Version 2022 for new projects and keeping existing projects in Version 2021. If you prefer Youtube, this tutorial is describing how to upgrade: [Youtube tutorial - upgrading projects to 2022](https://www.youtube-nocookie.com/embed/7NQqpFOtyKA) Youtube tutorial - upgrading projects to 2022 ## Preparation [Section titled “Preparation”](#preparation) Before proceeding with the upgrade, ensure that all your custom scripts and components are located outside the “game4automation” folder. ## Upgrade your existing Project to Unity 2022 [Section titled “Upgrade your existing Project to Unity 2022”](#upgrade-your-existing-project-to-unity-2022) Begin by upgrading your project to Unity 2022. Install the latest Unity 2022.3 release and open your existing project using the installed 2022.3 editor version. You will be prompted to confirm the editor version change. Your project should now open in Unity 2022, and you may encounter an error which can be ignored. ![](/doc/unity/assets/upgrade2022-project.png) Opening the project with 2022.3.X You will be asked to agree to changing the editor version. Your project should now open in Unity 2022. There might be an error which you can ignore. ## Import realvirtual 2022 [Section titled “Import realvirtual 2022”](#import-realvirtual-2022) Next, import the latest realvirtual 2022 release by navigating to Assets > Import Custom Package. Select “Import” in the Import Package Window. ![](/doc/unity/assets/upgrade2022-importpackage.png) You will see several error messages in the console window, and the project structure will still contain the “game4automation” folder along with an additional “realvirtual” folder. ## Delete game4automation folder [Section titled “Delete game4automation folder”](#delete-game4automation-folder) Although all necessary files have been imported and the references are intact, the project still contains outdated assembly definitions and the “game4automation” folder. Close Unity, **delete the entire “game4automation” folder from the project**, and then reopen Unity. When prompted with the Enter Safe Mode message, select “Ignore.” ![](/doc/unity/assets/upgrade2022-ignoresafemode.png) ## Import realvirtual 2022 once again. [Section titled “Import realvirtual 2022 once again.”](#import-realvirtual-2022-once-again) Import the realvirtual 2022 package once again. ![](/doc/unity/assets/upgrade2022-importagain.png) After the import, your project structure should resemble the following (with the possibility of additional custom folders you are having in the project), containing only the “realvirtual” folder. ![](/doc/unity/assets/upgrade2022-newfolder.png) You will now encounter several error messages related to your custom scripts. The primary reason for these errors is the namespace change from “game4automation” to “realvirtual” in the realvirtual package. ## Cleaning up Package manager [Section titled “Cleaning up Package manager”](#cleaning-up-package-manager) In the event of numerous errors resulting from incorrectly referenced packages, follow these steps to resolve the issue: 1. **Delete the “Packages” Folder**: If you encounter errors related to incorrectly referenced packages, the first step is to remove the existing “Packages” folder from your project. This folder contains the packages that may be causing issues. 2. **Replace with a Clean Copy**: To ensure a clean start, obtain the “Packages” folder from an empty **realvirtual 2022** project. This folder should be free from any conflicts or errors. 3. **Integration**: Paste the “Packages” folder from the empty **realvirtual 2022** project into the directory of the project that requires upgrading. This action should resolve any package-related errors, providing a smooth and error-free experience. ## Changing the namespaces [Section titled “Changing the namespaces”](#changing-the-namespaces) To resolve the compile errors caused by your custom scripts, you need to replace all references to the “game4automation” namespace with “realvirtual” in your scripts. Update the namespace declaration from “namespace game4automation” to “namespace realvirtual” and modify any “using game4automation” statements to “using realvirtual.” ![](/doc/unity/assets/upgrade2022-namespacebefore.png) namespace before changes ![](/doc/unity/assets/upgrade2022-namespaceafter%20\(1\).png) namespace after al changing to realvirtual Upon completing these namespace changes, the console log should no longer display any compile errors caused by your custom scripts. ## Upgrading the layers in your custom scenes [Section titled “Upgrading the layers in your custom scenes”](#upgrading-the-layers-in-your-custom-scenes) In addition to the namespace changes, the layer naming has been updated to a new standard (refer to the [Physics](/doc/unity/basics/physics/) section for details). Since your scenes might still utilize the old layer names, you need to update them to the new standard. To ensure that the new layers exist in your project, select “realvirtual” followed by “Apply standard settings.” This action will populate the new layers in the physics settings. ![](/doc/unity/assets/upgrade2022-applystandardsettings.png) There may still be remnants of old layers (starting with “g4a”), which you can delete by selecting “Edit Layers.” ![](/doc/unity/assets/upgrade2022-editlayers.png) Next, open your scene. To assist you in modifying the scene settings, an upgrade helper is provided. Choose “realvirtual” and then “Update Scene to 2022.” ![](/doc/unity/assets/upgrade2022-updatescene.png) Update layers in current scene This action will update the most common layer settings in your scene. However, please double-check that all collider settings and layers in your scene align with the new layer naming convention # Useful Addons > Unity provides an enormous solution eco system Solutions which are available for Unity are endless. You could do a Google search and check for example what is available on Github or Check the Unity asset store [https://assetstore.unity.com.](https://assetstore.unity.com) Also the [Unity Package Manager](https://docs.unity3d.com/Manual/upm-ui.html) is providing a lot of extensions. Here is a list of recommended Add-Ons which are very useful. ## Unity Recorder [Section titled “Unity Recorder”](#unity-recorder) The Unity recorder is able to record images and videos from your Game view. It is also slowing down, if needed, screen refresh rate to always record in best quality. It is the tool to use if you want to produce a video of your Digital Twin 🔗 ## Cinemachine [Section titled “Cinemachine”](#cinemachine) Cinemachine is enabling multiple cameras, camera flights and blending based on multiple virtual cameras. It is the tool to use for professional video creation with Unity. 🔗 ## NaughtyAttributes [Section titled “NaughtyAttributes”](#naughtyattributes) NaughtyAttributes is a tool for developers. You can create powerfull inspector windows with it. NaughtyAttributes is used in Game4Automation. 🔗 ## URP Render Pipeline [Section titled “URP Render Pipeline”](#urp-render-pipeline) If you would like to improve visual quality and use a lot of different post processing effects it is best to use the Universal Render Pipeline. 🔗 ## PlasticSCM [Section titled “PlasticSCM”](#plasticscm) With plastic SCM you have a very powerfull revision management system. More information also in this section [revision-management.md](/doc/unity/basics/revision-management/ "mention"). 🔗 ## MeshSimplify [Section titled “MeshSimplify”](#meshsimplify) Mesh simplify allows you to reduce polygon cound on 3D meshes. It is specially usefull if you want to reduce meshes for some very special meshes after the import with [cadlink.md](/doc/unity/basics/cad-import/cadlink/ "mention") 🔗 ## Textures and Materials [Section titled “Textures and Materials”](#textures-and-materials) Most important thing for getting a good visual quality in your models is Lightning, PostProcessing and Materials. Unity Asset Store is providing a lot of Material collections. Some are even for free. 🔗 # CAD import (Pro) > Importing 3D data from mechanical design systems Unity is able to process standard mesh-based file formats such as fbx, obj and collada. Mechanical design systems (CAD systems) are usually not able to process these game-oriented 3D data. realvirtual.io Professional includes [cadlink.md](/doc/unity/basics/cad-import/cadlink/ "mention")for importing CAD data. CADLink allows you to import CAD files from any CAD system that can export step or 3MF files. Another option for importing 3D data is to use the PIXYZ plugin, see [https://unity.com/de/products/pixyz.](https://unity.com/de/products/pixyz) © 2025 realvirtual GmbH [https://realvirtual.io](https://realvirtual.io/) - All rights reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or by any means, including printing, saving, photocopying, recording, or other electronic or mechanical methods, without the prior written permission of the publisher. # CAD Checker (Pro) > Analyzing large CAD data for performance bottlenecks With CAD Checker an imported CAD file can be checked. This is mainly usefull for verly large assemblies for detecting performance bottlenecks. This includes * calculation of triangles, static meshes, and non-static meshes * detection of the largest meshes for further optimization * detection of unnecessary mesh duplicates for performance optimization ## **CAD Checker Window** [Section titled “CAD Checker Window”](#cad-checker-window) To open the CAD Checker window please select `Tools > realvirtual > CAD Checker (Pro)` in the realvirtual.io menu. This will open this window: \\ ![](/doc/unity/assets/cadchecker.png) Checking the meshes in large CAD data with CAD Checker window In the window, you can get a quick overview of the triangles in the model and the optimization possibilities.\ First, you will need to select the level of the model you want to check under `Check this`. If you select `upper part naming` the name displayed in the first column of the mesh list is the name of the Gameobject one level above the mesh itself. This is the usual setup for most imported CAD data.\ Next, you should select if you want to see all occurrences in the model (what means all identical meshes) in one line or as separate lines. To detect duplicates you should select `Show Occurencies`.\ Now you can see the total number of meshes and triangles in the model. The list is displaying you all meshes sorted by the total number of polygons. This means that `_CarrierA` in the model has in total 372912 Polygons with 34 occurrences. That means that 34 identical meshes are in the model. These meshes make 372912 Polygons. But there are also 10 Duplicates in the model. Duplicates are identical meshes with identical positions. Usually, you should prevent to have duplicates in the model because they are normally unnecessary. Note The statistics also show the number of static meshes. Please take care, for performance reasons, that all components that don’t move inside your model should be marked as “static”. With `Show` you can Ping the object and with `Filter` you can display all the components isolated. With *Select* you can select all components and with `Duplicates` only the duplicates are selected. © 2025 realvirtual GmbH [https://realvirtual.io](https://realvirtual.io/) - All rights reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or by any means, including printing, saving, photocopying, recording, or other electronic or mechanical methods, without the prior written permission of the publisher. \\ # CAD Updater (Pro) > Updating (reimporting) CAD Data With CAD Updater you can compare a newly imported CAD file with the current CAD file in your Unity project. For comparison, both CAD data are imported into different sub-game-objects into the same scene. The CAD Updater supports imports from CADLink and custom sources like PIXYZ. Note that part IDs for comparison are automatically generated based on the CAD design path (e.g., ‘Assembly2|Subassembly3|Part1’). For successful CAD updates, ensure that part names remain unchanged and the part structure is not reordered. ## CAD Updater based on custom imports [Section titled “CAD Updater based on custom imports”](#cad-updater-based-on-custom-imports) For custom imported data, the CAD Updater must be applied to the top level of the existing CAD data. Specify both the Current CAD Data (CAD Current) and the Update Data (CAD Update). It’s crucial that the structure and naming below CADCurrent and CADUpdate remain identical (except for added or deleted parts). Once set up, click “Compare Current with Update” to review detected changes. Use the “Isolate Buttons” to inspect changes in detail. If everything checks out, select “Update” to apply the changes. Please refer to the section below for more detailed information about CADUpdater. ![](/doc/unity/assets/cadupdater.png) CADUpdater Settings for custom imports ## CAD Updater based on CADLink imports [Section titled “CAD Updater based on CADLink imports”](#cad-updater-based-on-cadlink-imports) If you are using [CADLink ](/doc/unity/basics/cad-import/cadlink/)for reading in the CAD Data the CAD Updater component will be attached automatically to the parent Gameobject of CADLink as soon as you are updating your CAD data. All properties and options of CAD Updater are set automatically. Update means that there are already CAD data underneath CADLink and you import new CAD data. If you don’t want to perform an update you should delete all data underneath CADLink before importing a new CAD file. Note For Step and 3MF data there are some limitations with the CAD Update. Each mesh is defined by an ID and compared with the newly imported mesh. Because there are no special ID and revision properties inside the Step or 3MF data (like with JT), the ID of each part is defined by its location in the hierarchy and an occurrence number if there are two identical names at the same hierarchy level. This means that you should not rearrange elements (changing parents) under the CADLink object. Instead, you should use the [Kinematic ](/doc/unity/components-and-scripts/motion/kinematic/)script for rearranging the kinematic parents and children. ## Comparing CAD files [Section titled “Comparing CAD files”](#comparing-cad-files) CAD Updater is automatically added to the CADLink component as soon as you import a CAD file a second time. After the second import the following message will pop up: ![](/doc/unity/assets/cadupdater-check.png) Update check finished CAD Updater script is automatically added: ![](/doc/unity/assets/CADUpdater%20\(1\).png) CAD updater inspector After the update import, the comparison between the current and the new CAD data is started automatically. You can restart it manually with the Button `Compare Current with Update`. The Isolate Buttons allow you the see in detail what has been changed in the Update. On the left-hand side of the Unity Hierarchy View, you can see a status icon that is informing you about the status of the CAD component. ![](/doc/unity/assets/cadupdater-hierarchy.png) CAD Updater status icons | Icon | Description | | ------------- | ----------------------------- | | Green Hook | No changes | | Red Cross | Is deleted in Update | | Blue Plus | Is added in Update | | Orange ! | Mesh is changed | | Orange Arrows | Position is changed in Update | After the update check, you can update your current CAD data by selecting `Update`. All changes will be performed on the current CAD data and the update import will be deleted. Your current CAD data will now be like the Update but all changes that you performed within Unity/realvirtual.io will remain. ## Manual Control [Section titled “Manual Control”](#manual-control) Each component in the CAD design will have automatically added a CAD script. This script takes care of the current status and you can control exactly the Update behavior. By selecting `Keep` or `Keep Including Children` you can Keep the current object (including the children if selected) and it will not be touched by the Update process. If there is no relation found between the Current and the Update CAD data it could be that something is marked as to be deleted but you want to keep and update this. You can manually generate a relation by dragging an Update CAD Script into `Keep` *and* `Replace by Update`. This will manually set the IDs of the Update and the Current Identical and the Update will be performed. ![](/doc/unity/assets/cadupdater-cad.png) CAD script for manual update control © 2025 realvirtual GmbH [https://realvirtual.io](https://realvirtual.io/) - All rights reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or by any means, including printing, saving, photocopying, recording, or other electronic or mechanical methods, without the prior written permission of the publisher. # CADLink (Pro) > Importing Step, JT and 3MF files from CAD systems Caution CAD Import for Step and JT files works only in Unity-Editor (not in Unity Builds) and only on Windows systems (not with OSX or Linux Unity Editors). I CADLink is available as a separate asset in the Unity Asset Store and it is included in the realvirtual.io Professional package. CADLink is able to import 3MF files, STEP and JT files into Unity. STEP is a de facto standard for 3D CAD data and more or less all CAD Systems are able to export STEP files. Note Advanced tools for working with large assemblies like [Selection Window](/doc/unity/basics/selection-window/), [CAD Checker](/doc/unity/basics/cad-import/cad-checker/) or [CAD Updater](/doc/unity/basics/cad-import/cad-updater/) are only included in realvirtual.io Professional. CADLink as a standalone solution only supports what is described on this page. Please check also the Youtube video, which demonstrates CADLink and working with large mesh data: [Large CAD data and Unity](https://www.youtube-nocookie.com/embed/vgeJsMFVMGI) Large CAD data and Unity After installation, you will find CADLink under `Assets>CADLink`, if you are using it as a stand-alone asset or you will find it under `game4automation>private>CADLink` The folder structure looks like this: ![](/doc/unity/assets/cadlink-folder.png) CADLink folder In the main folder you will find sample scenes for each import type, e.g. as a 3MF file and another scene based on a STEP file. To import 3D data into your scene you need to drag and drop the CADLink prefab into your scene or you can use in realvirtual.io Professional the Menu realvirtual`> Add CADLink (Pro)` You are now able to import your CAD assembly as a sub-hierarchy into the CADLink top node. It is possible to include in one scene multiple CADLink interfaces if needed. Caution Please make sure that the name of your import file only consists of letters from the latin alphabet. The import is always done into the scene itself as meshes in child objects under the CADLink top node. No prefab is created and the meshes are only present in the scene itself. If you would like to create a prefab you could use Unity’s FBX exporter (see ) after importing into the scene. ## CAD Updater (only included in realvirtual.io Professional) [Section titled “CAD Updater (only included in realvirtual.io Professional)”](#cad-updater-only-included-in-realvirtualio-professional) With CAD Updater you can update your scene data based on a new version of the CAD file without losing anything that you added to the Gameobjects inside the scene. This is a semi-automated process. Before updating you can check changes that are going to be performed by the update. CAD Updater is attached and started automatically if there is already something existing under CADLink when you start the CADImport. If you don’t want to perform an update you must manually delete all Data which have been imported before. For more information please read the section [cad-updater.md](/doc/unity/basics/cad-import/cad-updater/ "mention"). ## Importing STEP/JT files [Section titled “Importing STEP/JT files”](#importing-stepjt-files) To import STEP /files is the recommended way for reading data of CAD Systems. When importing Step files the tessellation is done within Unity. Note Please note that the import of large CAD files (e.g. 1.5 GB) can take up to 30 to 45 minutes. ### STEP Import Settings [Section titled “STEP Import Settings”](#step-import-settings) The STEP import settings are very simple: ![](/doc/unity/assets/cadlink%20\(1\).png) Importing CAD data in Step format #### File [Section titled “File”](#file) The file (\*.jt,\*.stp or \*.step) to import. #### Import Scale Factor [Section titled “Import Scale Factor”](#import-scale-factor) The scale factor of the import. 0.001 corresponds to one Unity Unity equals 100mm. #### Quality [Section titled “Quality”](#quality) You can select 6 different quality modes for the mesh tessellation (very low, low, middle, high, very high, ultra). Note Please always **use lowest quality level** which is giving you the needed visual quality in a normal camera distance. Importing components in to high quality levels might impact perfromance in very large models. Specially if you would like to create reusable components you should take care about a suitable quality level. Usually you should use **low**, **middle** or **high** quality level. ![](/doc/unity/assets/cadlink-quality.png) Low, Middele and Very High Quality level #### Z is Up-Vector [Section titled “Z is Up-Vector”](#z-is-up-vector) If you set this parameter true, your import data will be rotated so that the Z-axis points upwards. #### Create Prefab [Section titled “Create Prefab”](#create-prefab) Generates a reusable [prefab](/doc/unity/basics/reusable-components-prefabs/#creating-prefabs-in-realvirtual) from the imported data, saved in the Assets folder. #### Set and create materials [Section titled “Set and create materials”](#set-and-create-materials) If `false`, the Step import applies a standard material with an Albedo value corresponding to the color in the Step file. This material will be attached to the mesh and is not an instantiated shared material which is available in the Assets folder. Note For reusable components, for better visual quality and for better performance it is recommended to assign instantiated shared materials and to import with `Set and create materials = true` If `true`, for all imported materials where no material mapping is defined, automatically a standard material is created with the name `Col#[Hexcode]`. This material is placed into the given standard folder (realvirtual`> CADLink > Materials`). ![](/doc/unity/assets/cadlink-materials.png) Created material with import option "Set and create Materials" If a Material mapping is defined, during Import CADLink is trying to map the colors defined in the Step files to Unity Materials. To do this it is necessary to define a Material mapping where you need to select the color value of the Step color and the corresponding Material. A material mapping scriptable asset is created by `Create >` realvirtual`> Add material mapping`. ![](/doc/unity/assets/cadlink-stepmapping.png) Mapping Step import colors and Unity materials ## Importing 3MF files [Section titled “Importing 3MF files”](#importing-3mf-files) Some CAD Systems like Solidworks, Solidedge, ProE / Creo and NX are able to write 3MF Files. Please check your CAD System documentation to see if your system is also able to write 3MF Files. The advantages of 3MF files are: * The tessellation is done by the CAD System which provides usually a very good quality * It is the modern tessellation 3D-printing standard - which fits perfect to Unity * Assembly structure is included * Color and material information is included * It is zipped and low sized * It includes multiple occurrences only one time - which reduces the file sized ### Known Limitations with 3MF files [Section titled “Known Limitations with 3MF files”](#known-limitations-with-3mf-files) #### Solidworks (Dassault) [Section titled “Solidworks (Dassault)”](#solidworks-dassault) No known limitations. Solidworks exports everything correct (assembly structure, colors and materials). #### Solidedge (Siemens PLM) [Section titled “Solidedge (Siemens PLM)”](#solidedge-siemens-plm) No known limitations. Solidedge exports everything correct (assembly structure, colors and materials). Please use this export options: ![](https://realvirtual.io/documentation/current/images/cadlink-solidedge.png) #### Fusion360 (Autodesk) [Section titled “Fusion360 (Autodesk)”](#fusion360-autodesk) You can use this solution to write 3mf files:\ Colors and assembly structure is not exported correct (flat structure without colors). #### ProE / Creo [Section titled “ProE / Creo”](#proe--creo) No known limitations #### NX (Siemens PLM) [Section titled “NX (Siemens PLM)”](#nx-siemens-plm) NX is exporting currently no assembly structure. Colors are exported. ### 3MF Import Settings [Section titled “3MF Import Settings”](#3mf-import-settings) In the Inspector you can check and change the CADLink settings: ![](/doc/unity/assets/cadlink3mf.png) Importing 3MF data #### Import CAD [Section titled “Import CAD”](#import-cad) **File** You can type in the relative or absolute File path or you can select the file path by pushing on the button `Select CAD Import File` **Delete before importing** This deletes the old imported data automatically when importing once again. **Remove top assembly node** Removes the top assembly node when importing the CAD data. This means that CADLink object is acting like the top assembly node. **Name Clones Identical** If clones (multiple occurrences of an identical part in the assembly structure) you can name all of the same or you can let the importer add a number in brackets to the imported name. **Import scale factor** The scale factor for the import. Normally, if one unit in Unity means for you 1 meter and you are exporting the 3mf file in millimeters this should be 0.001. #### Advanced Settings [Section titled “Advanced Settings”](#advanced-settings) **This should be normally turned on. Even if the exporter is combining vertices at the same position into one vertex, CADLink is separating them. This makes usually the rendering much nicer if this is combined with *****Advanced recalculate normals*****.** **Unity recalculate normals** Defines that Unity should recalculate the normals. We recommend to turn that off. **Advanced recalculate normals** Lets the importer to recalculate the normals and - if needed - to combine the separated vertices again to one. The calculation is done based on the angel between the triangle surfaces. If the angle is above the defined angle (in Degrees) an edge is created (with separated vertices). This gives a sharp edge shading. If the angle is below the vertices are combined and a normal is calculated which gives a smooth edge. See the difference in this pictures.\ With recalculated normals: ![](/doc/unity/assets/cadlink-normalsrecalculated.png) Without recalculated normals: ![](/doc/unity/assets/cadlink-normalsunrecalculated.png) **Calculate UVs** This option takes some time when importing. So please just turn it on when needed. You can calculate UVs automatically for mapping material textures on the surface. You can change the UV scale factor. With scale factor 0.01: ![](/doc/unity/assets/cadlink-uvrough.png) UV scale factor 0.01 With scale factor 1: ![](/doc/unity/assets/cadlink-uvsmooth.png) UV scale factor 1 #### Materials [Section titled “Materials”](#materials) Usually during the import new materials are created - if not existing - based on the naming of the imported color. You can change these materials if needed. Another option is to define a Material Mapping. This will map a given material to a certain imported material and color name combination. You can start the material assignment independent from the import by pushing the button “Update Materials”. In the import process the materials are automatically updated. **Set and Create Materials** If turned of no materials are created during import. **Overwrite Existing Materials** If a material which is currently imported already exists it will be overwritten. **New Material Path** Defines the path where the new imported materials should be created. **Material Mapping** Defines the Material mapping table. You can have in your project multiple material mapping tables. To create a new one and to automatically assign the new one to the CADLink object just press the button `Create New Material Mapping` In the Material Mapping settings you can define a color and/or a material name and assign this to a Unity material. CADLink checks the assignment in the following order: * First, assign materials if the Material name and Color name are defined in the table (and if they are not empty). * Second, assign materials if the Material name is in the table and the Color name is empty. * Third , assign if the Color name is in the table and the Material name is empty. ### Import 3MF during runtime [Section titled “Import 3MF during runtime”](#import-3mf-during-runtime) You can import 3MF files also during runtime. During runtime import materials are not created in the Material Assets. For changing materials you must provide before importing during runtime all materials with a corresponding Material Mapping. © 2025 realvirtual GmbH [https://realvirtual.io](https://realvirtual.io/) - All rights reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or by any means, including printing, saving, photocopying, recording, or other electronic or mechanical methods, without the prior written permission of the publisher. # Cadenas parts4cad > Standard industrial 3D components for Unity Note Parts4cad is removed from realvirtual.io Starter and Professional 2022 and above. You can still download it from the Asset Store. You can use the new online solution instead of Parts4CAD parts4cad offers access to millions of parametric 3D CAD models from over 500 parts catalogs for free. The original data of the manufacturers is based on the eCATALOG solutions technology by CADENAS ().\ The data is imported into Unity as Collada. All imported parts are still connected to the CADENAS database so that you can change later on parameters and update the part in Unity.\ parts4cad is a pure Unity Editor utility. Caution Parts4cad requires the parts4cad client software. If you use parts4cad the first time the parts4cad client will be downloaded automatically into the `StreamingAssets` folder inside of your project. ## Installation and first usage [Section titled “Installation and first usage”](#installation-and-first-usage) Note Parts4CAD only works on Windows system. **In your project folder path no “Spaces” are allowed** Parts4CAD is already included in Starter and Professional version and does not needs to be installed separately. After installing parts4cad from Unity’s Asset Store or after manual installation from an asset package you can start parts4cad by selecting `Tools > realvirtual > CADENAS parts4cad` in the main menu bar. ![](/doc/unity/assets/parts4cad-menu.png) If you use parts4cad the first time a message will ask you to allow the download of the parts4cad client to the `StreamingAssets` folder: ![](/doc/unity/assets/parts4cad-message.png) Message before installing parts4cad After selecting OK it will take some while to download a ZIP-file with the client and to unzip it into the `StreamingAssets` folder of your project: ![](/doc/unity/assets/parts4cad-install.png) ## parts4cad client [Section titled “parts4cad client”](#parts4cad-client) After installation the parts4cad client is started. ![](/doc/unity/assets/parts4cad-client.png) parts4cad client You can now select a catalog from a provider or you use the search to search in all catalogs for a certain name or description of the wished part. ![](/doc/unity/assets/parts4cad-search.png) parts4cad searching for parts After selecting a part a preview of the part is displayed and you can change parameters of the part if needed. ![](/doc/unity/assets/parts4cad-parameters.png) parts4cad part properties For transferring the selected part to Unity you need to push the button Transfer to CAD (realvirtual.io). ## parts4cad parts in Unity [Section titled “parts4cad parts in Unity”](#parts4cad-parts-in-unity) After selecting the part in the parts4cad client you get the part imported as an asset into `game4automation>parts4cad>Imported`. ![](/doc/unity/assets/parts4cad-unity.png) Imported parts4cad part in Unity Additionally the part is placed into the scene. If you have selected a Gameobject in the scene the part will be placed as a subcomponent to the selected Gameobject. The imported part gets a Parts4Cad script attached. This script holds some important information about the imported part. If you select `Show Attributes` all catalog attributes will be displayed in a text window. ![](/doc/unity/assets/parts4cad-scipt.png) parts4cad component For Updating the part parameters you need to select the `Update Part` button. This will reopen the parts4cad client with the part and you can update the part. If you select `Create New Part` a new part will be inserted into the scene. ## parts4cad uninstallation [Section titled “parts4cad uninstallation”](#parts4cad-uninstallation) For uninstalling parts4cad you need to delete in the *`StreamingAssets`* folder the folder *parts4cad*. Additionally you need to delete the folder *`game4automation\parts4cad`*. © 2025 realvirtual GmbH [https://realvirtual.io](https://realvirtual.io/) - All rights reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or by any means, including printing, saving, photocopying, recording, or other electronic or mechanical methods, without the prior written permission of the publisher. # Demo Model > First experiences with realvirtual.io based on the demo model Note This section describes the new demo model since version 6.1.0. For a description of the old demo model, which is still included in current releases, please check page [**Old Demo Model**](/doc/unity/basics/demo-model/demo-model/) [What's inside a digital twin (realvirtual Know-How)](https://www.youtube-nocookie.com/embed/CcLO-O2NyfY) What's inside a digital twin (realvirtual Know-How) ## Overview [Section titled “Overview”](#overview) The demo model showcases most of the **realvirtual.io** features in a single Unity scene. This allows you to quickly explore and test realvirtual.io’s functionality without having to set up your own scene from scratch. [](/doc/unity/assets/newdemo.mp4) realvirtual.io Demo model ## Starting and Navigating in the Demo [Section titled “Starting and Navigating in the Demo”](#starting-and-navigating-in-the-demo) ### Open the Demo Model [Section titled “Open the Demo Model”](#open-the-demo-model) 1. In the Unity Editor, navigate to the top menu. 2. Select **Tools > realvirtual > Open demo scene**. The demo model will open in the Unity Scene view. ### Start the Demo Model [Section titled “Start the Demo Model”](#start-the-demo-model) 1. Press Unity’s **Play** button to start the demo model. 2. Upon entering play mode, you will see two views: * **Scene View**: The standard Unity editor view for scene editing. * **Game View**: A preview of the final compiled version of your Unity project. 3. If the **Game View** window is not open, it will open automatically when you press Play. 4. You can move around and explore the scene in both views. ### Mouse Navigation in Game View [Section titled “Mouse Navigation in Game View”](#mouse-navigation-in-game-view) * **Keyboard + Mouse** (Default Unity Controls): * **W, A, S, D** + **Right Mouse Button** drag to move around in 3D space. * **Right-click + Drag** rotates the camera view. * **Mouse Scroll Wheel** zooms in and out. ### Touch Navigation in Game View [Section titled “Touch Navigation in Game View”](#touch-navigation-in-game-view) If you are on a mobile device or a Windows computer with a touchscreen, you can navigate using touch gestures: * **One-Finger Drag** to pan the view. * **Two-Finger Gestures** to rotate, pan, and zoom. * **Three-Finger Drag** to tilt the scene. ### Navigation in Scene View [Section titled “Navigation in Scene View”](#navigation-in-scene-view) Navigation in **Scene View** with the mouse is largely the same as navigating in **Game View**. Unity provides a standard set of mouse and keyboard shortcuts for moving around your scene > **Note:** For a more comprehensive overview of Scene View navigation and customization, please refer to the official Unity Documentation. ### Hotkeys [Section titled “Hotkeys”](#hotkeys) | (Mouse) Key | Action | | ------------------------- | --------------------------------- | | Right Mouse Button | Rotate scene | | Middle Mouse Button Wheel | Zoom in and out | | Middle Mouse Button | Pan in a direction | | Right Arrow Key | Move the scene to the **right** | | Left Arrow Key | Move the scene to the **left** | | Up Arrow Key | Move the scene **up** | | Down Arrow Key | Move the scene **down** | | Shift + Up Arrow Key | Zoom **into** the scene | | Shift + Down Arrow Key | Zoom **out of** the scene | | T | Top view | | F | Front view | | B | Back view | | L | Left view | | R | Right view | | F1,F2,F3 | Saved views which can be extended | ### Overlay Buttons [Section titled “Overlay Buttons”](#overlay-buttons) On the right side of the **Scene**, you will notice a set of **overlay buttons**. ![](/doc/unity/assets/newdemoverlay.png) Overlay buttons for hiding components and changing camera positions (views) These buttons are **fully configurable** to allow for custom end-user interactions. In the demo model, they serve the following functions: 1. **Hide/Show Groups** * The first two buttons toggle the visibility of certain groups (e.g., specific machine parts or UI elements). 2. **Camera Positions** * The next four buttons switch between pre-defined camera views, allowing you to quickly navigate to important areas in the scene. More information about the overlay buttons can be found in section [**Overlay Buttons**](/doc/unity/basics/demo-model/#overlay-buttons). Feel free to adapt or extend these buttons for your own project requirements, such as adding more camera angles, toggling additional objects, or triggering other custom actions. ### 3D Buttons [Section titled “3D Buttons”](#3d-buttons) In addition to the **overlay buttons** (used primarily for scene navigation), the demo model also includes **3D Buttons** positioned within the scene. These buttons serve as **virtual stand-ins** for real machine buttons: * **Direct PLC Connection**: Each 3D Button is linked to the PLC signals (inputs/outputs), enabling interaction with the machine’s drives and automation logic. * **Realistic Simulation**: Pressing these buttons in the virtual environment replicates the actions of physical buttons on the actual machine. ![](/doc/unity/assets/newdemobuttons.png) 3D Buttons within the Scene For more information on setting up and customizing these 3D Buttons, see the [**3D Buttons**](/doc/unity/basics/demo-model/#id-3d-buttons) section. ## More Information About the Demo Model [Section titled “More Information About the Demo Model”](#more-information-about-the-demo-model) In this section, you will find additional details about the **realvirtual.io** demo model. You can use this information as a reference when creating or customizing your own models. ### **realvirtual object (prefab)** [Section titled “realvirtual object (prefab)”](#realvirtual-object-prefab) The **realvirtual** object is the foundation of every **realvirtual.io** model. It handles overall settings, provides a base plate, sets up basic lighting, and manages scene navigation in Play mode. > **Important:** You must include this prefab in every model you build to ensure correct functionality and navigation. For more information please check the section [**realvirtual**](/doc/unity/components-and-scripts/game4automation/)**.** ### **3D Components** [Section titled “3D Components”](#3d-components) The demo model includes **pre-prepared 3D components**—such as conveyors, a robot, a machine, and **3D buttons** that interact with the PLC. These elements were created specifically to showcase various **realvirtual.io** features and provide an interactive environment for testing. > **Note:** With **realvirtual.io Professional**, you can import your own CAD data in **STEP format**. For more information, see the [**CAD Import**](/doc/unity/basics/cad-import/) section, which explains how to bring custom 3D models into your Unity scene. Within the **Demo Cell**, you will find a **CNC** component that has been placed into the scene as a **Prefab**. If you want to learn more about how Prefabs work or how to create your own reusable components, see the [**Reusable Components (Prefabs)**](/doc/unity/basics/reusable-components-prefabs/) section. ### Drives and Kinematics [Section titled “Drives and Kinematics”](#drives-and-kinematics) The CNC machine consists of multiple **Drives**, organized into a **Kinematic Hierarchy** that controls machine axes movement. For more details on configuring drives, defining movement, and working with kinematics, refer to the [**Motion and Kinematics**](/doc/unity/components-and-scripts/motion/) section. ![](/doc/unity/assets/newdemomachine.png) Defined kinematic for the CNC Machine The **Drives** in the kinematic hierarchy are linked to **Signals** (specifically, **PLCInputs** and **PLCOutputs**) that are controlled by a **PLC**. In the demo model, the PLC is represented by a **Unity script** within the scene. However, you can also connect an **external PLC** via various **Interfaces** that **realvirtual.io** provides. Connecting to a real PLC is particularly useful for: * **Virtual Commissioning**: Testing and validating PLC code against a virtual model before deploying to a physical system. * **3D HMI**: Using the 3D model as an interactive, real-time human-machine interface. ### **Interfaces** [Section titled “Interfaces”](#interfaces) ![](/doc/unity/assets/image%20\(3\)%20\(1\)%20\(1\)%20\(1\).png)\\ In the demo model, there is a **demonstration interface** set up to work with **TwinCAT**. However, since TwinCAT integration is only available in **realvirtual.io Professional**, the actual interface script for TwinCAT is **not included** in the standard version. ![](/doc/unity/assets/newdemointerface.png) Interface Signals in Demo The TwinCAT interface in the demo model is configured with multiple signals that could be exchanged between the virtual machine and a real Beckhoff PLC. Typically, signals are imported directly from the PLC program via the interface communication (e.g. for Beckhoff) or via a signal table (for other interfaces such as Siemens S7). If you are using **realvirtual.io Professional**, you can fully leverage the TwinCAT interface to establish a live connection to a Beckhoff PLC for virtual commissioning or real-time simulation. For more details on setting up and configuring interfaces for different type of PLCs or robots, refer to the [**Interface** ](/doc/unity/basics/demo-model/#interfaces)section. ### **Sources and MUs** [Section titled “Sources and MUs”](#sources-and-mus) ![](/doc/unity/assets/image%20\(1\)%20\(1\)%20\(2\).png) In realvirtual.io, objects that move based on physics are called [**MUs**](/doc/unity/components-and-scripts/mu-movable-unit/) (movable units). In the demo model, there is one source for the Turbine, which automatically creates a copy of itself (a process called spawning in Unity). It is considered good practice to place newly created MUs as sub-objects of a dedicated object in the Hierarchy. In the demo model, this dedicated object is named **MUs**. During simulation, you can see all dynamically generated MUs under **MUs**. ### **PLCs** [Section titled “PLCs”](#plcs) ![](/doc/unity/assets/image%20\(7\).png)\ Because we do not have real PLCs connected to the demo model, we programmed simple control logic to operate the model. This control logic communicates with the behavior models of drives and sensors, as well as with lights and buttons, by using the Signals defined in the interface section. ![](/doc/unity/assets/newdemoplc.png) PLC code written in Unity scripting and connected to the Signals Defining PLC logic within the model itself is primarily used for pure simulation and demonstration purposes. It can also be useful for preparing virtual commissioning models, where a simple logic helps test the kinematics and functionality of the model before connecting to a real PLC. There are several ways for defining custom logics. Please check the section [**Defining Logic.**](/doc/unity/components-and-scripts/defining-logic/) © 2025 realvirtual GmbH [https://realvirtual.io](https://realvirtual.io/) - All rights reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or by any means, including printing, saving, photocopying, recording, or other electronic or mechanical methods, without the prior written permission of the publisher. # Old Demo Model > First experiences with realvirtual.io based on the demo model Note This is a description of the old demo model which was used until realvirtual 6.0.1. It is still inside of our delivery and you find it under Assets/realvirtual/Scenes/DemoRealvirtualOld.unity The old demo model looks like this: ![](/doc/unity/assets/home-demomodel.png) The old ard demo model #### Start the old demo model [Section titled “Start the old demo model”](#start-the-old-demo-model) The demo model can be started with the play button. You will get a *Scene view* and a *Game View*. If the Game View window is not opened, it will open automatically on start. You can navigate in the scene in both views. The Game View is a preview of the later on the compiled version of Unity. On low performance computers the *Game View* is a little bit slower, than in the final Player version. On good performing computers the difference is negligible. #### Mouse navigation [Section titled “Mouse navigation”](#mouse-navigation) You can navigate in the scene with the mouse or keyboard: | (Mouse) Key | Action | | ------------------------- | --------------------------------- | | Right Mouse Button | Rotate scene | | Middle Mouse Button Wheel | Zoom in and out | | Middle Mouse Button | Pan in a direction | | Right Arrow Key | Move the scene to the **right** | | Left Arrow Key | Move the scene to the **left** | | Up Arrow Key | Move the scene **up** | | Down Arrow Key | Move the scene **down** | | Shift + Up Arrow Key | Zoom **into** the scene | | Shift + Down Arrow Key | Zoom **out of** the scene | | T | Top view | | F | Front view | | B | Back view | | L | Left view | | R | Right view | | F1,F2,F3 | Saved views which can be extended | #### Touch navigation [Section titled “Touch navigation”](#touch-navigation) It is also possible to use touch navigation on mobile devices or windows computers with touch screens. You can pan with one or two fingers. With two fingers it is possible to rotate, pan and zoom. With three fingers the scene can be tilted. #### Space Navigator [Section titled “Space Navigator”](#space-navigator) If you have a 3D mouse from 3DConnextion you can use the mouse to navigate in the 3D scene. ## Some more information about the demo model [Section titled “Some more information about the demo model”](#some-more-information-about-the-demo-model) **Game4automation object (prefab)** The first step for creating a new model, is to place the Realvirtual prefab into the scene. This object handles the overall settings, provides a base plate, the basic lighting and the scene navigation in game mode. You need to use this in every model you build. You can change the parameters of the base plate or the lighting by clicking on the objects. This will override the inherited properties from the realvirtual.io Asset. For more information about Prefabs and inheritance please check the Unity documentation about [Prefabs](https://docs.unity3d.com/Manual/Prefabs.html) or check the [Unity video tutorial ](https://unity3d.com/de/learn/tutorials/topics/interface-essentials/prefabs-concept-usage). **3D Components** The demo model is based on several pre-prepared 3D components like the conveyor, the handling system and the robot. These components were created just for demo purposes. With realvirtual.io Professional you can import your own CAD data based on step files. Please check the section [CADImport](/doc/unity/basics/cad-import/). The 3D components in the demo scene are *Handling, ConveyorCan, ConveyorBox, Cabinet, Robot*) **Interfaces** ![](/doc/unity/assets/image%20\(3\)%20\(1\)%20\(1\)%20\(1\).png)\ The model is equipped with one demonstration Interface. It is an S7 [Interface](/doc/unity/components-and-scripts/interfaces/) to the Siemens Controller. For more information about interfaces please check Section Interface. For demo purposes, in the demo model the interface is turned off so that the model can run in the absence of any external software connections. Nevertheless, signals are created for the interface, and the full model is controlled by a script substituting for a PLC, to handle the signal events. **Signals** Each interface can be of a certain type (S7TCP, Shared Memory, PLCSIM Advanced and so on) and can contain several signals. Signals are usually imported from the counterpart of the interface (for example if Simit is up and running, the signals can be automatically imported from Simit) or signals can be manually created based on the prefabs. See more about Signals and Signal types in Section Interface. In the model you will find several signals, for example *CanGripperClosed,GantryYStart* and so on. On a signal you always see the signal value in the Hierarchy view. For example *False* and *True* for boolean signals. **PLC-Inputs** (which means outputs from Unity) are in **red**. **PLC-Outputs** (which means inputs to Unity) are in **green**. **Sources and MUs** ![](/doc/unity/assets/image%20\(1\)%20\(1\)%20\(2\).png) The objects, which are moving based on Physics, are called [*MU*](/doc/unity/components-and-scripts/mu-movable-unit/) (= movable unit) in realvirtual.io. The model has two sources. One for the cans (*CAN*)= and one for the blue plastic box (*PlasticBox)*. The [Sources ](/doc/unity/components-and-scripts/mu-movable-unit/source/)are automatically creating a copy of itself (this is called spawning in Unity). It is always good practice, to place the newly created [*MU*](/doc/unity/components-and-scripts/mu-movable-unit/)*s* as sub object of a special object in the hierarchy. In the demo model this is the object *MU*. During simulation runtime you will find all dynamically created [*MU*](/doc/unity/components-and-scripts/mu-movable-unit/)*s* under *MU*. **PLCs** ![](/doc/unity/assets/image%20\(7\).png)\ Because we don’t have real PLCs connected to the demo model, we programmed some simple control logic to drive the model. These control logics are communicating with the behavior models of the drives and sensors by using the Signals in the interface section. Note Control logics inside the model are using signals for controlling the model mainly for demo purposes. If you just want to control the model, you can also control the public properties on the drives or sensors directly. See more in Section[ Defining Logic.](/doc/unity/components-and-scripts/defining-logic/) In the Demo model we used [Unity Scripting ](/doc/unity/components-and-scripts/defining-logic/unity-scripting/)for defining the “PLC” logic. You can also use our [Logicsteps](/doc/unity/components-and-scripts/defining-logic/logicsteps/), [Unity Visual Scripting ](/doc/unity/components-and-scripts/defining-logic/unity-visual-scripting/)or [Playmaker ](/doc/unity/basics/demo-model/broken-reference/)if you would like to use more visual approaches. The control logics inside the model are using signals for controlling the model mainly for demo purposes. If you just want to control the model, you can also control the public properties on the drives or sensors directly. See more in Section PLC. **UI** You can add UI components to a scene. These UI components can be connected to signal inputs or outputs of the PLC. For example, this is very useful when you want to replace real buttons with virtual ones in your model. In the UI components you find several elements to control the model. During simulation you can see in the Game-Window the UI elements: ![](/doc/unity/assets/demo-buttons.png) The UI elements can be opened and closed by clicking on the slider button in the middle of the bottom corner of the screen. Additional buttons and tabs can be added to your own models as you would like. © 2025 realvirtual GmbH [https://realvirtual.io](https://realvirtual.io/) - All rights reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or by any means, including printing, saving, photocopying, recording, or other electronic or mechanical methods, without the prior written permission of the publisher. # Editions: Starter vs Professional > Feature overview of realvirtual Starter and Professional realvirtual.io ships in two editions that share the same core engine and the same project format. **Starter** gives you the complete simulation core — drives, sensors, transport, grippers, MUs and logic — everything you need to build and run a digital twin. **Professional** adds the productivity tools, the full industrial interface library, robotics, the HMI suite and realvirtual WEB on top. A project always opens in either edition. Anything you build in Starter keeps working when you move up to Professional — Professional is purely additive. Note Both editions run on the same Unity version and use the same scene and prefab format. Upgrading from Starter to Professional only adds the `io.realvirtual.professional` package — no migration is required. ## Which edition do I need? [Section titled “Which edition do I need?”](#which-edition-do-i-need) * **Starter** — Build and simulate machines and lines, define logic, import geometry, and publish to Windows or WebGL. Ideal for concept design, training and standalone simulations. * **Professional** — Add virtual commissioning against real PLCs and robot controllers, CAD import with live update, robot inverse kinematics, performance tooling for large assemblies, the 3D-HMI suite, multiplayer and realvirtual WEB. Tip Throughout the documentation, Professional-only features are marked with a **(Pro)** suffix in the page title and a hint box at the top of the page. ## Core simulation [Section titled “Core simulation”](#core-simulation) | Feature | Starter | Professional | | --------------------------------------------------------------------------------------------------------------- | :-----: | :----------: | | [Drives, CAM & Kinematic](/doc/unity/components-and-scripts/motion/) | ✅ | ✅ | | [Sensors & Measurement](/doc/unity/components-and-scripts/sensors/) | ✅ | ✅ | | [TransportSurface & Guided Transport](/doc/unity/components-and-scripts/motion/transportsurface/) | ✅ | ✅ | | [Chain & Chain Element](/doc/unity/components-and-scripts/motion/chain/) | ✅ | ✅ | | [MU, Source & Sink](/doc/unity/components-and-scripts/mu-movable-unit/) | ✅ | ✅ | | [Picking & Placing (Grip, Gripper, Fixer, Pattern)](/doc/unity/components-and-scripts/picking-and-placing-mus/) | ✅ | ✅ | | [Changing MUs (Material, Switcher, Part, Cutter)](/doc/unity/components-and-scripts/changing-mus/) | ✅ | ✅ | | [PathTracer](/doc/unity/components-and-scripts/motion/path-tracer/) | — | ✅ | | [KinematicMU](/doc/unity/components-and-scripts/motion/kinematicmu-pro/) | — | ✅ | | [Volume Tracking](/doc/unity/components-and-scripts/volume-tracking-pro/) | — | ✅ | ## Logic & interaction [Section titled “Logic & interaction”](#logic--interaction) | Feature | Starter | Professional | | ------------------------------------------------------------------------------------------------------------------------------------- | :-----: | :----------: | | [Unity Scripting](/doc/unity/components-and-scripts/defining-logic/unity-scripting/) | ✅ | ✅ | | [Behavior Graph](/doc/unity/components-and-scripts/defining-logic/behavior-graph/) | ✅ | ✅ | | [LogicSteps](/doc/unity/components-and-scripts/defining-logic/logicsteps/) | ✅ | ✅ | | [Recorder](/doc/unity/components-and-scripts/defining-logic/recorder/) | ✅ | ✅ | | [3D Buttons & Screen Overlay Buttons](/doc/unity/components-and-scripts/scene-interaction/3d-buttons/) | ✅ | ✅ | | [Lamp, Interact3D, KeyboardMove](/doc/unity/components-and-scripts/scene-interaction/) | ✅ | ✅ | | [Tooltip](/doc/unity/components-and-scripts/scene-interaction/tooltip-pro/) | — | ✅ | | [Scene Selectables](/doc/unity/components-and-scripts/scene-interaction/scene-selectables-pro/) | — | ✅ | | [State Statistics](/doc/unity/components-and-scripts/statistics/state-statistics/) | — | ✅ | | [HMI Components (Tab, Pushbutton, Switch, Value, Slider, …)](/doc/unity/components-and-scripts/scene-interaction/hmi-components-pro/) | — | ✅ | | [ModelZoo](/doc/unity/components-and-scripts/scene-interaction/modelzoo-pro/) | — | ✅ | ## Editor tools [Section titled “Editor tools”](#editor-tools) | Feature | Starter | Professional | | ------------------------------------------------------------------------------------ | :-----: | :----------: | | [Hierarchy Window & Quick Edit](/doc/unity/basics/user-interface/quick-edit/) | ✅ | ✅ | | [Demo Scenes Browser](/doc/unity/basics/user-interface/demo-scenes-browser/) | ✅ | ✅ | | [Model Checker](/doc/unity/basics/user-interface/model-checker/) | ✅ | ✅ | | [Recent Items](/doc/unity/basics/user-interface/recent-items-pro/) | — | ✅ | | [Move Pivot Points](/doc/unity/basics/user-interface/move-pivot-points-pro/) | — | ✅ | | [Selection Window](/doc/unity/basics/selection-window/) | — | ✅ | | [Material Window](/doc/unity/basics/user-interface/material-window-pro/) | — | ✅ | | [Measurement](/doc/unity/basics/user-interface/measurement-pro/) | — | ✅ | | [Kinematic Tool](/doc/unity/basics/user-interface/kinematic-tool-pro/) | — | ✅ | | [Clean Restart](/doc/unity/basics/user-interface/clean-restart-pro/) | — | ✅ | | [Duplicate Finder](/doc/unity/components-and-scripts/tools/duplicate-finder/) | — | ✅ | | [Mesh Tools](/doc/unity/components-and-scripts/tools/mesh-tools/) | — | ✅ | | [Group Assignment Tool](/doc/unity/basics/user-interface/group-assignment-tool-pro/) | — | ✅ | ## CAD & performance [Section titled “CAD & performance”](#cad--performance) | Feature | Starter | Professional | | ------------------------------------------------------------------------------------------------------- | :-----: | :----------: | | [Importing & Exporting (FBX, STEP via Unity, …)](/doc/unity/basics/importing-and-exporting/) | ✅ | ✅ | | [Cadenas parts4cad](/doc/unity/basics/cadenas-parts4cad/) | ✅ | ✅ | | [CADLink (direct CAD import)](/doc/unity/basics/cad-import/cadlink/) | — | ✅ | | [CAD Checker](/doc/unity/basics/cad-import/cad-checker/) | — | ✅ | | [CAD Updater](/doc/unity/basics/cad-import/cad-updater/) | — | ✅ | | [Combine Meshes](/doc/unity/components-and-scripts/performance-tools/combine-meshes-pro/) | — | ✅ | | [Mesh Optimizer](/doc/unity/components-and-scripts/performance-tools/mesh-optimizer-pro/) | — | ✅ | | [Hierarchy Cleanup](/doc/unity/components-and-scripts/performance-tools/hierarchy-cleanup-pro/) | — | ✅ | | [Create Prefab](/doc/unity/components-and-scripts/performance-tools/create-prefab-pro/) | — | ✅ | | [Performance Optimizer](/doc/unity/components-and-scripts/performance-tools/performance-optimizer-pro/) | — | ✅ | ## Robotics [Section titled “Robotics”](#robotics) | Feature | Starter | Professional | | --------------------------------------------------------------------------------------- | :-----: | :----------: | | [Robot Inverse Kinematics](/doc/unity/components-and-scripts/robot-inverse-kinematics/) | — | ✅ | | [Robot Program Export (Beta)](/doc/unity/components-and-scripts/robot-program-export/) | — | ✅ | ## Collaboration & web [Section titled “Collaboration & web”](#collaboration--web) | Feature | Starter | Professional | | ----------------------------------------------------------------------------- | :-----: | :----------: | | [Publishing (Windows, WebGL)](/doc/unity/basics/publishing-the-digital-twin/) | ✅ | ✅ | | [Multiplayer](/doc/unity/multiplayer-pro/) | — | ✅ | | [realvirtual WEB (browser 3D-HMI)](/doc/unity/extensions/realvirtual-web/) | — | ✅ | ## Interfaces [Section titled “Interfaces”](#interfaces) The signal layer and the basic interface tooling are in Starter; the industrial protocol and controller interfaces are Professional. | Feature | Starter | Professional | | ---------------------------------------------------------------------------------------------------- | :-----: | :----------: | | [Signal Manager & Signal Tools](/doc/unity/components-and-scripts/interfaces/signal-manager/) | ✅ | ✅ | | [Signal Importer / Exporter](/doc/unity/components-and-scripts/interfaces/signal-importer-exporter/) | ✅ | ✅ | | [S7 TCP](/doc/unity/components-and-scripts/interfaces/s7-tcp/) | ✅ | ✅ | | [FMI](/doc/unity/components-and-scripts/interfaces/fmi/) | ✅ | ✅ | | [OpenCommissioning](/doc/unity/components-and-scripts/interfaces/opencommissioning/) | ✅ | ✅ | | [Igus Rebel](/doc/unity/components-and-scripts/interfaces/igus-rebel/) | ✅ | ✅ | | [Custom Interfaces (FastInterface)](/doc/unity/components-and-scripts/interfaces/custom-interfaces/) | ✅ | ✅ | | [OPC UA](/doc/unity/components-and-scripts/interfaces/opcua/) | — | ✅ | | [Modbus](/doc/unity/components-and-scripts/interfaces/modbus/) | — | ✅ | | [MQTT](/doc/unity/components-and-scripts/interfaces/mqtt/) | — | ✅ | | [EthernetIP](/doc/unity/components-and-scripts/interfaces/ethernetip/) | — | ✅ | | [UDP](/doc/unity/components-and-scripts/interfaces/udp-pro/) | — | ✅ | | [Websocket](/doc/unity/components-and-scripts/interfaces/websocket-pro/) | — | ✅ | | [TwinCAT (ADS)](/doc/unity/components-and-scripts/interfaces/twincat/) | — | ✅ | | [TwinCAT HMI](/doc/unity/components-and-scripts/interfaces/twincat-hmi/) | — | ✅ | | [PLCSIM Advanced](/doc/unity/components-and-scripts/interfaces/plcsim-advanced/) | — | ✅ | | [Siemens Simit](/doc/unity/components-and-scripts/interfaces/siemens-simit-interface-pro/) | — | ✅ | | [Simit Shared Memory](/doc/unity/components-and-scripts/interfaces/simit-shared-memory/) | — | ✅ | | [Bosch Rexroth ctrlX](/doc/unity/components-and-scripts/interfaces/ctrlx/) | — | ✅ | | [Festo AX Controls / PLCnext](/doc/unity/components-and-scripts/interfaces/festo-plcnext/) | — | ✅ | | [SEW SimInterface](/doc/unity/components-and-scripts/interfaces/sew-siminterface-pro/) | — | ✅ | | [Simulink](/doc/unity/components-and-scripts/interfaces/simulink/) | — | ✅ | | [Windmod Y200](/doc/unity/components-and-scripts/interfaces/windmod-y200-pro/) | — | ✅ | ### Robot controllers [Section titled “Robot controllers”](#robot-controllers) | Feature | Starter | Professional | | ------------------------------------------------------------------------------------ | :-----: | :----------: | | [ABB RobotStudio](/doc/unity/components-and-scripts/interfaces/abb-robotstudio/) | — | ✅ | | [KUKA](/doc/unity/components-and-scripts/interfaces/kuka/) | — | ✅ | | [Fanuc](/doc/unity/components-and-scripts/interfaces/fanuc-pro/) | — | ✅ | | [Denso Robotics](/doc/unity/components-and-scripts/interfaces/denso-robotics-pro/) | — | ✅ | | [Mitsubishi McpX](/doc/unity/components-and-scripts/interfaces/mitsubishi-mcpx/) | — | ✅ | | [Universal Robots](/doc/unity/components-and-scripts/interfaces/universal-robots/) | — | ✅ | | [Keba](/doc/unity/components-and-scripts/interfaces/keba-interface/) | — | ✅ | | [RoboDK](/doc/unity/components-and-scripts/interfaces/robodk/) | — | ✅ | | [Wandelbots Nova](/doc/unity/components-and-scripts/interfaces/wandelbots-nova-pro/) | — | ✅ | | [RFSuite](/doc/unity/components-and-scripts/interfaces/rfsuite-pro/) | — | ✅ | ## Updates & support [Section titled “Updates & support”](#updates--support) | Feature | Starter | Professional | | ----------------------------------------------------------------------------------------------- | :-----: | :----------: | | [Customer Portal](/doc/unity/customer-portal/) | ✅ | ✅ | | [Login & Download Updates (User Hub, UPM Registry)](/doc/unity/login-and-download-updates-pro/) | — | ✅ | ## Upgrading from Starter to Professional [Section titled “Upgrading from Starter to Professional”](#upgrading-from-starter-to-professional) To move from Starter to Professional, add the `io.realvirtual.professional` package next to your existing `io.realvirtual.starter` package — follow the same steps as in the [Installation](/doc/unity/basics/installation/) guide. Your scenes, prefabs and references are preserved automatically. ## See Also [Section titled “See Also”](#see-also) * [Installation](/doc/unity/basics/installation/) * [Release Notes](/doc/unity/release-notes/) * [License Conditions](https://realvirtual.io/en/license-conditions/) # Folder Structure > Package and folder structure of realvirtual Note Starting with version **6.3**, realvirtual is distributed as **UPM (Unity Package Manager) packages**. The folder structure changed significantly from the previous `Assets/realvirtual/` layout used in 6.0 and earlier. ## Package Overview [Section titled “Package Overview”](#package-overview) ![](/doc/unity/assets/folder-structure.png) realvirtual UPM package structure realvirtual is split into two UPM packages: | Package | Location | Description | | ------------------------------- | --------------------------------------- | --------------------------------------------------------------------- | | **io.realvirtual.starter** | `Packages/io.realvirtual.starter/` | Core framework — drives, sensors, signals, transport, gripping, logic | | **io.realvirtual.professional** | `Packages/io.realvirtual.professional/` | Professional add-on — IK, CADLink, interfaces, multiplayer, and more | Caution UPM packages are **read-only** in Unity. You cannot edit files inside `Packages/`. Place your own scenes, scripts, and assets in the `Assets/` folder. ## Starter Package Layout [Section titled “Starter Package Layout”](#starter-package-layout) The Starter package (`Packages/io.realvirtual.starter/`) contains: | Folder | Description | | ----------------------- | ------------------------------------------------------------------------------------------------------------------------ | | **Assets/** | User-facing assets you drag into scenes | | Assets/3DPrefabs/ | Industrial 3D models (conveyors, robots, boxes, fences) | | Assets/Materials/ | Industrial materials (plastics, metals, lamp indicators) | | Assets/Prefabs/ | Core functional prefabs (realvirtual.prefab, signal prefabs, interfaces) | | Assets/UIPrefabs/ | Runtime UI overlay prefabs | | Assets/Settings/ | Editor gizmo options, camera presets | | Assets/RenderPipelines/ | URP pipeline configuration and settings | | **Runtime/** | All runtime C# scripts (components, behaviors, interfaces) | | **Editor/** | Editor tools, inspectors, and toolbar | | **Samples\~/** | Demo scenes — import via [Demo Scenes Browser](/doc/unity/basics/user-interface/demo-scenes-browser/) or Package Manager | ## Professional Package Layout [Section titled “Professional Package Layout”](#professional-package-layout) The Professional package (`Packages/io.realvirtual.professional/`) contains: | Folder | Description | | ------------------------ | ------------------------------------------------------------------------------------------------------------- | | **Runtime/** | Pro features organized by domain | | Runtime/IK/ | [Robot Inverse Kinematics](/doc/unity/components-and-scripts/robot-inverse-kinematics/) + robot prefabs | | Runtime/Interfaces/ | All Pro [interfaces](/doc/unity/components-and-scripts/interfaces/) (OPC-UA, TwinCAT, KUKA, UR, Modbus, etc.) | | Runtime/CADLink/ | [CAD file import](/doc/unity/basics/cad-import/) | | Runtime/PathTracer/ | Motion trail visualization | | Runtime/Statistics/ | Simulation statistics | | Runtime/Multiplayer/ | Multi-user networking | | Runtime/HighlightSystem/ | Object highlighting and selection | | Runtime/DistanceSystem/ | Distance measurement and connectable objects | | **Editor/** | Pro editor tools | | **Samples\~/** | Pro demo scenes (PLC Interfaces, Robotics, Robot Interfaces, Advanced Features) | ## Key Asset Locations [Section titled “Key Asset Locations”](#key-asset-locations) When setting up scenes, you will frequently need these assets: | What you need | Where to find it | | ----------------------- | --------------------------------------------------------------------------------------------------------------------------------- | | Main framework prefab | `Packages/io.realvirtual.starter/Assets/Prefabs/realvirtual.prefab` | | Industrial 3D prefabs | `Packages/io.realvirtual.starter/Assets/3DPrefabs/` | | Materials library | `Packages/io.realvirtual.starter/Assets/Materials/` | | PLC signal prefabs | `Packages/io.realvirtual.starter/Assets/Prefabs/` | | Interface prefabs (Pro) | `Packages/io.realvirtual.professional/Runtime/Interfaces//` | | Robot prefabs (Pro) | `Packages/io.realvirtual.professional/Runtime/IK/` | | Demo scenes | Import via [Demo Scenes Browser](/doc/unity/basics/user-interface/demo-scenes-browser/) or **Window > Package Manager > Samples** | ## Your Project Content [Section titled “Your Project Content”](#your-project-content) Place all your project files in `Assets/`: * **Scenes** — your simulation scenes * **Scripts** — custom C# scripts and behaviors * **Prefabs** — your own reusable prefabs * **Materials** — custom materials * **Imported CAD data** — files imported via CADLink ## Previous Folder Structure (6.0 and earlier) [Section titled “Previous Folder Structure (6.0 and earlier)”](#previous-folder-structure-60-and-earlier) Note In versions before 6.3, realvirtual was distributed as a `.unitypackage` installed into `Assets/realvirtual/`. This folder no longer exists in UPM-based installations. See the [Upgrade Guide](/doc/unity/advanced-topics/upgrade-guide/) for migration instructions. # Importing and exporting > Assets and models importing and exporing Note This page covers **realvirtual-specific** import and export features. Unity itself supports a wide range of standard file formats including FBX, OBJ, 3DS, DXF, and many more. For information about Unity’s general import and export capabilities, please refer to the [Unity Documentation on Importing Assets](https://docs.unity3d.com/Manual/ImportingAssets.html). ## Overview [Section titled “Overview”](#overview) realvirtual provides specialized import and export workflows for industrial automation applications: **Importing:** * **[CAD Files](#cad-import)** - STEP, IGES, JT formats via Unity Pixyz or realvirtual CADLink * **[GLB Assets](#importing-glb-assets)** - Industry-standard 3D format with full metadata preservation (Professional) **Exporting:** * **[GLB Assets](#exporting-glb-assets-beta)** - Export models with realvirtual components and properties preserved (Professional, Beta) * **[Unity Packages](#exporting-unity-packages)** - Export projects, scenes, or selected assets with all dependencies All realvirtual-specific properties (drives, sensors, IK configurations) are fully preserved when exporting and importing GLB files in Professional version. ## Importing Assets [Section titled “Importing Assets”](#importing-assets) ### CAD Import [Section titled “CAD Import”](#cad-import) For importing CAD files (STEP, IGES, JT, etc.) into Unity, realvirtual supports two primary methods: Note For detailed information about CAD import workflows, see the [CAD Import](/doc/unity/basics/cad-import/) documentation. **Unity Pixyz Plugin** (Recommended) Unity Industry includes the Pixyz Plugin, which provides native CAD import capabilities directly within Unity. Pixyz supports a wide range of CAD formats and offers advanced features like tessellation control, hierarchy preservation, and optimization tools. **realvirtual CADLink** The realvirtual CADLink feature provides automated CAD import workflows with additional automation-specific optimizations for virtual commissioning scenarios. ### Importing GLB Assets [Section titled “Importing GLB Assets”](#importing-glb-assets) **Prerequisites** For GLB import functionality, the UnityGLTF package is required. To install it: 1. Open Unity’s Package Manager (Window → Package Manager) 2. Click the **+** button in the top-left corner 3. Select **Add package from git URL** 4. Enter: `https://github.com/KhronosGroup/UnityGLTF.git` 5. Click **Add** **How to Import:** Unity automatically imports GLB files placed in the Assets folder. The imported GLB files appear as prefabs in the Project window and can be used like any other Unity prefab. 1. Place the GLB file in your Assets folder (Unity will automatically import it) 2. The GLB file will appear as a prefab in the Project window 3. Drag and drop the prefab into your scene like a normal Unity prefab Note In realvirtual.io Professional, all realvirtual-specific properties (drives, sensors, IK configurations) are fully preserved when importing GLB files that were exported from realvirtual. ## Exporting Assets [Section titled “Exporting Assets”](#exporting-assets) ### Export Menu Overview [Section titled “Export Menu Overview”](#export-menu-overview) The realvirtual.io menu includes several functions for exporting assets located under **realvirtual → Export**: ![](/doc/unity/assets/glb-export-menu.png) realvirtual Export Menu * **Export realvirtual GLB Asset** - Export selected GameObject as GLB file with realvirtual metadata (Beta) * **Full project as package** - Export entire project as Unity package * **Current scene as package** - Export active scene with dependencies as Unity package * **Selected as package** - Export selected asset with dependencies as Unity package * **Full project as ZIP** - Export entire project as ZIP file ### Exporting Unity Packages [Section titled “Exporting Unity Packages”](#exporting-unity-packages) For Unity packages, all references are automatically included in the export. To import exported packages, drag them into another project or select *Assets → Import Package* in the Unity Menu. ### Exporting GLB Assets (Beta) [Section titled “Exporting GLB Assets (Beta)”](#exporting-glb-assets-beta) **Prerequisites** For GLB export and import functionality, the UnityGLTF package is required. To install it: 1. Open Unity’s Package Manager (Window → Package Manager) 2. Click the **+** button in the top-left corner 3. Select **Add package from git URL** 4. Enter: `https://github.com/KhronosGroup/UnityGLTF.git` 5. Click **Add** **About glTF and GLB** **glTF** (GL Transmission Format) is an open-standard 3D file format developed by the Khronos Group (the same organization behind OpenGL and Vulkan). It is designed as an efficient, interoperable format for transmitting and loading 3D content across applications, often referred to as the “JPEG of 3D” due to its widespread adoption and efficiency. **GLB** is the binary variant of glTF that packages all assets (geometry, textures, materials, animations) into a single binary file, making it easier to share and distribute 3D content. **Key characteristics:** * **Industry Standard**: Widely supported across 3D applications, web browsers, game engines, and AR/VR platforms * **Compact and Efficient**: Optimized for fast transmission and loading * **Complete Asset Storage**: Includes geometry, materials, textures, animations, and scene hierarchy in one file * **Extensible**: Supports custom extensions for application-specific data **Common Use Cases:** * Web-based 3D viewers and configurators * AR/VR applications and experiences * Asset exchange between different 3D software tools * 3D model libraries and marketplaces * Digital twin visualization in external applications **realvirtual GLB Export** realvirtual extends the standard GLB format by serializing automation-specific properties (drives, sensors, inverse kinematics configurations, etc.) into the GLB file. This allows you to export complete automation assets that can be: * Viewed in any standard glTF/GLB viewer (geometry and materials) * Re-imported into realvirtual.io Professional with full functionality preserved Caution **Important**: Full functionality of exported GLB files (including realvirtual-specific properties) is only preserved when importing back into realvirtual.io Professional. **How to Export:** 1. Select the GameObject you want to export in the Hierarchy 2. Go to **realvirtual → Export → Export realvirtual GLB Asset** 3. A dialog will appear showing the default export path 4. Click **OK** to export to the default location, or **Browse** to choose a different folder 5. The export supports both internal (Assets/) and external folders Note GLB export is a beta feature available in realvirtual.io Professional version 6.0.7 and above. **Viewing GLB Files** To preview and inspect exported GLB files, you can use free online viewers such as the [Babylon.js Sandbox](https://sandbox.babylonjs.com/). Simply drag and drop your GLB file into the browser window to view the 3D model with its geometry, materials, and textures. ### Exporting as ZIP File [Section titled “Exporting as ZIP File”](#exporting-as-zip-file) #### Manual ZIP Export [Section titled “Manual ZIP Export”](#manual-zip-export) To share or save the entire project, you can save the entire project folder as a ZIP file. The advantage is that in this case everything, including all settings, will be saved and you can be sure that the recipient will receive exactly the same project. You can do this manually with your prefered ZIP file tool. Before creating the ZIP file, it is best to delete the *Library* folder, this will significantly reduce the size and no information will be lost. The *Library* folder will be created automatically if it is missing. #### Automated ZIP Export [Section titled “Automated ZIP Export”](#automated-zip-export) You find within the realvirtual.io main menu (`realvirtual → Export → Full project as ZIP`) a fully automated solution for exporting the project as a ZIP file without the `Library` and `Temp` folders. Caution With very large projects the integrated ZIP export function might fail and crash Unity because the full operation is handled within the main memory. If it fails please use the manual method outside the Unity editor with a ZIP file of your choice. ### Publishing Applications [Section titled “Publishing Applications”](#publishing-applications) Note To export your project as a fully running application (executable), see [Publishing the Digital Twin](/doc/unity/basics/publishing-the-digital-twin/) documentation. This allows you to build standalone applications for Windows, Mac, Linux, WebGL, and other platforms. © 2025 realvirtual GmbH [https://realvirtual.io](https://realvirtual.io/) - All rights reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or by any means, including printing, saving, photocopying, recording, or other electronic or mechanical methods, without the prior written permission of the publisher. # Installation > Installing realvirtual.io and Unity Before you dive into the world of realvirtual.io, you’ll need to set up your development environment correctly. Here’s a step-by-step guide to get you started. ## realvirtual.io 6.3 (Unity 6.3 LTS) [Section titled “realvirtual.io 6.3 (Unity 6.3 LTS)”](#realvirtualio-63-unity-63-lts) Tip **Supported Unity Version**: realvirtual.io 6.3 requires **Unity 6.3 LTS** (version number **6000.3** in Unity Hub). Note Starting with version 6.3, realvirtual is distributed as **Unity Package Manager (UPM) packages** (`io.realvirtual.starter`, `io.realvirtual.professional`). The installation depends on where you purchased realvirtual — see Step 3 below. Note **Automatic Configuration**: For new installations, [Project Settings](/doc/unity/basics/project-settings/) are applied automatically in the background to optimize your Unity project for industrial automation. For updates to existing projects, a dialog will appear asking if you want to apply these settings. ### Step 1: Install Unity 6.3 LTS [Section titled “Step 1: Install Unity 6.3 LTS”](#step-1-install-unity-63-lts) Install **Unity 6.3 LTS** through the Unity Hub. In Unity Hub, the version number is displayed as **6000.3** (e.g., 6000.3.5f1). For detailed instructions, refer to Unity’s official installation guide. 🔗 [Unity 6 Installation guide](https://docs.unity3d.com/Manual/GettingStartedInstallingUnity.html) ### Step 2: Create a New Unity Project [Section titled “Step 2: Create a New Unity Project”](#step-2-create-a-new-unity-project) 1. Open **Unity Hub** and click **New project**. 2. Select **Universal 3D** under Core templates to use the Universal Render Pipeline (URP). 3. Set a project name and choose a location for the project folder. 4. Ensure **Editor version 6000.3** (Unity 6.3 LTS) is selected. 5. Click **Create project**. ![](/doc/unity/assets/installation-63-new-project.png) Creating a new Universal 3D project with Unity 6.3 LTS ### Step 3: Install realvirtual Packages [Section titled “Step 3: Install realvirtual Packages”](#step-3-install-realvirtual-packages) The installation depends on where you purchased realvirtual. Choose the section that applies to you. #### Purchased from the Unity Asset Store [Section titled “Purchased from the Unity Asset Store”](#purchased-from-the-unity-asset-store) 1. Open **Window > Package Manager** in Unity. 2. Select **My Assets** in the left panel. 3. Find **realvirtual Starter** (and **realvirtual Professional** if purchased) and click **Download**. 4. After downloading, click **Import** to install the UPM packages into your project. #### Purchased directly from realvirtual.io [Section titled “Purchased directly from realvirtual.io”](#purchased-directly-from-realvirtualio) For your first installation, download the `.tgz` package files from the **realvirtual Customer Portal**. The link and login credentials are provided on your invoice. After downloading, install the packages in Unity: 1. Open **Window > Package Manager**. 2. Click the **+** button in the top-left corner and select **Install package from tarball…**. ![](/doc/unity/assets/installation-63-install-from-tarball.png) Install package from tarball in Package Manager 3. Navigate to the downloaded `.tgz` file and select **io.realvirtual.starter** first. ![](/doc/unity/assets/installation-63-select-tarball.png) Select the starter package tarball file 4. Wait for the import to complete. This may take a few minutes. 5. Repeat the process for **io.realvirtual.professional** if you purchased the Professional edition. ![](/doc/unity/assets/installation-63-tarball-installed.png) realvirtual Professional installed via tarball in Package Manager ##### Setting Up User Hub for Future Updates [Section titled “Setting Up User Hub for Future Updates”](#setting-up-user-hub-for-future-updates) After installing the packages, the **realvirtual** menu appears in the Unity menu bar. Use the built-in **User Hub** to manage updates: 1. Go to **Tools > realvirtual > User Hub** in the Unity menu. ![](/doc/unity/assets/installation-63-userhub-menu.png) Open User Hub from the realvirtual menu 2. In the **Login** tab, enter your **Invoice Number**, **Billing ZIP Code**, and **Email**. Click **Login**. ![](/doc/unity/assets/installation-63-userhub-login.png) User Hub login with invoice credentials ##### Activate UPM Registry (Recommended) [Section titled “Activate UPM Registry (Recommended)”](#activate-upm-registry-recommended) To receive automatic update notifications, activate the realvirtual UPM Registry: 1. In User Hub, go to the **Packages** tab. 2. Click **Activate UPM Registry**. ![](/doc/unity/assets/installation-63-userhub-packages.png) Activate UPM Registry in the Packages tab 3. Unity will add a scoped registry to your **Project Settings > Package Manager** and show a confirmation dialog. ![](/doc/unity/assets/installation-63-scoped-registry-dialog.png) Scoped registry added to Project Settings 4. Future updates will now appear automatically in the Package Manager under **My Registries**. Use **Check for Updates** in User Hub to verify. ##### Manual Updates via Tarball [Section titled “Manual Updates via Tarball”](#manual-updates-via-tarball) Alternatively, you can download newer versions from the **Downloads** tab in User Hub (or from the Customer Portal) and install them via **Install package from tarball** as described above. ![](/doc/unity/assets/installation-63-userhub-downloads.png) Download packages from the User Hub Downloads tab ### Step 4: Handle Signature Warnings [Section titled “Step 4: Handle Signature Warnings”](#step-4-handle-signature-warnings) Caution When installing packages from the Customer Portal or User Hub (not from the Asset Store), Unity may show a **Missing Signature** or **Invalid Signature** warning. This is expected — realvirtual packages distributed outside the Asset Store are not Unity-signed. It is safe to click **Close** and continue. ![](/doc/unity/assets/installation-63-missing-signature.png) Missing Signature warning — safe to close ![](/doc/unity/assets/installation-63-invalid-signature.png) Invalid Signature warning — safe to close ### Step 5: Import Demo Scenes [Section titled “Step 5: Import Demo Scenes”](#step-5-import-demo-scenes) After installation, a dialog will ask if you want to import the **Getting Started** demo scene. Click **Import Now** to get started right away. ![](/doc/unity/assets/installation-63-demo-import-dialog.png) Import the Getting Started demo scene You can import additional demo categories at any time using two methods: **Via Package Manager:** Select **realvirtual Starter** (or Professional) in the Package Manager, go to the **Samples** tab, and click **Import** for the demo categories you want. ![](/doc/unity/assets/installation-63-package-samples.png) Import demo scene categories from the Samples tab **Via Demo Scenes Browser:** Go to **Tools > realvirtual > Demo Scenes Browser** in the Unity menu. This window shows all available demo scenes organized by category with descriptions. ![](/doc/unity/assets/installation-63-open-demo-menu.png) Open Demo Scenes Browser from the realvirtual menu ![](/doc/unity/assets/installation-63-demo-browser.png) Demo Scenes Browser with categories and scene descriptions ### Step 6: Explore the Demo Scene [Section titled “Step 6: Explore the Demo Scene”](#step-6-explore-the-demo-scene) The Getting Started demo scene opens automatically after import. It showcases a complete automation cell with conveyors, a robot, sensors, and a machine — all working together. ![](/doc/unity/assets/installation-63-demo-scene.png) realvirtual 6.3 demo scene Press **Play** in the Unity Editor to start the simulation and see the automation in action. ### Possible Problems and Fixes [Section titled “Possible Problems and Fixes”](#possible-problems-and-fixes) #### Wrong Input System [Section titled “Wrong Input System”](#wrong-input-system) If you see red error messages in the **Console** related to the Input System, make sure that the **Active Input Handling** in **Project Settings > Player > Configuration** is set to **Both (old and new Input System)**. #### Wrong Render Pipeline [Section titled “Wrong Render Pipeline”](#wrong-render-pipeline) If your demo scene appears pink, you may be using the wrong render pipeline. We recommend switching to the **Universal Render Pipeline (URP)**. See [Render Pipelines](/doc/unity/advanced-topics/render-pipelines/) for details. #### TextMesh Pro Essentials Not Imported [Section titled “TextMesh Pro Essentials Not Imported”](#textmesh-pro-essentials-not-imported) If you encounter problems with text in the Runtime UI, go to **Window > TextMeshPro > Import TMP Essential Resources** to install the required components. ### (Optional) Clean Up Unnecessary Unity Demo Folders [Section titled “(Optional) Clean Up Unnecessary Unity Demo Folders”](#optional-clean-up-unnecessary-unity-demo-folders) To keep your project clean, you can delete Unity’s default demo assets if present: * **Scenes** * **Settings** * **TutorialInfo** *** ## Upgrading from realvirtual 6.0 to 6.3 [Section titled “Upgrading from realvirtual 6.0 to 6.3”](#upgrading-from-realvirtual-60-to-63) If you have an existing project using **realvirtual 6.0.x** (the `.unitypackage` version), follow these steps to migrate to the new UPM package format. Caution **Important: Two-Step Process** — First upgrade Unity, then upgrade realvirtual. Do not attempt both simultaneously. ### Step 1: Upgrade Unity to 6.3 LTS [Section titled “Step 1: Upgrade Unity to 6.3 LTS”](#step-1-upgrade-unity-to-63-lts) 1. Open **Unity Hub** and change the **Editor Version** of your project to **6000.3** (Unity 6.3 LTS). 2. Accept any compatibility warnings and let Unity convert your project. ### Step 2: Remove the old realvirtual folder [Section titled “Step 2: Remove the old realvirtual folder”](#step-2-remove-the-old-realvirtual-folder) 1. **Close Unity** completely. 2. Delete the **Assets/realvirtual** folder from your project directory (this is the old `.unitypackage` content). 3. Delete the **Library** folder to force Unity to regenerate all cached metadata. Note **Don’t worry about references!** All references in your scenes and prefabs are preserved. Unity maintains them through GUIDs, even when folders are deleted and reimported from a different location. ### Step 3: Install the UPM packages [Section titled “Step 3: Install the UPM packages”](#step-3-install-the-upm-packages) 1. Reopen your project in Unity 6.3 LTS. You will see compilation errors — this is expected. 2. Install the new UPM packages following **Step 3** from the [installation instructions above](#step-3-install-realvirtual-packages) (either via Asset Store or Customer Portal tarball). 3. After the packages are installed, compilation errors should be resolved. ### Step 4: Verify the upgrade [Section titled “Step 4: Verify the upgrade”](#step-4-verify-the-upgrade) 1. Check the **Console** window for any remaining errors. 2. Open one of your scenes and verify that all components, references, and materials are intact. 3. If materials appear pink, go to **Tools > realvirtual > Settings > Switch to Universal Render Pipeline (URP)** to convert them. Tip After upgrading, you can use the [User Hub](#setting-up-user-hub-for-future-updates) to set up the UPM Registry for future automatic updates. *** ## realvirtual.io 6.0 (Unity 6 — .unitypackage) [Section titled “realvirtual.io 6.0 (Unity 6 — .unitypackage)”](#realvirtualio-60-unity-6--unitypackage) Caution This section covers the **legacy .unitypackage** installation for realvirtual 6.0.x. For version 6.3 and later, follow the UPM instructions above. [Tutorial realvirtual.io 6 and Unity 6 Installation](https://www.youtube-nocookie.com/embed/KT8qJ8BOJaQ) Tutorial realvirtual.io 6 and Unity 6 Installation ### Step 1: Install Unity 6 LTS [Section titled “Step 1: Install Unity 6 LTS”](#step-1-install-unity-6-lts) Install **Unity 6000.0 LTS** (Unity 6) through the Unity Hub. ### Step 2: Create a New Unity Project [Section titled “Step 2: Create a New Unity Project”](#step-2-create-a-new-unity-project-1) 1. Open **Unity Hub**. 2. Select **Universal 3D** under Core templates. 3. Ensure **Editor version 6000.0 LTS** is selected. 4. Click **Create Project**. ![](/doc/unity/assets/Installation-newProject.png) ### Step 3: Install realvirtual.io 6 [Section titled “Step 3: Install realvirtual.io 6”](#step-3-install-realvirtualio-6) * **Direct Purchase from realvirtual.io**: 1. Download the `realvirtual.unitypackage` file from your account on the realvirtual.io download website. 2. Drag and drop the file into the Unity Project window, or go to **Assets > Import Package > Custom Package**. * **Unity Asset Store**: 1. Open **Window > Package Manager**. 2. Under **My Assets**, locate **realvirtual.io 6** and click **Download**, then **Import**. When prompted about a **URP Upgrade**, select **Install / Upgrade**. ![](/doc/unity/assets/install-urpupgrade.png) Installation Warning ![](/doc/unity/assets/install-importpackage.png) Import Unity Package After import, the demo scene opens automatically. [](/doc/unity/assets/newdemo.mp4) Demo scene after installation ### Possible Problems and Fixes [Section titled “Possible Problems and Fixes”](#possible-problems-and-fixes-1) See the [problems and fixes section above](#possible-problems-and-fixes) — the same issues and solutions apply. *** ## realvirtual.io 2022 and before [Section titled “realvirtual.io 2022 and before”](#realvirtualio-2022-and-before) ### 1. Install Unity [Section titled “1. Install Unity”](#1-install-unity) If you haven’t already, install Unity on your computer. Unity offers both free and licensed versions, depending on your use case. Check Unity’s official website [here](https://store.unity.com/) to determine which version suits your needs. [Installation of realvirtual.io 2022 (old deprecated version)](https://www.youtube-nocookie.com/embed/Pn4QTBucbMM) Installation of realvirtual.io 2022 (old deprecated version) > Our new releases is always based on the latest Unity Long Term stable release. Our main version number (e.g. 6) always corresponds to the Unity version number. For example to run realvirtual.io 2022.09 you need Unity 2022.03 LTS. ### 2. Unity Hub (Recommended) [Section titled “2. Unity Hub (Recommended)”](#2-unity-hub-recommended) We highly recommend installing Unity Hub, a tool that simplifies managing multiple projects and Unity installations. You can download Unity Hub from Unity’s official download pages. ### 3. Create a New Project [Section titled “3. Create a New Project”](#3-create-a-new-project) Launch Unity and create a new empty project by selecting “New.” Choose a location on your computer to store your project files and give your project a name. Then, click “Create Project.” When prompted to choose a template, select the standard 3D template. This will form the foundation of your project: ![](/doc/unity/assets/image%20\(8\).png) Creating a new Unity Project with the Unity Hub ### 5. Ensure .Net Standard Framework 2.1 and Mono are Enabled [Section titled “5. Ensure .Net Standard Framework 2.1 and Mono are Enabled”](#5-ensure-net-standard-framework-21-and-mono-are-enabled) By default, Unity should have .Net Standard 2.1 and Mono enabled. However, in some cases, especially when integrating realvirtual.io into an older project, this setting might be incorrect. To confirm or change this setting: * Go to Player Settings by selecting “Build Settings” > “Player Settings.” * Under “Configuration,” change the Scripting Runtime Version to ”.NET Standard 2.1” For the scripting backend, it’s recommended to start with Mono rather than IL2CPP, as Mono typically compiles much faster. ![](/doc/unity/assets/player-netframework.png) Selecting the .Net Standard 2.1 in the Unity Player Project Settings ### 6. Acquire realvirtual.io [Section titled “6. Acquire realvirtual.io”](#6-acquire-realvirtualio) Go to the Unity Asset Store and purchase the version of realvirtual.io that suits your needs, whether it’s Lite or Professional. ### 7. Import realvirtual.io [Section titled “7. Import realvirtual.io”](#7-import-realvirtualio) You can import realvirtual.io directly from the Unity Asset Store or manually download the asset. To install it manually, follow these steps: * From the main menu, go to “Assets” > “Import Package” > “Custom Package…” * A new window will appear, displaying the contents of the realvirtual.io package. Select “All” and click “Import.” ![](/doc/unity/assets/image%20\(10\)%20\(1\).png) Import custom package This will show a new window with all the realvirtual.io package contents: ![](/doc/unity/assets/image%20\(5\)%20\(1\).png) Please select *All* and *Import*. ### 8. Verify Installation [Section titled “8. Verify Installation”](#8-verify-installation) After importing the realvirtual.io package, check for the following: * You should see an additional “realvirtual” folder (previously “game4automation” before 2022) in your project structure. * A new “realvirtual” menu should be available in the main menu bar. ![](/doc/unity/assets/demoscene.png) Project view after realvirtual.io installation ### 9. Set Standard Settings [Section titled “9. Set Standard Settings”](#9-set-standard-settings) Note Usually, standard settings are applied automatically after a fresh installation or update of realvirtual.io. However, if you encounter compile errors in the console window, it may be due to conflicts between your existing project assets and realvirtual.io. In such cases: * Address the compile errors first to ensure there are none remaining. * Once errors are resolved, apply the standard settings by selecting “realvirtual” > “Apply Standard Settings” from the main menu. ![](/doc/unity/assets/applyStandardSetting.png) Applying standard settings will configure: * Standard layer naming (for physics). * Standard physics collision matrix. * Standard light settings. Congratulations! You’ve now completed the installation process and are ready to explore the Demomodel outlined in the documentation. # Physics > Simulating real world physics One of the great advantages of Unity is the very well-functioning physics simulation. It is based on the [NVIDIA ](https://nvidia.com)PhysX engine, which has been extended with the Unity API. The Unity engine is able to simulate very large systems with many meshes and moving objects. This is combined with a very realistic and good real-time rendering. The approach of realvirtual.io is based on a combination of physical and kinematic motion capabilities. In some cases it is advantageous to use physical movements, in other cases it is recommended to use purely kinematic movements. The strength of Unity and realvirtual.io is that we can combine both worlds to get very realistic, powerful, but also stable and accurate models. Note If you need very high quality physics simulation with multi contact simulation and high accurate dynamics, you can also use [AGX Dynamics for Unity](/doc/unity/extensions/agx-physics/), which is supported by realvirtual.io ## Physical and kinematic movements [Section titled “Physical and kinematic movements”](#physical-and-kinematic-movements) ### Free physical movements of movable units [Section titled “Free physical movements of movable units”](#free-physical-movements-of-movable-units) In automation systems, freely movable objects are very often required. We call this kind of objects in realvirtual.io [MU ](/doc/unity/components-and-scripts/mu-movable-unit/)(movable unit). [`MUs` ](/doc/unity/components-and-scripts/mu-movable-unit/)are goods on a conveyor belt or objects on a workpiece carrier, in general the products moving in a Digital Twin of a production system. Physical movements means that these MUs move due to physical collisions, forces and gravity. Just like in the real world. This allows for very realistic behavior and takes into account all collisions between MUs and the environment without having to program any special motion or behavior logic. In Unity, everything simulated via the Unity Physics Engine must hava a RigidBody component attached to. In realvirtual.io, Sources (see the [source.md](/doc/unity/components-and-scripts/mu-movable-unit/source/ "mention") section) create [MUs](/doc/unity/components-and-scripts/mu-movable-unit/). After a MU is created, the physical properties look like this: ![](/doc/unity/assets/physics-mu.png) MU with gravity turned on and IsKinematic turned off As you can see *Use Gravity* is enabled and the *Is Kinematic* property is turned off. Tip *Is Kinematic* turned off (false) means, that the object is freely moving based on collisions and physical forces. ### Stability of TransportSurfaces [Section titled “Stability of TransportSurfaces”](#stability-of-transportsurfaces) Normal transport on conveyor systems is modelled by [TransportSurfaces. ](/doc/unity/components-and-scripts/motion/transportsurface/)If your transport system is very complex and you have a lot of colliders you should consider the following things: * use the simples colliders possible (best is box collider) * put the colliders on the standard layers (see [#colission-matrix](/doc/unity/basics/physics/#colission-matrix "mention")) * You can limit the freedom of the RigidBodies with a setting on the [TransportSurface:](/doc/unity/components-and-scripts/motion/transportsurface/) ![](/doc/unity/assets/physics-constraintsenter.png) Limiting the freedom of movement on enter and exit onto a TransportSurface ### Kinematic movements [Section titled “Kinematic movements”](#kinematic-movements) For parts that do not move freely physically like MUs are defined as kinematic parts. This applies, for example, to the motion of the machines themselves. For example, motor-driven axes, such as those found in robots and machines, are all represented with kinematic motion. Kinematic means that the position of the drive and the kinematic chain for multiple axes is precisely defined by their geometric parent - children relationship, excluding any application of force. Forces and the possibility that the kinematic chain may break are not considered in purely kinematic simulations. The engine calculates the exact current position of a part based on the different drive positions. We call this the kinematic motions. Caution Trying to represent e.g. a robot via PhysX joints (i.e. not kinematic) is often problematic, because the PhysX physics solver has a kind of “spring effect” in the axes themselves so that exact positioning is not possible. Therefore we use kinematic movements for this purpose. Kinematic movements are realized based on the GameObject hierarchy. This means that when a parent object moves, the child object also moves. This is Unity’s default behavior for non-physical objects. These objects must still have a *RigidBody* to allow accurate position and sensor collision detection, but the *Use Gravity* property must be turned off and the *IsKinematic* property turned on. Tip *IsKinematic* turned on (true) means, that the GameObject moves based on the parent child relation and the local transform positions. There is no spring effect in the joints and there are no forces calculated. This is how a moving arm of a robot looks like: ![](/doc/unity/assets/physics-robotarm.png) Robot arm, kinematic chain and IsKinematic turned on If you attach a Drive to a hierarchy level, realvirtual.io automatically adds a RigidBody and handles property settings for Kinematic movements. ## Articulation Body [Section titled “Articulation Body”](#articulation-body) With Unity 2020.1 the physics was upgraded to PhysX4.0. Unity introduced the new concept of articulation: a set of bodies organized in a logical tree, where a parent-child relation expresses the idea of mutually constrained motion. There is always a single root body, and there can be no loops. The transform hierarchy is used to express articulations. The amount of degrees of freedom in a given parent-child relationship depends on the actual joint type used. For more information please check Note To use Articulation Bodies is just an option. We still recommend to use standard realvirtual.io Kinematic definitions based on drives and transforms. If you would like to use Articulation Bodies you must attach the realvirtual.io Drive to the Articulation Body. The Drive position will now be transformed to the Articulation Body. The Drive direction needs to be set to “virtual” because the Direction of the Joint (and the connected drive) will be defined by the Articulation Body. You can check an example on realvirtual.io Community Github ![](/doc/unity/assets/physics-articulationbody.png) Robot arm with Articulation Body and a Drive (Direction set to "virtual"). ## Collision Matrix [Section titled “Collision Matrix”](#collision-matrix) To deliver fast collision detection, realvirtual.io uses an individual collision matrix. This matrix is automatically generated when you select *Tools > realvirtual > Apply standard settings*. realvirtual.io is using the following special collision layers: ![](/doc/unity/assets/physics-collider.png) Physics - realvirtual.io collision matrix (up to version 2021) ![](/doc/unity/assets/image%20\(1\)%20\(2\).png) Physics - realvirtual.io collission matrix (version 2022 and above) | Layer (until 2021) | Layer (2022 and above) | Description | | -------------------- | ---------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | g4a SensorMU | rvMUSensor | Layer for the collision body of moving units () that should interact with sensors such as light barriers. Due to the limitations with the Mesh Collider this collision body should be a Box Collider. | | g4a TransportMU | rvMUTransport | Layer for the transport collision body of an. This can be a mesh collider to provide realistic collisions. | | g4a Sensor | rvSensor | Layer for detection areas such as light beams and so on. Usually this should be a box collider. | | g4a Transport | rvTransport | Layer for the collision body of transport surfaces or for placing objects onto a plate. | | g4a MU | rvMU | Layer for MUs where one box collider is sufficient for transport collisions and sensor detections. | | g4a Snapping | rvSnapping | Only used in Simulation Library - Layer for snapping detection | | g4a CollisionDynamic | rvSimDynamic | Only used in Simulation Library - Layer for moving Transportables on path system | | g4a CollissionSatic | rvSimStatic | Only used in Simulation Library - Layer for detecting Transportables on path system, used by Workstations | | g4a Postprocessiong | deleted | not used - for future usage | | g4a Lamps | deleted | not used - for future usage | | g4a Debug | deleted | not used - for future usage | ## Physic solver settings [Section titled “Physic solver settings”](#physic-solver-settings) Physics settings are described in detail on the Unity webpage but we would like give you some hints based on our experience. First of all you should only change something in the Physics settings, if you are not happy with stability and performance. Usually the standard settings work quite well. ### Physics Step Time [Section titled “Physics Step Time”](#physics-step-time) Unity is calculating physics in a fixed steptime. This is when the FixedUpdate methods are getting called. You can change the time steps by selecting `Edit > Project Settings > Time:` ![](/doc/unity/assets/physics-steptime.png) Changing the fixed timestep The standard setting is 20ms. You can decrease it e.g. to 5ms. This will increase physical calculation quality but also increase your processor load. If your processor load is getting to high you well see that screen update rates are getting low (e.g. 60ms and less). ### Solver Iterations [Section titled “Solver Iterations”](#solver-iterations) Another possibility to generate better physics simulation is to increase the solver iterations. You can increase solver iterations to generate better quality but this will increase also your load. Typically, it’s used to reduce the jitter resulting from joints or contacts. ![](/doc/unity/assets/physics-settings.png) Solver iterations and solver type ### Physics Solver [Section titled “Physics Solver”](#physics-solver) Another setting which usually generates better physics is to change the solver type from standard (`Projected Gauss Seidel`*)* to `Temporal Gauss Seidel.` It usually helps when you experience some erratic behavior during simulation with the default solver. We recommend to use this setting. For more information check the Unity documentation: 🔗 © 2025 realvirtual GmbH [https://realvirtual.io](https://realvirtual.io/) - All rights reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or by any means, including printing, saving, photocopying, recording, or other electronic or mechanical methods, without the prior written permission of the publisher. # Project Settings Unity project configuration optimized for industrial automation with realvirtual framework. ## Overview [Section titled “Overview”](#overview) The Apply Standard Settings feature configures Unity projects with optimal settings for industrial automation development. These settings ensure the best performance, stability, and user experience when working with realvirtual components. Note **Automatic Application**: Standard settings are usually applied automatically after a fresh installation or update of realvirtual.io. However, if you encounter compile errors, you may need to apply them manually. ## When to Apply Settings Manually [Section titled “When to Apply Settings Manually”](#when-to-apply-settings-manually) ### After Resolving Compile Errors [Section titled “After Resolving Compile Errors”](#after-resolving-compile-errors) If you encounter compile errors in the console window, it may be due to conflicts between your existing project assets and realvirtual.io: 1. **Address compile errors first** to ensure there are none remaining 2. Once errors are resolved, apply the standard settings by selecting **“realvirtual” > “Apply Standard Settings”** from the main menu ### Manual Application [Section titled “Manual Application”](#manual-application) You can manually apply these settings at any time through the realvirtual menu: 1. Go to **realvirtual** menu in Unity’s main menu bar 2. Select **“Apply Standard Settings”** 3. Confirm the application when prompted ![Recommended Project Settings Dialog](/doc/unity/assets/recommended-project-settings-dialog.png) Dialog asking to apply standard realvirtual project settings for optimal automation configuration Caution **Use Carefully for Existing Projects**: The Recommended Project Settings feature makes significant changes to Unity project configuration. Review the changes carefully before applying to existing projects. ## Settings Applied [Section titled “Settings Applied”](#settings-applied) Applying standard settings will configure: * **Standard layer naming** (for physics) * **Standard physics collision matrix** * **Standard light settings** ![Applied Settings Summary](/doc/unity/assets/recommended-project-settings-applied.png) Summary of successfully applied settings showing layers, scene view, build settings, physics, and performance optimizations ### Additional Optimizations [Section titled “Additional Optimizations”](#additional-optimizations) The system also configures additional Unity settings for optimal industrial automation performance: #### Project Structure [Section titled “Project Structure”](#project-structure) * **Layers & Collision Matrix**: Configured for automation components * **Scene View Optimization**: Hierarchy collapsed, shaded mode enabled * **UI Layer Management**: Hidden from Tools visibility for cleaner interface #### Development Tools [Section titled “Development Tools”](#development-tools) * **Transform Tools**: Move tool active with Pivot/Local mode enabled * **realvirtual Tools**: QuickEdit toolbar and overlay enabled * **Script Icons**: Configured in Gizmos folder for better visual identification #### Build & Runtime Settings [Section titled “Build & Runtime Settings”](#build--runtime-settings) * **Build Settings**: Linear color space, Mono backend, .NET Standard 2.0 * **Physics Optimization**: 50Hz update rate with improved solver accuracy * **Performance Settings**: VSync disabled, background execution enabled ## Detailed Logging [Section titled “Detailed Logging”](#detailed-logging) The Console provides detailed information about each change made during the configuration process: ![Console Log Details](/doc/unity/assets/recommended-project-settings-console.png) Console log showing detailed information about each setting applied, including specific Unity menu paths The console log shows: * Timestamped entries for each change * Specific Unity menu paths for verification * Confirmation of successful application * Reference information for troubleshooting ## Benefits [Section titled “Benefits”](#benefits) ### Performance Optimization [Section titled “Performance Optimization”](#performance-optimization) * **Physics Settings**: Optimized for industrial simulation accuracy * **Rendering**: Linear color space for better visual quality * **Background Execution**: Continuous operation when Unity loses focus ### Development Experience [Section titled “Development Experience”](#development-experience) * **Clean Interface**: Optimized tool visibility and organization * **Efficient Workflow**: Pre-configured tools and shortcuts * **Visual Clarity**: Better scene organization and component identification ### Industrial Automation Focus [Section titled “Industrial Automation Focus”](#industrial-automation-focus) * **Collision Management**: Proper layer setup for automation components * **Precision**: Enhanced physics solver for accurate movement * **Compatibility**: .NET Standard 2.0 for broader platform support ## See Also [Section titled “See Also”](#see-also) * [Installation Guide](/doc/unity/basics/installation/) - Complete installation process * [Project Path Display](/doc/unity/basics/user-interface/project-path-display/) - Toolbar project path feature * [Quick Edit](/doc/unity/basics/user-interface/quick-edit/) - Quick edit overlay menu # Publishing the Digital Twin > Distributing the Digital Twin to partners, customers and prospects You can run your Digital Twin simulation model in the Unity Editor by clicking the “Play” button. However, this requires the Unity Editor to be installed. Publishing the Digital Twin allows you to share it with customers, partners, and prospects without having the Unity Editor installed or the need of any license. Like publishing a “game”. ## Build Settings [Section titled “Build Settings”](#build-settings) For publishing you first need to define your build settings. Build settings is opened by `File > Build Settings...` ![](/doc/unity/assets/publishing-buildsettings.png) Build settings In Build settings the destination platform (WebGL, Windows, Linux, Mac, Android, iOS and so on) and the scene (the model) which should be included into build needs to be defined. After selecting Build you are asked to define the destination folder of your build. For some destination platforms you need to install additional packages to your Unity installation. There are some limitations, specially with some interfaces, for some destination platforms, which are described in [supported-platforms.md](/doc/unity/advanced-topics/supported-platforms/ "mention") Please also check Unity Documentation for more information about making a build: 🔗 ## Publishing Platforms [Section titled “Publishing Platforms”](#publishing-platforms) realvirtual supports multiple publishing platforms to distribute your Digital Twin: * [Windows](/doc/unity/basics/publishing-the-digital-twin/windows/) - Standalone Windows executable builds * [WebGL](/doc/unity/basics/publishing-the-digital-twin/webgl/) - Browser-based deployment * [CMC ViewR](/doc/unity/basics/publishing-the-digital-twin/cmc-viewr/) - Integration with CMC ViewR platform * [Innoactive](/doc/unity/basics/publishing-the-digital-twin/innoactive/) - Cloud hosting and VR streaming platform Select the platform that best fits your distribution needs. Each platform has specific requirements and optimizations detailed in their respective documentation pages. © 2025 realvirtual GmbH [https://realvirtual.io](https://realvirtual.io/) - All rights reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or by any means, including printing, saving, photocopying, recording, or other electronic or mechanical methods, without the prior written permission of the publisher. # CMC ViewR > Integration with CMC ViewR platform for advanced visualization CMC ViewR is an advanced immersive viewing application specifically designed for visualizing CAD data. It supports a variety of immersive experiences, including use with VR glasses and large 3D projections, providing an enhanced and interactive environment for users. The application supports the import of scenes from **realvirtual**, allowing seamless integration and visualization of complex industrial digital twin scenes within the CMC ViewR platform. Note This feature requires **realvirtual Professional** license. Caution **Beta Feature**: CMC ViewR integration is currently in Beta (available since release 6.0.7-beta). The functionality and workflow may change in future releases. Please report any issues or feedback to realvirtual support. ## Restrictions and Limitations [Section titled “Restrictions and Limitations”](#restrictions-and-limitations) When exporting realvirtual scenes to CMC ViewR, please note the following restrictions: ### Unsupported Components [Section titled “Unsupported Components”](#unsupported-components) The following components are not supported as CMC ViewR provides its own interaction and navigation systems: * **SceneSelectables** - Not working (CMC ViewR uses its own selection and interaction system) * **DebugConsole** - Not working (replaced by CMC ViewR’s debugging and logging features) * **RealvirtualRuntimeUI** - Not working (replaced by CMC ViewR’s interaction and scene navigation interface) ### Custom Scripts Requirement [Section titled “Custom Scripts Requirement”](#custom-scripts-requirement) * **Custom scripts must be inside an Assembly Definition** - Any custom scripts you’ve created need to be organized within an Assembly Definition file (.asmdef) to be properly included in the AssetBundle export. See the [Preparing the Scripts](/doc/unity/basics/publishing-the-digital-twin/cmc-viewr/#2-preparing-the-scripts) section below for detailed instructions. Note **Automatic Deactivation**: When the AssetBundle is loaded in CMC ViewR, all components except **realvirtualController** are automatically deactivated. The realvirtualController remains active to maintain core simulation functionality, while CMC ViewR handles all user interaction, scene navigation, and UI presentation through its native platform features. ## Overview [Section titled “Overview”](#overview) CMC ViewR is an XR (extended reality) platform designed specifically for industrial applications, enabling professionals to work with digital twins in the industrial metaverse built directly from 3D data. The platform excels at real-time 3D visualization of CAD data and supports both VR headsets and large 3D projections. ### Key CMC ViewR Capabilities [Section titled “Key CMC ViewR Capabilities”](#key-cmc-viewr-capabilities) **Virtual Engineering:** * Concept evaluation and validation on digital prototypes * Virtual commissioning and industrial engineering * Error reduction through early validation * Digital twin applications for plant coordination **Virtual Showroom:** * Immersive product demonstrations without physical prototypes * Reduced logistics and exhibition costs * Maximum product customization flexibility * Independent of physical product availability **Collaboration:** * Multi-user virtual project rooms * Supports both VR headsets and desktop participants * Real-time collaboration across distributed teams * Point cloud integration with 3D data ### Hannover Fair 2024 Demonstration [Section titled “Hannover Fair 2024 Demonstration”](#hannover-fair-2024-demonstration) Here is a presentation of CMC ViewR and realvirtual on Hannover Fair 2024: [Video](https://www.youtube-nocookie.com/embed/7hAN-QGV7XQ) ## Integrating realvirtual AssetBundles into CMC ViewR [Section titled “Integrating realvirtual AssetBundles into CMC ViewR”](#integrating-realvirtual-assetbundles-into-cmc-viewr) The CMC AssetBundleBuilder enables the visualization of realvirtual Unity scenes in CMC ViewR with full functionality. This guide explains the necessary steps to export a Unity scene as an AssetBundle and load it into CMC ViewR. ### Download CMC AssetBundleBuilder [Section titled “Download CMC AssetBundleBuilder”](#download-cmc-assetbundlebuilder) Download and import the CMC AssetBundleBuilder Unity package into your realvirtual project: 📎 [CMC AssetBundleBuilder Unity Package](/doc/unity/assets/CMC_AssetBundleBuilder.unitypackage) To install: 1. Download the Unity package file using the download button above 2. In Unity, go to **Assets > Import Package > Custom Package…** 3. Select the downloaded `CMC_AssetBundleBuilder.unitypackage` 4. Import all files in the package ### 1. Preparing the Unity Scene [Section titled “1. Preparing the Unity Scene”](#1-preparing-the-unity-scene) CMC ViewR uses its own user interface (UI) within the scene. You can keep your Unity cameras and UI elements active - CMC ViewR will handle the viewing environment. ### 2. Preparing the Scripts [Section titled “2. Preparing the Scripts”](#2-preparing-the-scripts) To ensure all scene functionalities are successfully transferred into the AssetBundle, the required scripts need to be placed in a specific directory and associated with an **Assembly Definition**. For more information about Unity Assembly Definitions, see the official Unity documentation: 🔗 [Unity Assembly Definition Files Documentation](https://docs.unity3d.com/Manual/ScriptCompilationAssemblyDefinitionFiles.html) ![](/doc/unity/assets/image%20\(26\).png) *Unity context menu to create an Assembly Definition* All realvirtual scripts are already equipped with Assembly Definitions. However, if you have additional functionality, it’s important to include these in a corresponding Assembly Definition. The following figure shows an example. ![](/doc/unity/assets/image%20\(27\).png) *Example of an Assembly Definition for additional functionality* ### 3. Creating the AssetBundle [Section titled “3. Creating the AssetBundle”](#3-creating-the-assetbundle) Once the scene is prepared, the AssetBundle can be built. For this, the **CMC AssetBundleBuilder** is used. The main function of the AssetBundleBuilder is to convert the objects in the currently loaded scene, along with their scripts, into an AssetBundle, which can then be loaded into CMC ViewR. To do this, open the AssetBundleBuilder window via the toolbar under the **CMC** tab. In this window, you need to provide two inputs: * The storage location for the AssetBundle * The name of the AssetBundle After setting these values, click the **Generate AssetBundle** button to build the AssetBundle. ![](/doc/unity/assets/image%20\(28\).png) *CMC AssetBundleBuilder window* ### 4. Importing the AssetBundle into CMC ViewR [Section titled “4. Importing the AssetBundle into CMC ViewR”](#4-importing-the-assetbundle-into-cmc-viewr) In CMC ViewR, Unity AssetBundles with the `.unity3d` format can be imported. To load an AssetBundle, open the **Start** tab and select the **Import** function. ![](/doc/unity/assets/image%20\(29\).png) *Import function in CMC ViewR* ### 5. Using ViewR [Section titled “5. Using ViewR”](#5-using-viewr) After successfully importing the AssetBundle, the scene can be viewed in CMC ViewR. ![](/doc/unity/assets/image%20\(30\).png) Loaded realvirtual AssetBundle in CMC ViewR CMC ViewR launches with a default desktop configuration. You can rotate the camera using the right mouse button and navigate through the scene with the middle mouse button. More features of ViewR can be explored in the **ViewR Manual**, which is available at: [ViewR Manual](https://www.cmc-viewr.de/de/downloads). ## CMC ViewR Resources [Section titled “CMC ViewR Resources”](#cmc-viewr-resources) For more information about CMC ViewR: * [CMC ViewR Official Website](https://www.cmc-viewr.de/en) * [CMC ViewR Manual (Downloads)](https://www.cmc-viewr.de/de/downloads) * [CMC ViewR Features](https://www.cmc-viewr.de/en/features) ## Related Publishing Options [Section titled “Related Publishing Options”](#related-publishing-options) * [Windows Publishing](/doc/unity/basics/publishing-the-digital-twin/windows/) - Create the Windows build first as a prerequisite * [WebGL Publishing](/doc/unity/basics/publishing-the-digital-twin/webgl/) - Browser-based deployment alternative * [Innoactive](/doc/unity/basics/publishing-the-digital-twin/innoactive/) - Cloud streaming platform * [Mixed Reality with Meta Quest3](/doc/unity/advanced-topics/mixed-reality-with-meta-quest3/) - Direct VR/AR deployment ## See Also [Section titled “See Also”](#see-also) * [VR Builder](/doc/unity/extensions/vr-builder/) - Alternative VR development tools * [Industrial Metaverse](/doc/unity/extensions/realvirtual.io-industrial-metaverse/) - Multi-user VR/AR solutions © 2025 realvirtual GmbH [https://realvirtual.io](https://realvirtual.io/) - All rights reserved. # Innoactive > Cloud hosting and streaming platform for Windows builds The realvirtual Streaming Platform (powered by Innoactive technology) enables you to publish and stream your Digital Twin to desktop browsers and VR headsets without requiring users to download or install anything. Users simply access a URL to interact with your simulation in real-time. ![realvirtual Demo Scene streaming in Innoactive](/doc/unity/assets/innoactive-demo-scene.png) realvirtual industrial simulation running in Innoactive cloud streaming platform ## Overview [Section titled “Overview”](#overview) The realvirtual Streaming Platform hosts your Windows builds in the cloud and streams them to end users via their browser or VR headset. All compute processing happens on the cloud servers, so users can access complex industrial simulations even on lightweight devices. The platform provides a complete content management system for uploading, organizing, and sharing your digital twins. ### How It Works [Section titled “How It Works”](#how-it-works) 1. **Upload** - Build your Digital Twin as a Windows executable and upload it to the realvirtual Streaming Platform 2. **Host** - Your application runs on cloud servers with full processing power 3. **Stream** - Users access your simulation through a simple URL in their browser or VR headset 4. **Interact** - Real-time interaction with mouse, keyboard, touch, or VR controllers The streaming platform shows your uploaded applications in a gallery view where users can browse and launch different scenes and experiences. ![Innoactive Streaming Platform gallery view](/doc/unity/assets/innoactive-platform-gallery.png) Innoactive Streaming Platform showing uploaded applications including realvirtual demos, 3D HMI, and other Unity projects ### Key Innoactive Capabilities [Section titled “Key Innoactive Capabilities”](#key-innoactive-capabilities) **Windows Build Hosting:** * Upload and host your Windows builds in the cloud * No installation required for end users * Automatic updates and version management * Enterprise-grade content management system (CMS) **XR Cloud Streaming:** * Stream to Meta Quest, Vive Focus, Apple Vision Pro * Desktop browser access without plugins * Remote compute processing for complex simulations * Low-latency streaming technology **Enterprise Deployment:** * Training deployment to employees, customers, and suppliers * Product showrooms and sales demonstrations * Industrial design reviews and planning * Scalable cloud infrastructure **Industry Applications:** * Manufacturing process training and visualization * Equipment operation simulation * Facility planning and digital twin reviews * Remote collaboration and demonstrations ### realvirtual Integration [Section titled “realvirtual Integration”](#realvirtual-integration) realvirtual Professional integration with Innoactive enables: * Upload Windows builds of your Digital Twin to the cloud * Stream interactive simulations to VR headsets and browsers * Remote access to complex industrial models without local installation * Multi-user collaborative experiences * Easy distribution to customers and partners worldwide ## Innoactive Resources [Section titled “Innoactive Resources”](#innoactive-resources) For more information about Innoactive, visit: * [Innoactive Official Website](https://www.innoactive.io/) - XR Streaming platform * [Innoactive Portal](https://www.innoactive.io/) - Enterprise XR CMS documentation ## Alternative VR Solutions [Section titled “Alternative VR Solutions”](#alternative-vr-solutions) While Innoactive documentation is being prepared, consider these VR development options: * [VR Builder](/doc/unity/extensions/vr-builder/) - Open-source VR training creation * [Mixed Reality with Meta Quest3](/doc/unity/advanced-topics/mixed-reality-with-meta-quest3/) - Direct Meta Quest integration * [Industrial Metaverse](/doc/unity/extensions/realvirtual.io-industrial-metaverse/) - Multi-user VR/AR solutions ## Related Publishing Options [Section titled “Related Publishing Options”](#related-publishing-options) * [Windows Publishing](/doc/unity/basics/publishing-the-digital-twin/windows/) - Standalone Windows executables * [WebGL Publishing](/doc/unity/basics/publishing-the-digital-twin/webgl/) - Browser-based deployment * [CMC ViewR](/doc/unity/basics/publishing-the-digital-twin/cmc-viewr/) - Advanced 3D visualization platform ## See Also [Section titled “See Also”](#see-also) * [VR Modules](/doc/unity/extensions/realvirtual.io-industrial-metaverse/vr-modules/) - VR interaction components * [AR Modules](/doc/unity/extensions/realvirtual.io-industrial-metaverse/ar-modules/) - Augmented reality features * [Scene Interaction](/doc/unity/components-and-scripts/scene-interaction/) - Interactive elements © 2025 realvirtual GmbH [https://realvirtual.io](https://realvirtual.io/) - All rights reserved. # WebGL Publishing > Browser-based deployment of your Digital Twin using WebGL WebGL builds allow you to run your Digital Twin directly in web browsers without any installation. This enables easy sharing and access through URLs, making it ideal for demonstrations and client presentations. ## Prerequisites [Section titled “Prerequisites”](#prerequisites) WebGL build needs to be done with IL2CPP, and Windows DLLs which are used in some interfaces can’t be used (only way to communicate from a browser is Websocket). ### Required Folder Deletions [Section titled “Required Folder Deletions”](#required-folder-deletions) For building WebGL, you need to delete the following folders if they are in your project: * CADLink * SpaceNavigator * All Interfaces (besides MQTT and TwinCATHMI - these both are the only ones which are possible with WebGL) * parts4cad * RobotIK Note When building to WebGL the rotation of the scene is done with the left mouse button and not the middle mouse button because web browsers have a different mouse button behavior. ## Build Configuration [Section titled “Build Configuration”](#build-configuration) ### 1. Set WebGL Platform [Section titled “1. Set WebGL Platform”](#1-set-webgl-platform) Set WebGL in Build Settings: ![](/doc/unity/assets/platforms-webgl.png) Setting WebGL in Build Settings ### 2. Scripting Define Symbols [Section titled “2. Scripting Define Symbols”](#2-scripting-define-symbols) Make sure that in Player Settings Scripting Define Symbols you have the same settings as for Windows (e.g., `GAME4AUTOMATION` and `GAME4AUTOMATION_PROFESSIONAL`). ### 3. Graphics API Configuration [Section titled “3. Graphics API Configuration”](#3-graphics-api-configuration) Disable Auto Graphics API in Player Settings to use exclusively WebGL2 (recommended): ![](/doc/unity/assets/platforms-AutoGrahicsAPI.png) WebGL2 Graphics API configuration ### 4. Compression Settings [Section titled “4. Compression Settings”](#4-compression-settings) In Publishing Settings set Decompression Fallback - this prevents problems with some web servers. ![](/doc/unity/assets/platforms-DecompressionFallback.png) Decompression Fallback setting ## Build Process [Section titled “Build Process”](#build-process) Caution WebGL builds take sometimes a very long time (up to 1 hour), specially for the first build. As soon as the build is successful Unity starts automatically a temporary web server and opens your browser with your WebGL build. For running the WebGL build you need to copy the result of the build (the content of your build folder) to a web server. 1. Open **File > Build Settings** 2. Select **WebGL** as the target platform 3. Configure Player Settings as described above 4. Click **Build** and choose your destination folder 5. Wait for the build to complete (this may take 30-60 minutes) 6. Unity will automatically start a local web server and open your browser ## WebGL Template (realvirtual Professional) [Section titled “WebGL Template (realvirtual Professional)”](#webgl-template-realvirtual-professional) Enhance your Unity WebGL projects with the **realvirtual** WebGL Template, offering a full-screen, responsive design for an improved user experience compared to the standard Unity WebGL Template. ### Installation Steps [Section titled “Installation Steps”](#installation-steps) 1. **Locate Template Files**: Find the template files in your Unity project at: ```bash Assets/realvirtual/Professional/WebGLTemplate/realvirtual ``` 2. **Copy Template Files**: Copy these files. 3. **Paste into WebGLTemplates**: Paste the copied files into: ```bash Assets/WebGLTemplates/realvirtual ``` ### Setting the Template [Section titled “Setting the Template”](#setting-the-template) 1. Open Unity. 2. Go to **Edit > Project Settings**. 3. In **Player** settings, find **Resolution and Presentation**. 4. Choose the **realvirtual** template from the “Template” dropdown menu. 5. Save your changes. ![](/doc/unity/assets/webgl-template.png) realvirtual WebGL Template selection ## Deployment [Section titled “Deployment”](#deployment) ### Web Server Requirements [Section titled “Web Server Requirements”](#web-server-requirements) To deploy your WebGL build: 1. Copy the entire build folder contents to your web server 2. Ensure your web server supports: * Proper MIME types for Unity files * Compression (gzip or Brotli) * HTTPS (recommended for full functionality) ### Common Web Servers [Section titled “Common Web Servers”](#common-web-servers) * **Apache**: Add .htaccess with proper MIME types * **nginx**: Configure mime.types for Unity file extensions * **IIS**: Add MIME types in web.config * **Cloud platforms**: AWS S3, Azure Static Web Apps, GitHub Pages ## Interface Support [Section titled “Interface Support”](#interface-support) WebGL builds have limited interface support due to browser security restrictions: **Supported Interfaces:** * MQTT (Pro) - Websocket-based messaging * TwinCAT HMI (Pro) - Websocket-based communication **Not Supported:** * OPC-UA * S7 TCP/IP * Modbus * TwinCAT ADS * Shared Memory * Any Windows DLL-based interfaces For full interface compatibility, use [Windows builds](/doc/unity/basics/publishing-the-digital-twin/windows/). ## Performance Considerations [Section titled “Performance Considerations”](#performance-considerations) * **Build Time**: First builds can take 30-60 minutes * **File Size**: WebGL builds are typically larger than native builds * **Runtime Performance**: 60-70% of native performance is typical * **Memory**: Browser memory limitations apply * **Mobile**: Limited support on mobile browsers ## Browser Compatibility [Section titled “Browser Compatibility”](#browser-compatibility) Recommended browsers: * Chrome/Edge (Chromium-based) - Best performance * Firefox - Good compatibility * Safari - Basic support (may have limitations) ## Troubleshooting [Section titled “Troubleshooting”](#troubleshooting) ### Build Fails [Section titled “Build Fails”](#build-fails) * Ensure all incompatible folders are deleted * Check that IL2CPP is selected as scripting backend * Verify WebGL module is installed in Unity Hub ### Build Runs Locally But Not on Server [Section titled “Build Runs Locally But Not on Server”](#build-runs-locally-but-not-on-server) * Check web server MIME type configuration * Verify compression settings match build settings * Ensure HTTPS is enabled if using certain features ### Performance Issues [Section titled “Performance Issues”](#performance-issues) * Reduce scene complexity * Use texture compression * Optimize draw calls * Consider quality settings for WebGL ## See Also [Section titled “See Also”](#see-also) * [Windows Publishing](/doc/unity/basics/publishing-the-digital-twin/windows/) - Full-featured native builds * [Supported Platforms](/doc/unity/advanced-topics/supported-platforms/) - Platform compatibility matrix * [Improving Performance](/doc/unity/advanced-topics/improving-performance/) - Optimization techniques © 2025 realvirtual GmbH [https://realvirtual.io](https://realvirtual.io/) - All rights reserved. # Windows Publishing > Building standalone Windows executables for your Digital Twin Building for Windows allows you to distribute your Digital Twin as a standalone executable that runs on Windows machines without requiring Unity Editor or any special licenses. ## Build Settings [Section titled “Build Settings”](#build-settings) To build for Windows, select **Windows** as the target platform in Build Settings (`File > Build Settings...`). ## Player Settings [Section titled “Player Settings”](#player-settings) For building on Windows, the following settings are recommended in Player Settings. ### Scripting Backend [Section titled “Scripting Backend”](#scripting-backend) Mono compiles much faster than IL2CPP and is recommended for most Windows builds. ![](/doc/unity/assets/publish-buildsettings.png) Mono and .Net Framework player build settings ### Scripting Define Symbols [Section titled “Scripting Define Symbols”](#scripting-define-symbols) Please also make sure that Scripting Define Symbols are set as needed for your installation (see [compiler-defines.md](/doc/unity/advanced-topics/compiler-defines/ "mention")). ![](/doc/unity/assets/publish-buildsettings2.png) Scripting Define Symbols configuration ## Build Process [Section titled “Build Process”](#build-process) 1. Open **File > Build Settings** 2. Select **Windows** as the target platform 3. Click **Add Open Scenes** to include your Digital Twin scene 4. Configure Player Settings as described above 5. Click **Build** and choose your destination folder 6. Unity will create an executable and data folder ## Distribution [Section titled “Distribution”](#distribution) After building, you will have: * **YourProjectName.exe** - The executable file * **YourProjectName\_Data** folder - Required data and assets * **UnityPlayer.dll** and other DLL files - Required Unity runtime libraries Distribute all files together. The executable requires the data folder and DLLs to run properly. ## Performance Considerations [Section titled “Performance Considerations”](#performance-considerations) * **Mono vs IL2CPP**: Mono compiles faster and has similar runtime performance for most scenarios * **Graphics API**: Windows supports DirectX 11 and DirectX 12 * **Architecture**: Target x86\_64 for modern 64-bit Windows systems * **Optimization**: Use IL2CPP for production builds if startup time is not critical ## Interface Support [Section titled “Interface Support”](#interface-support) Windows builds support all realvirtual interfaces including: * OPC-UA * S7 TCP/IP * Modbus * TwinCAT ADS * MQTT * Shared Memory * And all other platform-specific interfaces For interface limitations on other platforms, see [supported-platforms.md](/doc/unity/advanced-topics/supported-platforms/ "mention"). ## See Also [Section titled “See Also”](#see-also) * [WebGL Publishing](/doc/unity/basics/publishing-the-digital-twin/webgl/) - Browser-based deployment * [Supported Platforms](/doc/unity/advanced-topics/supported-platforms/) - Platform compatibility matrix * [Compiler Defines](/doc/unity/advanced-topics/compiler-defines/) - Configuration symbols © 2025 realvirtual GmbH [https://realvirtual.io](https://realvirtual.io/) - All rights reserved. # Reusable Components (Prefabs) > >- ## Overview [Section titled “Overview”](#overview) Prefabs are powerful assets that allow developers to create, store, and reuse preconfigured game objects and their components. When creating optimal prefabs for your project, keep the following best practices in mind: 1. **Simplify GameObject Structure**\ Ensure the hierarchy is as simple as possible. Avoid unnecessary nesting or components to improve performance and maintainability. The realvirtual tool “[Clean Up Hierarchy](/doc/unity/components-and-scripts/performance-tools/combine-meshes-pro/#hierarchy-clean-up)” supports this. 2. **Use Instantiated Materials**\ All materials should be instantiated. This helps reduce memory usage and allows efficient batching during rendering. You can use the option “Set and Create Materials” in the [CAD link](/doc/unity/basics/cad-import/cadlink/#step-import-settings) component and create instantiated materials when importing your data. 3. **Use Instantiated Meshes**\ Ensure that meshes are unique instances to avoid conflicts and improve compatibility when creating prefabs. 4. **Combine Meshes**\ If components consists of several meshes use the [**Mesh Combine**](/doc/unity/components-and-scripts/performance-tools/combine-meshes-pro/) to merge multiple meshes into a single mesh. 5. **Share Materials Where Possible**\ Use shared materials across multiple objects to minimize the number of draw calls. The fewer unique materials, the better the performance. By adhering to these principles, you can create prefabs that are efficient, scalable, and ready for integration into complex projects. ## Creating Prefabs in realvirtual (Pro) [Section titled “Creating Prefabs in realvirtual (Pro)”](#creating-prefabs-in-realvirtual-pro) The `PrefabGenerator` is a utility designed to simplify the creation of prefabs. It operates in the Unity Editor and automates the process of generating prefabs, including handling sub-assets such as dynamically created meshes within child objects. It also considers Drives, Kinematics, and Group definitions, preserving their structure when creating the prefab. The PrefabGenerator also includes instantiated meshes in the scene (e.g., from previous combining), resulting in lighter scenes. Caution Combine Meshs and Create Prefab are only included in realvirtual.io Professional version Please also check detailled documentation here: [Combine Meshes](/doc/unity/components-and-scripts/performance-tools/combine-meshes-pro/) [Create Prefab](/doc/unity/components-and-scripts/performance-tools/create-prefab-pro/) ### Usage [Section titled “Usage”](#usage) * Select the GameObject in the Scene Hierarchy that you want to convert into a prefab. * Right-Click in the hierarchy area and select realvirtual/Create Prefab * A prefab will be created in the `Assets/` folder with the same name as the selected GameObject. ### Example [Section titled “Example”](#example) For the example, we start with a CNC machine where components like “Drives” are already defined, along with some group definitions. ![](/doc/unity/assets/PrefabGenerateStateBefore.png) Game Object structure after import: starting point To prepare this GameObject as a prefab, follow these steps: * Clean up the hierarchy: realvirtual/Clean up Hierarchy * using realvirtual/Combine Meshes for every main Game Object After these steps the structure look like this: ![](/doc/unity/assets/PrefabGeneratorStateAfterMeshCombine%20\(1\).png) Now your Game Object is prepared and ready to create a prefab: [](/doc/unity/assets/PrefGenerateFinal.mp4) # Revision management > Controlling your development realvirtual.io (Unity) projects can be controlled by a revision management system. A revision management system is providing several big advantages: * You always know how has changed what in your project * You can always step back to all versions of your project * You can separate developments into different branches * You can merge branches back into your main branch A revision management is very usefull when you are working on big projects with a bigger team. There are several revision management systems available which can work with Unity. For example you could work with [Subversion](https://subversion.apache.org) or [GIT](https://git-scm.com). Even if GIT is in very widely used in IT development, our experience is, that Plastic SCM is the best working revision management system. Plastic SCM was acquired by Unity some time ago and is very well integrated into Unity. On our point of view it is much easier to use than GIT. ![](/doc/unity/assets/revision-plastic.png) Plastic SCM Please check the Plastic SCM Website for more information about plastic. 🔗 🔗 # Runtime UI > User interface for the published Digital Twin The Runtime UI will be, if you compile your project to any destination platform, part of your delivered Digital Twin. The Runtime UI can be customized by yourself and extended with the standard Unity UI components if you wish. You can have a preview of the Runtime UI in the Game Window during simulation mode in Unity editor. The Runtime UI is part of the realvirtual.io prefab. It can be enabled and disabled in the Realvirtual (before 2022 *Game4AutomationController)*, which is a script on the top level of the [Realvirtual](/doc/unity/components-and-scripts/game4automation/) prefab. The Runtime UI looks like this: ![](/doc/unity/assets/runtimeui%20\(2\).png) Runtime UI of the Digital Twin ### Top Menu [Section titled “Top Menu”](#top-menu) ![](/doc/unity/assets/runtimeui-mnu.png) Top menu runtime ui In the top menu bar of the RuntimeUI you find the following buttons. | Button | Description | | ---------------------------------------- | --------------------------------------------------------------------------------------------- | | Play | Pushing on the play button will restart the simulation | | Pause | Pauses the simulation | | Step Forward | Steps one physics step forward | | Ortohogonal / Perspective | Switches between ortogonal and perspective view | | Side / Top / Frond View Overlay | Turns on/off the Orthographic side views | | First Person Controller / CAD controller | Switches between first person controller and cad like mouse controller | | Object Selection | enables object selection | | Connection Status | Switches the connection status and displays in green if an interface is connected (see below) | | Quality Settings | Allows to change the render quality - this only works in Standard Render Pipeline | If you don’t need the Runtime UI it can be turned off in the Game4AutomationController bei deselecting *UI Enabled on Start*. It is also possible to turn off certain buttons in the Top Menu by deactivating the Gameobjects. ### Connection Status [Section titled “Connection Status”](#connection-status) ![](/doc/unity/assets/runtimeui-connectionstatus.png)\\ If you toggle this button the connection status will be switched between *Connected* and *Disconnected*. All realvirtual.io objects which are based on the *realvirtual.ioBehavior* class can be enabled or disabled based on this connection switch. The main usecase of this switch is to have one model which can run in Simulation mode, where everything in the model is controlled by included scripts and in Virtual Commissioning (Connected) mode, where some scripts might be disabled and interfaces are enabled. With this option you can decide this on a very detailed level for every component. ![](/doc/unity/assets/runtimeui-connectionswitch.png) For this all realvirtual.io components have the property **Active** this property can be one of the following | Value | Description | | ------------ | ----------------------------------------------------------------------------------------------------- | | Always | The script is always active, independent from the connection switch | | Connected | The script is only active when the connection switch is set to Connected (the plugs are connected) | | Disconnected | The script is only active when the connection switch is set to Disconnected (the plugs are connected) | | Never | The script is never active and always disabled | | Don’t change | The script enabled status is not changed based on the Connection Switch | If you implement your own behavior components you need to implement your enable and disable logic of your script into the standard methods *OnEnable* and *OnDisable*. The interface base classes already have this and call automatically *OnConnect()* and *OnDisconnect()*. ### Object Selection [Section titled “Object Selection”](#object-selection) ![](/doc/unity/assets/runtimeui-selection.png) Danger In runtime it might happen, that not all meshes can be hovered / selected. This is due to static batching in the Player settings. Please turn off `Project Settings > Player > Other Settings > Static Batching` The object selection enables selection of scene elements and offers options for focusing on and rotating around objects. It can be enabled or disabled by setting the *ObjectSelectionEnabled* property in the [Game4AutomationControlle](/doc/unity/components-and-scripts/game4automation/)r. ![](/doc/unity/assets/runtimeui-selectedobject.png) Activated object selection with selected CAN object (with RuntimeInspector enabled in Game4AutomationController) Note Object selection is using a mesh collider, which is added to every game object at the start, if no collider is already present. These gameobjects are assigned to *g4a Selection* layer. Further information concerning Layers is described in [Physics](/doc/unity/basics/physics/). While navigating the scene with the mouse pointer, moving the pointer over an object will highlight it. By clickon on an object it will get selectid. If the *RuntimeInspector* is enabled in [RealvirtualController](/doc/unity/components-and-scripts/game4automation/) the properties of the selected objectare displayed. The “Runtime Inspector” is disabled in the [demo model.](/doc/unity/basics/demo-model/) | key | action | | ------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------- | | one click left mouse button | object is selected | | double click left mouse button | object is selected and the camera focus is set | | F | camera focus is set to the currently selected object | | right mouse button pressed | rotation around selected object | | ALT | as long as ALT is pressed the camera will follow the selected object. The selected object is centered and rotation is done around the object | | ESC | deselect the selected object | Additional configuration options for object selection can be accessed through the Selection Raycast Component, located on the Main Camera. Within this component, the Highlight Function, Highlight Colors, and Center Icon can be enabled or disabled, and their settings can be modified. ![](/doc/unity/assets/rvselectionRaycast.png) Additional settings for Object Selection in SelectionRaycast component on the main camera. ### Camera Positions [Section titled “Camera Positions”](#camera-positions) Camera positions, perspective settings as well as the settings for the orthographic side views are saved to the current values as soon as you quit the scene. This is done by the *CameraPos* Scriptable asset. This asset can be assigned in the *SceneMouseNavigation*, which is attached to the main camera. ![](/doc/unity/assets/runtimeui-mouse.png) SceneMouseNavigation attached to the main camera, taking care about saved camera positions If you use a standard *Realvirtual (before 2022 Game4automation)* component in your scene, all scenes are sharing the same standard camera settings. To create a new camera position setting you need to create a new scriptable component like this: ![](/doc/unity/assets/rvAddCameraPos.png) Creating a scriptable component for camera positions You can save this asset wherever you would like to and assign it to the SceneMouseNavigation. For creating a new camera position or saving the camera position when you leave play mode you should turn on `Save Camera Pos On Quit`. You need to turn it off again if you don’t want to change the Start Camera Position\\ ![](/doc/unity/assets/image%20\(9\).png) #### Main Camera [Section titled “Main Camera”](#main-camera) You can move the main camera as you are used to it in Unity Editor mode. If you want to change the sensitivity of movement, please change the settings in the *SceneMouseNavigation* script which is attached to the Main camera. Additionally there are some standard hotkeys (see below) for Front (F), Back (B), Top (T), Left(L) and Right (R) Side view for the main camera. #### Orthographic Camera / Side Views [Section titled “Orthographic Camera / Side Views”](#orthographic-camera--side-views) ![](/doc/unity/assets/runtimeui-sideview.png) Sometimes additional side, top and front views are very handy. This is for example the case, if you would like to teach a robot and have a good view on the current orientation and position. By selecting “O” or by using the Icon in the top menu bar 3 overlay windows are opened with 3 additional orthographic cameras. ![](/doc/unity/assets/runtimeui-orthographic.png) Orthographic views can be turned on with Key "O" You can move each orthographic view by using the mouse within the view. Pushin “O” again closes the view. With Plus and Minus on the Numpad you can increase the size of the views and with “Tab” you can rotate all the Orthographic cameras by 90 Degrees around the global Y axis.. ### Hotkeys [Section titled “Hotkeys”](#hotkeys) Most hotkeys (besides standard camera navigation) are defined within the RealvirtualController (before 2022 *Game4AutomationController)* You can turn off all hotkeys by deselecting *Enable Hotkeys*. By selecting *None* in one hotkey only this hotkey is deactivated. ![](/doc/unity/assets/runtimeui-hotkeys.png) ### Scene Navigation [Section titled “Scene Navigation”](#scene-navigation) #### Mouse [Section titled “Mouse”](#mouse) The scene mouse navigation is controlled by a script which is attached to the Main Camera, which is part of the realvirtual.io prefab. With the *SceneMouseNavigation* properties you can change the behavior and speed of the mouse navigation. #### Touch [Section titled “Touch”](#touch) The touch navigation, which is mainly used for mobile devices, is also attached to the Main Camera. With the properties of the *TouchInterface* script you can control how the touch interface is behaving. ![](/doc/unity/assets/runtimeui-touch.png) #### First Person Controller [Section titled “First Person Controller”](#first-person-controller) New in Version 2019.3 is a included First Person Controller. You can move in the scene like in a First Person Shooter game. ![](/doc/unity/assets/runtimeui-firstperson.png) First person view during simulation The First Person View is enabled and disabled by the button with a mouse or a person in the top bar of the runtime ui. The first person view is active when the button looks like this: ![](/doc/unity/assets/runtimeui-fpvbutton.png) During the First Person View you can control the view with the following buttons: | Button / Mouse | Description | | -------------- | --------------------------------- | | Mouse movement | changes the direction of the view | | W | moves forward | | A | moves left | | D | moves right | | S | moves backward | | Y | person goes into knees | | Shift | movement is faster | ### Runtime Inspector [Section titled “Runtime Inspector”](#runtime-inspector) The runtime inspector is meant for debugging or inspecting in detail component properties. You can change these properties but the properties are not changed when you leave the simulation mode. This means that the runtime inspector is not meant to replace the Unity Editor. In standard settings the runtime inspector is disabled. You can turn the RuntimeInspector on in the Game4AutomationController settings: ![](/doc/unity/assets/runtimeui-inspectorenabled.png)\ You can open the runtime inspector with the Arrows on the left hand side of your screen: ![](/doc/unity/assets/runtimeui-inspector.png) © 2025 realvirtual GmbH [https://realvirtual.io](https://realvirtual.io/) - All rights reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or by any means, including printing, saving, photocopying, recording, or other electronic or mechanical methods, without the prior written permission of the publisher. # Camera Control Control camera movement and focus during runtime to track moving objects, create cinematic views, or guide users through your digital twin. Note **New Feature**: CameraFollowObject component is available since realvirtual version 6.0.7. ## Overview [Section titled “Overview”](#overview) realvirtual provides comprehensive camera control capabilities for runtime navigation, object tracking, and preset camera positions. The system is designed for both **no-code Inspector configuration** and **scripting integration**, making it accessible to designers while remaining powerful for developers. > **📝 Note** This section covers **runtime camera control features** for following objects and loading preset positions. For standard scene navigation with mouse/keyboard during runtime (pan, rotate, zoom, first-person mode), see the main [Runtime UI](/doc/unity/basics/runtime-ui/) documentation. ### Camera Control Options [Section titled “Camera Control Options”](#camera-control-options) realvirtual offers three complementary approaches to camera control: **1. Camera Position Presets (CameraPosition Component)** ⭐ *Recommended for beginners* * Save and load complete camera views as reusable preset assets * Create camera navigation buttons without any coding * Automatic startup position loading * Keyboard shortcuts and touch gestures for quick access * Perfect for: multi-view dashboards, guided tours, preset navigation **2. Object Following and Focus (CameraFollowObject Component)** * Track moving objects continuously (follow mode) * One-time smooth transitions to view specific objects (focus mode) * Auto-calculated distance and angles or custom positioning * Optional user control (rotation/zoom) during following * Perfect for: AGV tracking, process monitoring, operator attention management **3. Direct Camera Control (SceneMouseNavigation API)** * Programmatic camera positioning from scripts * Advanced integration with automation logic * Custom camera sequences and animations * Perfect for: automated demonstrations, complex camera movements, custom UI ### Common Use Cases [Section titled “Common Use Cases”](#common-use-cases) * **Camera Preset Navigation** - Quick access to predefined views via buttons, keyboard, or gestures * **AGV/Mobile Robot Tracking** - Follow autonomous vehicles as they navigate through facilities * **Process Visualization** - Focus on specific machines or operations during demonstrations * **Guided Tours** - Create automated camera sequences that highlight key areas * **Multi-View Dashboards** - Provide operators with instant access to different facility areas * **Operator Training** - Direct user attention to important components * **Remote Monitoring** - Track critical moving equipment in real-time Camera control integrates seamlessly with PLC signals, UI buttons, and scripting, making it suitable for both automated sequences and user-controlled interactions. *** ## Camera Position Presets - No-Code Approach [Section titled “Camera Position Presets - No-Code Approach”](#camera-position-presets---no-code-approach) The **CameraPosition** component system provides the simplest way to create camera navigation without any coding. It allows you to save complete camera views as reusable preset assets and trigger them via buttons, keyboard shortcuts, or touch gestures. ### How It Works [Section titled “How It Works”](#how-it-works) The CameraPosition system consists of two parts: 1. **CameraPos ScriptableObject Assets** - Store camera state (position, rotation, distance, orthographic settings) 2. **CameraPosition Component** - Load and activate camera presets when triggered This separation allows you to create a library of camera views that can be reused across different buttons, keyboard shortcuts, and automation triggers. ![CameraPosition Inspector showing configuration for camera preset views](/doc/unity/assets/camera-position-inspector.png) Two CameraPosition components configured with different preset views and activation methods ### Creating Camera Position Presets [Section titled “Creating Camera Position Presets”](#creating-camera-position-presets) Follow these steps to create and save a camera position preset: **In Edit Mode:** 1. **Create the ScriptableObject asset** * Right-click in Project window → **Create > realvirtual > Add Camera Position** * Name the asset descriptively (e.g., “MainOverview”, “RobotStation1”, “TopView”) 2. **Attach CameraPosition component to Main Camera** * Select the **Main Camera** in Hierarchy (`/realvirtual/Main Camera`) * Click **Add Component** → Search for **CameraPosition** 3. **Assign the ScriptableObject asset** * In the CameraPosition component, assign your CameraPos asset to the **Campos** property **In Play Mode (Game Mode):** 4. **Start the simulation** * Press the **Play** button to enter Play mode 5. **Position your Game view camera** * Navigate the camera to your desired view using realvirtual runtime controls: * **Middle mouse button + drag** - Pan camera * **Right mouse button + drag** - Rotate camera around pivot point * **Mouse scroll wheel** - Zoom in/out 6. **Save the current position** * With the Main Camera still selected, find the CameraPosition component in Inspector * Click the **“Save current Position”** button * The CameraPos asset now stores the current Game view camera position > **⚠️ Important** Camera positions must be **saved in Play mode** when the Game view camera is active. The “Save current Position” button captures the runtime camera’s current position and rotation. > **💡 Tip** Create multiple CameraPos assets for different areas or views in your digital twin. Build a library of presets like “Overview”, “DetailView1”, “DetailView2”, “TopView”, “SideView” for comprehensive navigation. ### Adding CameraPosition to Your Scene [Section titled “Adding CameraPosition to Your Scene”](#adding-cameraposition-to-your-scene) Camera position components are typically added to the **Main Camera** (`/realvirtual/Main Camera`) to manage different camera views. **Step 1: Add CameraPosition Component to Main Camera** 1. Select the **Main Camera** in your Hierarchy (`/realvirtual/Main Camera`) 2. Click **Add Component** in the Inspector 3. Search for and add **CameraPosition** 4. Assign your CameraPos asset to the **Campos** property 5. Configure activation settings (keyboard shortcut, activate on start, etc.) **Step 2: Add Multiple CameraPosition Components (Optional)** You can add multiple CameraPosition components to the Main Camera, each configured for a different view: 1. Add another **CameraPosition** component to the same Main Camera 2. Assign a different CameraPos asset (e.g., “TopView”, “DetailView”) 3. Set a different **Key Code** (e.g., F1 for first view, F2 for second view) 4. Repeat for additional preset views **Step 3: Connect to UI Buttons (Optional)** For button-based navigation: 1. Select your UI button GameObject 2. In the Button component’s **OnClick** event list, click **+** 3. Drag the **Main Camera** GameObject to the object field 4. Select **CameraPosition > SetCameraPosition()** from the function dropdown 5. If you have multiple CameraPosition components on the Main Camera, select the specific one you want to trigger ### CameraPosition Properties [Section titled “CameraPosition Properties”](#cameraposition-properties) #### Basic Configuration [Section titled “Basic Configuration”](#basic-configuration) **Name** (string) - Display name for this camera position. Shows in runtime UI and can be used for identification. Default: “Main Camera” **Campos** (CameraPos asset) - The camera position preset asset to load. This ScriptableObject contains the saved camera state (position, rotation, distance, orthographic settings). Assign the CameraPos asset you created earlier. #### Activation Methods [Section titled “Activation Methods”](#activation-methods) **View Name** (string) - Optional identifier for this view. Can be used for scripting lookups or display purposes. Example: “View1”, “Overview”, “DetailStation” **Key Code** (KeyCode) - Keyboard shortcut to activate this camera position. Press this key during runtime to instantly load the preset view. Examples: * **F1, F2, F3** - Function keys for quick view switching * **Alpha1, Alpha2** - Number keys for numbered views * **None** - Disable keyboard activation **Activate On Start** (boolean) - When enabled, this camera position automatically loads when Play mode starts or when the component is enabled. Use this for your default startup view. > **⚠️ Warning** Only enable **Activate On Start** on ONE CameraPosition component. Multiple components with this setting enabled will conflict. **Double Tap Gesture** (Touch Interaction) - Configure touch gesture activation for mobile or touchscreen interfaces: * **None** - Disable touch gesture activation * **Touch Interaction GameObject** - Assign the touch interaction component that manages gestures * When assigned and user performs double-tap gesture, this camera position activates This enables touchscreen users to quickly navigate between views using familiar double-tap gestures. ### Inspector Buttons [Section titled “Inspector Buttons”](#inspector-buttons) The CameraPosition component provides two convenient buttons in the Inspector: * **Save current Position** - Captures the current Scene view camera state and updates the assigned CameraPos asset * **Set Camera to saved Position** - Loads the camera view from the assigned CameraPos asset These buttons work in both Edit mode and Play mode, allowing you to test and refine camera positions during development. > **💡 Workflow Tip** Use “Save current Position” to quickly update presets as you refine your views. Navigate to the desired position in Scene view, then click the button to update the asset without leaving the Inspector. ### Common Setup Patterns [Section titled “Common Setup Patterns”](#common-setup-patterns) **Pattern 1: UI Button Navigation (No Coding)** Create a navigation panel with buttons for different views: 1. Create 3-5 CameraPos assets for different areas (Overview, Station1, Station2, etc.) 2. Select **Main Camera** and add 3-5 CameraPosition components (one for each view) 3. Assign different CameraPos assets to each CameraPosition component 4. Add UI buttons to your Canvas 5. Connect each button’s OnClick event to **Main Camera > CameraPosition > SetCameraPosition()** 6. Select the specific CameraPosition component for each button Result: Users click buttons to instantly navigate between predefined views. **Pattern 2: Keyboard Shortcuts** Provide power users with keyboard shortcuts: 1. Select the **Main Camera** in Hierarchy 2. Add multiple CameraPosition components to the Main Camera 3. Assign different CameraPos assets to each component 4. Set different KeyCodes (F1, F2, F3, etc.) for each CameraPosition 5. Set Active to “PlayModeOnly” on all components Result: Press F1-F5 to instantly switch between 5 preset views. **Pattern 3: Automatic Startup View** Set a default camera position when the scene starts: 1. Select your Main Camera in Hierarchy 2. On the **SceneMouseNavigation** component, configure camera position settings: * **Last Camera Position** - Assign your default startup view CameraPos asset * **Set Camera Pos On Start Play** - Enable to load this position at startup * **Save Camera Pos On Quit** - Enable to save current camera state when exiting Play mode * **Set Editor Camera Pos** - Enable to sync Scene view with saved position * **Interpolate To New Camerapoitions** - Enable for smooth camera transitions ![SceneMouseNavigation camera position settings](/doc/unity/assets/scene-mouse-navigation-camera-settings.png) SceneMouseNavigation component on Main Camera showing camera position startup settings > **⚠️ Important: Save Camera Pos On Quit** Enable **Save Camera Pos On Quit** temporarily when you want to capture your final camera position. Once you’ve set your permanent startup position, **disable this setting** to prevent it from overwriting your preset every time you exit Play mode. Leave it enabled only if you want the camera position to dynamically update between sessions. Result: Scene always starts from the same professional overview position. **Pattern 4: Combined Approach** Combine all methods for maximum flexibility: 1. Configure startup position on SceneMouseNavigation (Pattern 3) 2. Add UI buttons for common views (Pattern 1) 3. Add keyboard shortcuts for power users (Pattern 2) 4. Optional: Add double-tap gestures for mobile (configure Touch Interaction) Result: Complete navigation system supporting multiple user preferences and devices. > **⚠️ Important: Avoiding Conflicts Between Camera Systems** > > When combining multiple camera control approaches (CameraPosition, CameraFollowObject, and SceneMouseNavigation settings), be careful to avoid conflicts: > > * **Only ONE “Activate On Start”**: Enable “Activate On Start” on only ONE CameraPosition component. Multiple components with this enabled will conflict. > * **Don’t set positions in parallel**: Avoid triggering multiple camera position changes at the same time (e.g., starting follow mode while a camera position is animating). > * **SceneMouseNavigation vs CameraPosition startup**: If using CameraPosition with “Activate On Start”, disable “Set Camera Pos On Start Play” on SceneMouseNavigation to avoid both systems trying to set the startup position. > * **Following mode takes priority**: When CameraFollowObject is actively following an object, camera position changes are blocked until following stops. > * **Sequential transitions**: If you need to combine different camera movements (e.g., load position, then start following), use scripting or Events to trigger them sequentially with proper delays. ### Camera Position vs CameraFollowObject [Section titled “Camera Position vs CameraFollowObject”](#camera-position-vs-camerafollowobject) **Use CameraPosition when:** * You want predefined static camera views * Creating navigation between fixed viewpoints (e.g., different areas of a factory) * Setting up startup camera position * Building multi-view dashboards * No coding required **Use CameraFollowObject when:** * You need to track moving objects (AGVs, robots, conveyors) * Creating dynamic camera that follows motion * Focusing attention on specific components during demonstrations * Combining following with user control (rotation/zoom during tracking) Both systems can be used together in the same scene for comprehensive camera control. *** ## CameraFollowObject Component [Section titled “CameraFollowObject Component”](#camerafollowobject-component) The **CameraFollowObject** component controls camera behavior for both continuous following and one-time focus operations. Unlike CameraPosition which loads static preset views, CameraFollowObject creates dynamic camera behavior that tracks moving objects in real-time or smoothly transitions to focus on specific components. ![CameraFollowObject Inspector with follow settings](/doc/unity/assets/camera-follow-object-inspector.png) CameraFollowObject component configured to follow a robot TCP with rotation and zoom control enabled ### Adding CameraFollowObject [Section titled “Adding CameraFollowObject”](#adding-camerafollowobject) 1. Add the component to any GameObject in your scene (commonly attached to UI buttons) 2. Assign the **Object To Follow** property to your target GameObject 3. Configure distance and angle settings as needed 4. Connect to buttons or PLC signals for triggering ### Properties [Section titled “Properties”](#properties) #### Target Object [Section titled “Target Object”](#target-object) **Object To Follow** (GameObject) - The GameObject to track or focus on. This can be any object in your scene including MUs, robots, conveyors, or machine components. The camera will automatically calculate the object’s bounding box center from all child renderers. #### Camera Distance [Section titled “Camera Distance”](#camera-distance) **Use Custom Distance** (boolean) - Controls whether to use a manually specified distance or auto-calculate the optimal viewing distance. When disabled, the camera automatically calculates the distance needed to fit the object at approximately 1/3 of screen space, providing a comfortable viewing size that shows the object clearly without filling the entire frame. **Distance** (float, meters) - Camera distance from the object center when Use Custom Distance is enabled. Adjust this value to control how close or far the camera appears from the target. Typical values range from 2 meters for small objects to 20 meters for large equipment. #### Camera Angle [Section titled “Camera Angle”](#camera-angle) **Use Custom View Angle** (boolean) - Controls whether to use a manually specified camera rotation or auto-select the optimal angle. When disabled for FocusOnObject, the camera calculates an optimal viewpoint slightly above and to the side of the object. When disabled for StartFollowing, the current camera angle is maintained. **View Angle** (Vector3, degrees) - Camera rotation in Euler angles (X, Y, Z) when Use Custom View Angle is enabled. Use this to set precise camera orientations such as top view (90, 0, 0) or side view (0, 90, 0). #### User Control Options [Section titled “User Control Options”](#user-control-options) **Allow Rotation** (boolean) - When enabled during following mode, users can orbit the camera around the object using mouse or touch input while the object remains centered. This is useful for inspection scenarios where operators need to examine moving equipment from different angles. **Allow Zoom** (boolean) - When enabled during following mode, users can adjust the camera distance from the object using scroll wheel or pinch gestures while maintaining focus on the target. Combine with Allow Rotation for full user control during tracking. #### Smoothness [Section titled “Smoothness”](#smoothness) **Lerp Speed** (float, 0.1-10.0) - Controls camera tracking smoothness during following mode. Lower values (0.1-0.5) create smooth cinematic motion, medium values (0.5-2.0) provide balanced tracking, and higher values (2.0-10.0) create tight, responsive tracking. Default: 1.0 **Smooth Start** (boolean) - When enabled, the camera smoothly transitions to the object when starting to follow. When disabled, the camera jumps immediately to the following position. Enable for professional presentations, disable for instant response in monitoring scenarios. #### Stop Button UI [Section titled “Stop Button UI”](#stop-button-ui) **Show Stop Button** (boolean) - When enabled, displays a UI button during camera follow mode that allows users to stop the camera tracking. The button appears automatically when following starts and disappears when following stops. This provides users with a clear, visible way to exit follow mode without requiring keyboard shortcuts or external buttons. ![Stop Camera Focus button appears during following mode](/doc/unity/assets/camera-follow-stop-button.png) The "Stop Camera Focus" button automatically appears during camera follow mode when Show Stop Button is enabled **Stop Button Prefab** (GameObject) - Optional custom prefab for the stop button UI. If null, uses the default rvUICameraFocusButton prefab from Resources. Assign a custom prefab here if you want to customize the button’s appearance, position, or text. The custom prefab must have an rvUICameraFocusButton component. **Stop On Mouse Click** (boolean) - When enabled, following stops automatically if the user clicks any mouse button. This provides an alternative way to exit follow mode by simply clicking anywhere in the viewport. #### Follow Mode [Section titled “Follow Mode”](#follow-mode) **Auto Start Following** (boolean) - Automatically begins following the target object when the scene starts or when the component is enabled. Enable this for scenarios where tracking should start immediately, such as startup demonstrations or monitoring views. #### PLC Signal Control [Section titled “PLC Signal Control”](#plc-signal-control) **PLC Signal Start Following** (PLCInputBool) - PLC signal that controls following mode. When the signal transitions to true, following begins. When the signal returns to false, following stops automatically. Use this for automated sequences controlled by your PLC logic. **Follow Active** (boolean) - Public boolean property that can be controlled externally by scripts or PLCOutputBool components. Set to true to start following, false to stop. This provides an alternative to PLC signals for scripting scenarios or UI toggle buttons. > **💡 Hint**\ > PLC signal monitoring uses FixedUpdate timing to ensure synchronization with PLC communication cycles. Either the PLC signal or Follow Active bool can trigger following - both do not need to be true simultaneously. ### Control Methods [Section titled “Control Methods”](#control-methods) The CameraFollowObject component provides three main methods that can be triggered from UI buttons, scripts, or other events: #### StartFollowing() [Section titled “StartFollowing()”](#startfollowing) Begins continuous camera tracking of the target object. The camera will smoothly move to the configured viewing position and then continuously update its position to keep the object centered as it moves. Following continues until explicitly stopped by calling StopFollowing() or by setting control signals to false. **Use Cases:** * Track AGVs moving through warehouses * Follow robotic arms during operation sequences * Monitor conveyor transport of critical products * Automated camera sequences in demonstrations **Button Setup:** Add a button to your UI and connect its OnClick event to CameraFollowObject.StartFollowing(). For toggle behavior, use ToggleFollowing() instead. #### StopFollowing() [Section titled “StopFollowing()”](#stopfollowing) Ends continuous camera tracking and returns the camera to normal user-controlled navigation mode. The camera remains at its current position and rotation, allowing users to navigate freely. **Use Cases:** * End automated tracking sequences * Return control to operators * Switch between tracked objects #### FocusOnObject() [Section titled “FocusOnObject()”](#focusonobject) Performs a one-time smooth camera movement to view the target object without continuous tracking. The camera will interpolate to the optimal viewing position, but will not continue following if the object moves afterward. This is ideal for guided tours or drawing attention to specific components. **Use Cases:** * Highlight specific machines during presentations * Create waypoint-based guided tours * Quick navigation to specific areas * Operator attention management in training scenarios #### ToggleFollowing() [Section titled “ToggleFollowing()”](#togglefollowing) Switches between following and not following states. If currently following, this method stops tracking. If not following, it starts tracking. Useful for toggle buttons in your UI. ### Inspector Buttons [Section titled “Inspector Buttons”](#inspector-buttons-1) The component provides three buttons directly in the Inspector for testing during development: * **Start Following** - Test continuous tracking * **Stop Following** - End tracking * **Focus On Object** - Test one-time focus These buttons work in both Edit mode and Play mode, allowing you to preview camera behavior during scene setup. ### Distance and Angle Auto-Calculation [Section titled “Distance and Angle Auto-Calculation”](#distance-and-angle-auto-calculation) When custom distance or angle options are disabled, the camera uses intelligent auto-calculation: **Auto Distance Calculation:** * Analyzes all renderers on the target object and its children * Calculates combined bounding box dimensions * Determines distance to fit object at 1/3 screen space * Adds safety margin based on object size * Ensures object is clearly visible without being too close or far **Auto Angle Calculation:** * **FocusOnObject**: Calculates optimal viewpoint slightly elevated and offset from object center for best visibility * **StartFollowing**: Maintains current camera angle to avoid disorienting users during tracking > **💡 Hint**\ > Auto-calculation works best with objects that have MeshRenderer or SkinnedMeshRenderer components. For objects without renderers, the camera uses the object’s transform position and a default distance of 5 meters. *** ## Setting Camera Positions via Code [Section titled “Setting Camera Positions via Code”](#setting-camera-positions-via-code) For advanced scenarios, you can control camera positions programmatically using the **SceneMouseNavigation** public API. This is useful for creating custom camera sequences, automation logic, or dynamic camera movements based on simulation events. ### Accessing SceneMouseNavigation [Section titled “Accessing SceneMouseNavigation”](#accessing-scenemousenavigation) The SceneMouseNavigation component is located on the Main Camera. There are several ways to get a reference to it: **Method 1: FindObjectOfType (Recommended - Simple and Reliable)** ```csharp using realvirtual; // Find the SceneMouseNavigation component in the scene SceneMouseNavigation sceneNav = FindObjectOfType(); ``` **Method 2: Via Main Camera GameObject** ```csharp using realvirtual; // Get reference via specific GameObject path GameObject mainCamera = GameObject.Find("/realvirtual/Main Camera"); SceneMouseNavigation sceneNav = mainCamera.GetComponent(); ``` **Method 3: Using Camera.main** ```csharp using realvirtual; // Get reference via Unity's main camera SceneMouseNavigation sceneNav = Camera.main.GetComponent(); ``` > **💡 Tip** Use `FindObjectOfType()` for the simplest and most reliable approach. It works regardless of the camera’s exact hierarchy path. ### SetNewCameraPosition Method [Section titled “SetNewCameraPosition Method”](#setnewcameraposition-method) The primary method for programmatic camera control: ```csharp public void SetNewCameraPosition(Vector3 targetPos, float camDistance, Vector3 camRotation, bool noInterpolate = false) ``` **Parameters:** * **targetPos** (Vector3) - The world position the camera looks at (orbit center point) * **camDistance** (float) - Distance from target to camera in meters * **camRotation** (Vector3) - Camera rotation as Euler angles (X, Y, Z) in degrees * **noInterpolate** (bool) - If true, jump immediately; if false, smoothly interpolate to position (default: false) **Example - Move Camera to Specific Position:** ```csharp using UnityEngine; using realvirtual; public class CameraController : MonoBehaviour { private SceneMouseNavigation sceneNav; void Start() { // Get SceneMouseNavigation reference sceneNav = FindObjectOfType(); } public void MoveCameraToStation1() { // Define target position, distance, and rotation Vector3 targetPosition = new Vector3(10f, 0f, 5f); // Look at point float distance = 8f; // 8 meters from target Vector3 rotation = new Vector3(30f, 45f, 0f); // Camera angle // Move camera with smooth interpolation sceneNav.SetNewCameraPosition(targetPosition, distance, rotation, noInterpolate: false); } public void JumpCameraToOverview() { // Jump instantly without interpolation Vector3 targetPosition = new Vector3(0f, 0f, 0f); float distance = 15f; Vector3 rotation = new Vector3(45f, 90f, 0f); sceneNav.SetNewCameraPosition(targetPosition, distance, rotation, noInterpolate: true); } } ``` **Example - Camera Sequence with Coroutines:** ```csharp using System.Collections; using UnityEngine; using realvirtual; public class CameraTour : MonoBehaviour { private SceneMouseNavigation sceneNav; void Start() { GameObject mainCamera = GameObject.Find("/realvirtual/Main Camera"); sceneNav = mainCamera.GetComponent(); } public void StartTour() { StartCoroutine(CameraTourSequence()); } IEnumerator CameraTourSequence() { // Position 1: Overview sceneNav.SetNewCameraPosition(new Vector3(0, 0, 0), 20f, new Vector3(45, 0, 0)); yield return new WaitForSeconds(3f); // Position 2: Station A sceneNav.SetNewCameraPosition(new Vector3(10, 0, 5), 8f, new Vector3(30, 45, 0)); yield return new WaitForSeconds(3f); // Position 3: Station B sceneNav.SetNewCameraPosition(new Vector3(-10, 0, -5), 8f, new Vector3(30, -45, 0)); yield return new WaitForSeconds(3f); } } ``` ### Using with CameraPos Assets [Section titled “Using with CameraPos Assets”](#using-with-camerapos-assets) You can also load CameraPos assets programmatically: ```csharp using UnityEngine; using realvirtual; public class LoadCameraPreset : MonoBehaviour { public CameraPos overviewPosition; // Assign in Inspector private SceneMouseNavigation sceneNav; void Start() { GameObject mainCamera = GameObject.Find("/realvirtual/Main Camera"); sceneNav = mainCamera.GetComponent(); } public void LoadPreset() { if (overviewPosition != null) { sceneNav.SetNewCameraPosition( overviewPosition.TargetPosition, overviewPosition.Distance, overviewPosition.Rotation, noInterpolate: false ); } } } ``` ### Interpolation Control [Section titled “Interpolation Control”](#interpolation-control) Control smooth camera transitions using the SceneMouseNavigation properties: * **InterpolateToNewCamerapoitions** (bool) - Enable/disable smooth interpolation * **CameraInterpolationSpeed** (float) - Speed of camera transitions (default: 0.1) ```csharp // Disable interpolation for instant jumps sceneNav.InterpolateToNewCamerapoitions = false; sceneNav.SetNewCameraPosition(targetPos, distance, rotation); // Re-enable with custom speed sceneNav.InterpolateToNewCamerapoitions = true; sceneNav.CameraInterpolationSpeed = 0.05f; // Slower transitions sceneNav.SetNewCameraPosition(targetPos, distance, rotation); ``` ### Following Objects Programmatically [Section titled “Following Objects Programmatically”](#following-objects-programmatically) For continuous object tracking via code, use the **StartFollowing** method in SceneMouseNavigation: ```csharp public void StartFollowing(GameObject targetObject, float? distance = null, Vector3? viewAngle = null, bool allowRotation = false, bool allowZoom = false, float lerpSpeed = 1.0f, bool smoothStart = true, bool stopOnMouseClick = false) ``` **Parameters:** * **targetObject** (GameObject) - The object to follow * **distance** (float?, optional) - Camera distance in meters. If null, auto-calculates based on object bounds * **viewAngle** (Vector3?, optional) - Camera rotation in Euler angles. If null, uses current angle (StartFollowing) or optimal angle (FocusOnObject) * **allowRotation** (bool) - If true, user can orbit camera while following * **allowZoom** (bool) - If true, user can zoom in/out while following * **lerpSpeed** (float) - Smoothness factor (0.1 = cinematic, 10.0 = instant) * **smoothStart** (bool) - If true, smoothly transitions to object. If false, jumps immediately * **stopOnMouseClick** (bool) - If true, stops following when user clicks any mouse button **Example - Follow Moving AGV:** ```csharp using UnityEngine; using realvirtual; public class AGVTracker : MonoBehaviour { public GameObject agv; private SceneMouseNavigation sceneNav; void Start() { sceneNav = FindObjectOfType(); } public void StartTrackingAGV() { // Follow AGV with auto-calculated distance, allowing user rotation and zoom sceneNav.StartFollowing( targetObject: agv, distance: null, // Auto-calculate optimal distance viewAngle: null, // Maintain current camera angle allowRotation: true, // User can orbit around AGV allowZoom: true, // User can zoom in/out lerpSpeed: 0.3f, // Smooth cinematic tracking smoothStart: true, // Smooth transition to AGV stopOnMouseClick: false // Continue following even if user clicks ); } public void StopTracking() { sceneNav.StopFollowing(); } } ``` **Example - Focus on Machine with Custom Settings:** ```csharp public void FocusMachineOnError(GameObject machine) { SceneMouseNavigation sceneNav = FindObjectOfType(); // Focus on machine with specific distance and angle sceneNav.FocusOnObject( machine, distance: 8f, // 8 meters from machine viewAngle: new Vector3(30, 45, 0) // View from 30° up, 45° around ); } ``` > **💡 Tip** For button-triggered following, use the **CameraFollowObject** component which provides Inspector configuration without coding. For dynamic code-based tracking (e.g., follow different objects based on events), use SceneMouseNavigation.StartFollowing() directly. *** © 2025 realvirtual GmbH [https://realvirtual.io](https://realvirtual.io/) - All rights reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or by any means, including printing, saving, photocopying, recording, or other electronic or mechanical methods, without the prior written permission of the publisher. # Debug Console > Debugging without the Unity Editor in a Build The **Debug Console** in realvirtual.io is based on the [Unity Ingame Debug Console](https://github.com/yasirkula/UnityIngameDebugConsole), which is licensed under the **MIT License** (Copyright © Süleyman Yasir KULA). This tool provides **full access to Unity’s console log in a build** and allows the execution of **custom commands**. It is particularly useful for **debugging** and for modifying specific **player application properties** during runtime. ![](/doc/unity/assets/48eE07eLQY.png) Debug Console ## How to Use the Debug Console [Section titled “How to Use the Debug Console”](#how-to-use-the-debug-console) 1. **Add the Debug Console Prefab**\ To enable the Debug Console in your project, add the prefab located at: ```plaintext Assets/realvirtual/UIPrefabs/DebugConsole.prefab ``` into your scene hierarchy. 2. **Opening the Debug Console**\ While running the simulation, you can open the Debug Console by clicking in the **bottom-left corner** of the screen. 3. **Console Log Indicators** * If there are any console log entries, small **icons** and a **log count** will appear to notify you. * You can review **warnings, errors, and other logs** in real time. 4. **Executing Commands**\ The Debug Console also supports **custom commands**, allowing you to trigger specific functions or modify application settings directly. ## Console Commands [Section titled “Console Commands”](#console-commands) To see a full list of available commands, type the following in the Debug Console’s input field: ```plaintext bashKopierenBearbeitenhelp ``` **Available Commands** | Command | Description | | ----------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | **ConnectOff** | Disables Connect Mode. This setting is saved for the next start. | | **ConnectOn** | Enables Connect Mode. This setting is saved for the next start. | | **DebugOff** | Turns off Debug Mode. The player must be restarted for this change to take effect. *Please note: Not all components take care about Global Debug Mode.* | | **DebugOn** | Turns on Global Debug Mode in realvirtualController. The player must be restarted for this change to take effect. *Please note: Not all components take care about Global Debug Mode.* | | **DeletePrefs** | Deletes all PlayerPrefs. | | **help** | Prints all available commands. | | **help \[commandName]** | Prints detailed information about the specified command. | | **InspectorOff** | Disables the Runtime Inspector. The player must be restarted for this change to take effect. | | **InspectorOn** | Enables the Runtime Inspector. The player must be restarted for this change to take effect. | For more information about implementing your own commands please check # Group Manager > Set visibility options of groups during Play Mode The `GroupManager` system enables the management of visual groups within the PlayMode. It facilitates showing, hiding, and toggling visibility of game objects and meshes based on predefined group settings. The `GroupManager` is part of the realvirtual prefab. ![](/doc/unity/assets/GroupManager.png) Under the “Visible Groups” section, you can configure settings for each group to be available in PlayMode. The parameters are: * Group Name: Select a group from the dropdown, which lists all scene groups. * Disable Game Object On Hide: Choose whether to disable the GameObject when the group is hidden. * Disable Mesh On Hide: Choose whether to disable the mesh renderer when the group is hidden. * Inactive On Start: Specify if the group should be hidden at the start of the application. ### Group Window in PlayMode [Section titled “Group Window in PlayMode”](#group-window-in-playmode) During PlayMode the GroupWindow open by clicking on the GroupWindow Button in the main toolbar. ![](/doc/unity/assets/GroupWindowPlayMode.png) Each selectable group is listed. Groups with GameObjects disabled on hide are marked with a circle icon, while those using the mesh renderer are marked with an eye icon. # Mouse Sensitivity Control 3D navigation sensitivity during runtime with persistent settings. Note **New in Version 6.0.3**: Mouse Sensitivity control is available in the Settings window during Play Mode. ![Mouse Sensitivity Settings Window](/doc/unity/assets/mouse-sensitivity-settings.png) Settings window showing Mouse Sensitivity slider (0.1-3.0 range) during Play Mode ## Overview [Section titled “Overview”](#overview) The Mouse Sensitivity feature allows users to adjust 3D navigation speed in real-time during Play Mode. Settings are automatically saved and restored across Unity sessions. ## Settings [Section titled “Settings”](#settings) * **Range**: 0.1 (very slow) to 3.0 (very fast) * **Default**: 1.0 (normal sensitivity) * **Access**: Settings window during Play Mode * **Persistence**: Automatically saved using Unity PlayerPrefs ## Navigation Types Affected [Section titled “Navigation Types Affected”](#navigation-types-affected) * Camera rotation and orbiting * Zoom controls (scroll wheel) * Panning operations * Touch navigation on mobile devices ## How to Use [Section titled “How to Use”](#how-to-use) 1. Enter **Play Mode** in Unity 2. Open the **Settings** window from the runtime UI 3. Adjust the **Mouse Sensitivity** slider to your preference 4. Changes apply immediately 5. Settings persist automatically when exiting Play Mode ## Use Cases [Section titled “Use Cases”](#use-cases) * **Accessibility**: Accommodate different user preferences * **Hardware Compatibility**: Adjust for different mouse types and DPI settings * **Training Environments**: Provide comfortable navigation for new users * **Demonstrations**: Quick sensitivity adjustment for different presentation scenarios # Responsiveness realvirtual.io is designed to run on a variety of devices, including **PCs, mobile devices, WebGL, and different screen resolutions**. Achieving a responsive and adaptive UI across these platforms can be challenging. To simplify this, **realvirtual.io includes special scaler scripts** to handle different screen sizes and resolutions automatically. You can adopt the settings based on your special application needs. ### **Scaler Scripts for Responsive UI** [Section titled “Scaler Scripts for Responsive UI”](#scaler-scripts-for-responsive-ui) #### **Toolbar Scaler** [Section titled “Toolbar Scaler”](#toolbar-scaler) The **Toolbar Scaler** ensures that toolbars scale properly depending on screen size and platform. * **Adjusts toolbar height and scale** dynamically. * **Handles scaling for different screen resolutions**, ensuring UI elements remain accessible. * **Platform-specific deactivation:** * Allows disabling elements for **Linux, Windows, and WebGL** when needed. ![](/doc/unity/assets/responsiveness.png) Toolbar Scaler #### **Overlay Button Scaler** [Section titled “Overlay Button Scaler”](#overlay-button-scaler) The **Overlay Button Scaler** is used for the ovlerlay buttons on the right hand side. * **Dynamically scales UI buttons based on screen size.** * **Custom width and height settings** for different screen resolutions. * **Supports platform-based UI adjustments** (e.g., different behaviors for **Android, iOS, WebGL**). ![](/doc/unity/assets/responsiveness-overlaybuttons.png) Oberlay Button Scaler # Runtime Persistence > Saving properties in the Build In some cases, it is necessary to allow changes to properties (e.g., **interface settings**) during runtime in a **built application**. **Runtime Persistence** enables automatic storage and retrieval of values to maintain settings across sessions. ## **Introduction** [Section titled “Introduction”](#introduction) ### **How It Works** [Section titled “How It Works”](#how-it-works) * **Persistent Storage**: All defined values are **loaded before `OnEnable` and `Awake`** methods are executed. * **Automatic Saving**: Values are **saved automatically** when the scene is closed, ensuring that changes persist. * **Uses PlayerPrefs**: The data is stored using Unity’s **PlayerPrefs** system, which varies based on the platform. ### **Where Data is Stored?** [Section titled “Where Data is Stored?”](#where-data-is-stored) The **PlayerPrefs** storage location varies by platform: * **Windows**: Stored in the **Registry** under: ```plaintext HKEY_CURRENT_USER\Software\[Company Name]\[Product Name] ``` * **MacOS**: Stored in a **.plist file** under: ```plaintext ~/Library/Preferences/unity.[Company Name].[Product Name].plist ``` * **Linux**: Saved in the `~/.config/unity3d/` directory. For more details, refer to the **Unity PlayerPrefs documentation**. ## Saving Data via Runtime Persistence Component [Section titled “Saving Data via Runtime Persistence Component”](#saving-data-via-runtime-persistence-component) The **Runtime Persistence** component allows saving and restoring **component properties** in Unity **without custom programming**. It enables automatic persistence of values such as **interface settings, network configurations, and UI preferences** across sessions. Besides the persistence itself properties can be configured to be editable via the Options window during Runtime. ![](/doc/unity/assets/runtimepersistance-options.png) Options window with properties to be chanded during runtime ![](/doc/unity/assets/runtimepersistance.png) Runtime Persistence Component ### **How to Use the Runtime Persistence Component** [Section titled “How to Use the Runtime Persistence Component”](#how-to-use-the-runtime-persistence-component) 1. **Attach the Component** * Add the **Runtime Persistence** script to the GameObject containing the properties you want to save. 2. **Assign Properties to Save** * Under **Properties to Save**, click **+** to add a new property. * **Component**: Select the script containing the property. * **Name**: Enter the exact **property name** from the script. 3. **Enable Automatic UI Integration** * **Show in Options (`✔`)**: The property will be automatically added to the **realvirtual.io Options Window** for user configuration. 4. **Handling Events** * **OnValueChanged**: Triggered when the property is modified in the Options Window (after the user exits the field). * **OnOptionsWindowClosing**: Triggered when the Options Window is closed. * These events can be used to execute **custom logic** when values change. ## Example: Mouse Sensitivity Control [Section titled “Example: Mouse Sensitivity Control”](#example-mouse-sensitivity-control) One key feature using Runtime Persistence is **Mouse Sensitivity** control for 3D navigation. For detailed information, see the dedicated [Mouse Sensitivity](/doc/unity/basics/runtime-ui/mouse-sensitivity/) page. ### **Example Use Case (Interface Configuration)** [Section titled “Example Use Case (Interface Configuration)”](#example-use-case-interface-configuration) **Scenario:** Saving the IP address of a **Denso Interface** (`DensoCobotta1300`). * **Component:** `DensoCobotta1300 (Denso Interface)` * **Property Name:** `ipAdress` * **Show in Options:** `✔` (IP field will appear in the UI). * **OnValueChanged Event:** Calls`OnValueChangedReconnectInterface.OnValueChanged`, which **deactivates and reactivates the interface** if the IP changes. # Selection Window (Pro) > Working with large assembly structures Note The Selection Window is only available within the professional version. The Selection Window is enabling a fast selection of components in the 3D assembly (game object) hierarchy. You can select components based on the visibility status, assign [groups ](/doc/unity/components-and-scripts/motion/group/)to components and view and hide groups. ## **Opening the selection window** [Section titled “Opening the selection window”](#opening-the-selection-window) To open the Selection window please select *`realvirtual`*`> Selection window (Pro)` in the realvirtual.io menu. This will open this window: ![](/doc/unity/assets/selectionwindow%20\(1\).png) ### **Actions with ALL** [Section titled “Actions with ALL”](#actions-with-all) In the section `Actions with ALL` you can sop the suppression of all components or show all hidden components. ### **Selection** [Section titled “Selection”](#selection) It is important to know that there are two levels of selection. The first one is the normal Unity Selection (this means all highlighted objects in the hierarchy). You can save currently selected objects in a temporarily g4a selection by pushing `Add selected`. All actions that you are performing under `Actions with Selection` are performed on the Unity AND rvselection. | Button | Description | | -------------------- | ------------------------------------------------- | | `Add selected` | Adds the selected components to the rvselection | | `To Unity selection` | Moves the rvselection to the Unity selection | | `Remove selected` | Removes the selected objects from the rvselection | | `Remove all` | Removes all objects from the rvselection | | `Select Invisible` | Selects all invisible objects | | `Select Visible` | Selects all visible objects | | `Select Unlocked` | Selects all unlocked objects | | `Select Locked` | Selects all locked objects | | `Select Layer` | Selects all objects on the defined layer | | `Select Material` | Selects all objects with the defined material | ### **Actions with selection** [Section titled “Actions with selection”](#actions-with-selection) These are actions that you can perform with the selected objects. The actions are always performed for all objects in the current Unity and realvirtual.io selection. | Button | Action | | ---------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | | `Assign Material` | Assigns the selected material | | Change Shader | Changes the shader of the material | | Material Update | With a material update, defined materials in a scene can be replaced with others. [Material Update](/doc/unity/basics/selection-window/#material-update) | | `Suppress children` | Suppresses all children components in the hierarchy view | | `To new Parent` | Moves the components to the new (selected) parent | | `Copy to empty Parent` | Makes a copy of the components and moves them to the new (selected) parent | | `To Layer` | Moves the components to the defined layer | | `Visible` | Makes the selected components visible | | `Invisible` | Makes the selected components invisible | | `Isolate` | Isolates the selected components (and makes the rest invisible) | | `View all` | Stops the isolation and displays all components | | `Lock` | Locks the components | | `Unlocked` | Unlocks the components | | `To Group` | Assigns the components to the defined group. If the group is not yet existing it is created. | | `Remove Groups` | Removes all groups from the selected components | | `Collapse same level` | Collapses all components to the same hierarchy level | | `Expand same levels` | Expands all components to the same hierarchy level | | `Pivot to origin` | Moves the pivot of the component to the origin of the defined component | | `Pivot to center` | Moves the pivot of the component to the center of the defined component | | `Static` | Makes the components static | | `Movable` | Makes the components non-static (movable) | | `Remove G4A scripts` | Removes all realvirtual.io Scripts from the selected components | | Remove missing scripts | Removes all null-components from the current selection | | Bake to single mesh | Combines all selected meshes to one mesh and saves it to a new gameObject. You can define a name for this gameObject in “Name baked mesh:“ | ### **Groups** [Section titled “Groups”](#groups) In the Group section, you can find all groups that are defined in the current model. | Button | Action | | ------ | --------------------------------------------------------------- | | Plus | Adds the selected components to the Group | | Minus | Removes the selected components from the Group | | Hide | Hides all components which are currently belonging to the Group | | Show | Shows all components currently belonging to the Group | ### Material Update [Section titled “Material Update”](#material-update) The Material update allows you to replace defined materials in a scene with others by one click. To use this feature, you need to define an update by creating an asset called “MaterialUpdate” in the current folder, which can be defined in the Inspector. To create the asset, right-click in the Project area and select “Create/realvirtual/Add material update settings”. ![](/doc/unity/assets/Materialupdate.png) material update You can use the following parameters to specify which materials should be replaced:\ material, RGB color, and material name or partial name.\ All of these input parameters are considered in the order listed.\ You can assign a specific material or a blueprint material, but only one of these options can be defined at a time.\ Multiple mappings can be defined, and to add another mapping, simply click on the ”+” button. The mappings in the list are carried out sequentially, and they can overwrite each other.\ The material update replaces materials of imported, non-instantiated prefabs with instantiated ones, resulting in improved performance. ,\ © 2025 realvirtual GmbH [https://realvirtual.io](https://realvirtual.io/) - All rights reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or by any means, including printing, saving, photocopying, recording, or other electronic or mechanical methods, without the prior written permission of the publisher. # Tutorial > Create a first Digital Twin with a conveyor, a source and a sensor [Build your first digital twin: a conveyor that moves parts (realvirtual Know-How)](https://www.youtube-nocookie.com/embed/y6ZqItLhSo4) Build your first digital twin: a conveyor that moves parts (realvirtual Know-How) In this short tutorial we are creating a small Digital Twin model with a source, a conveyor and a light barrier. The needed 3D components are already available. If you would like to use own 3D data, you would need to import the 3D data from your CAD system using [CADLink](/doc/unity/basics/cad-import/cadlink/) (included in realvirtual.io) or another suitable solution like for example [Unitys PIXYZ](https://unity.com/de/products/pixyz). ### Create a new scene [Section titled “Create a new scene”](#create-a-new-scene) You should always create your models outside the *realvirtual* folder. This is because if you import a new Version of realvirtual.io, you would not like to destroy what you did. If you keep your scripts outside the realvirtual.io folder this will enable you to update your model with new releases of realvirtual.io without problems. First create a new folder. We will call this folder *Tutorial*. Select assets and right click *Create > Folder*. Select the folder, hit F2 and name it to *Tutorial*. ![](/doc/unity/assets/tutorial-folder.png) Create a new Tutorial folder For creating a new scene, select *Tools > realvirtual > Create new realvirtual scene* ![](/doc/unity/assets/rvnewscene.png) Create a new scene After the scene is created, please save it with *File > SaveAs* in your Tutorial folder with the name *tutorialmodel*: ![](/doc/unity/assets/tutorial-tutorialmodel.png) Saved new scene in the Tutorial folder You should now have an empty scene with a base plate and some lights: ![](/doc/unity/assets/tutorial-emptyscene.png) Empty scene Note You can hide the big lights and camera gizmos by setting the Gizmo size to 0 (see above picture). You could also create a totally empty standard Unity scene and add the realvirutal component(before 2022 game4automation component) by *Tools > realvirtual > Add Object > realvirtual* in the Main menu. Note The realvirtual component provides some basic lights, mouse navigation in the deployed Digital Twin (Game view) as well as all standard settings and the standard [Runtime UI](/doc/unity/basics/runtime-ui/). ### Starting your first scene [Section titled “Starting your first scene”](#starting-your-first-scene) You can now start your first scene by pressing on Play in the top of the Unity UI. Game view will automatically open and you can see the RuntimeUI as well as an empty model with just the base plate: ![](/doc/unity/assets/tutorial-playscene.png) Playing the empty model ### Insert the conveyor [Section titled “Insert the conveyor”](#insert-the-conveyor) Next we insert a 3D component. For the tutorial we use a prepared one, which is already used by the demo model. Select the conveyor under *Assets > realvirtual> 3DPfefabs > ConveyorSmall* and drag it into the scene. Place it somewhere in the middle of the base plate. You can move the conveyor with the gizmo, which is visible as long as the conveyor is selected. Or you put in 0,0,0 into the Transform Position property. This will place the zero point of the conveyor onto the world zero point (which should be also the middle of the base plate): ![](/doc/unity/assets/tutorial-placedconveyor.png) Placed conveyor into the empty scene ### Unpacking the Prefab [Section titled “Unpacking the Prefab”](#unpacking-the-prefab) The conveyor belt that you have inserted into the scene is what is called a *prefab*. A *prefab* is a type of template and can be a very simple or a very complex component. A *Prefab* can be used multiple times in one or more scenes. As long as the embedded instances of the prefabs are not “unpacked” in the scene, they are still associated with the *Prefab* and inherit any changes to the prefab itself. For more information on the Unity Prefab System, see the Unity documentation here: . For the Tutorial, we should Unpack the *Prefab* instance completely and cut all dependencies to the original *Prefab*. Please select *ConveyorSmall* in the scene and with the context menu select *Prefab > Unpack Completely:* ![](/doc/unity/assets/tutorial-prefab.png) Unpacking a prefab ### Delete realvirtual.io components from conveyor [Section titled “Delete realvirtual.io components from conveyor”](#delete-realvirtualio-components-from-conveyor) Tip This step is optional. The conveyor prefab is already equipped with some realvirtual.io components. But we would like to show you in this tutorial the full workflow. Like it would be without anything prepared - based on imported 3D objects. This is why we are deleting the components and add them later on again. You could also skip this step if wished and continue with Insert a source. Remove the component *Drive* on the object *ConveyorSmall* and also remove afterwards the *Rigidboy* on the object *ConveyorSmall*: ![](/doc/unity/assets/tutorial-removecomponent.png) Remove the component Drive Next delete *Transport Surface*, *Box Collider* and *Rigidboy* on *ConveyorSmall.Conveyor.Conveyor.* You learned how to remove scripts from objects ;-). **You now removed everything what is prepared and we will add these needed scripts again in this tutorial.** ### Define the transport surface [Section titled “Define the transport surface”](#define-the-transport-surface) Tip We now have an empty 3D component. No kinematic and physical behavior is defined yet. This is what a component would look like after the CAD import. CAD systems do not contain any information other than the structure and geometry. This means that we have to define all mechatronic behaviors like drives and sensors in realvirtual.io. Unfortunately, until now there is no standard format for exporting extended information from the CAD system. However, our [Open Digital Twin Interface](/doc/unity/advanced-topics/page-5/) allows you to develop your own exporter for the CAD system.t. First we need to add a *Transport Surface* to the conveyor. For doing that we select the component *ConveyorSmall.Conveyor.Conveyor*. We select in the main menu *Tools > realvirtual > Add Script > Transport Surface* or we drag and drop the script *TransportSurface* under *Assets>realvirtual* onto *ConveyorSmall.Conveyor.Conveyor*. A very easy way is, to use the [QuickEdit](/doc/unity/basics/user-interface/#quickedit) for adding the [*TransportSurface*](/doc/unity/components-and-scripts/motion/transportsurface/)*:* ![](/doc/unity/assets/tutorial-adddrive.png) Adding a TransportSurface to the conveyor with QuickEdit Note The Quick Edit overly buttons can be opened by pushing **F1** inside the scene view. ### Insert a Drive [Section titled “Insert a Drive”](#insert-a-drive) We now insert a [Drive ](/doc/unity/components-and-scripts/motion/drive/)on the Conveyor. We place it on the same component as the [*TransportSurface* ](/doc/unity/components-and-scripts/motion/transportsurface/)before. Select the *ConveyorSmall.Conveyor.Conveyor* component in your Scene and select in the main menu *Tools > realvirtual > Add Script > Drive* : Alternatively you can also drag and drop the *Drive* Script under *Assets > realvirtual> Drive* onto the Inspector window of *ConveyorSmall.Conveyor.Conveyor*. Or as before you can also use the QuickEdit Overlay Window. And as a 3rd option you could also use *Add Component* on the Inspector window and than type in [*Drive* ](/doc/unity/components-and-scripts/motion/drive/)and select the filtered script to assign it to the 3D component. Your model should now look like this: ![](/doc/unity/assets/tutorial-drivetransportsurface.png) Added Drive and TransportSurface to the conveyor Note Please remember. Most times you can add scripts on 3D components in 4 ways * With the main menu * By dragging and dropping it from the Assets folder *Assets>game4automation* * by using *Add Component* in the *Inspector window* * *or by using the QuickEdit overlay* ### Defining the transport direction and turning the Drive on [Section titled “Defining the transport direction and turning the Drive on”](#defining-the-transport-direction-and-turning-the-drive-on) Next we define some properties of the [Drive ](/doc/unity/components-and-scripts/motion/drive/)within the Inspector window. Please also check if the Direction is set to *Linear X* (so that the shown transport direction is forward). Please check, that the [*TransportSurface* ](/doc/unity/components-and-scripts/motion/transportsurface/)is assigned to the [Drive](/doc/unity/components-and-scripts/motion/drive/), which usually is done automatically. Set ***JogForward*** to ***True*** and ***TargetSpeed*** to ***300***. ![](/doc/unity/assets/tutorial-driveproperties.png) Changing the inspector properties of the Drive This settings will automatically start the [Drive ](/doc/unity/components-and-scripts/motion/drive/)when the simulation is starting. ### Insert a source [Section titled “Insert a source”](#insert-a-source) A Source is automatically creating new components based on itself (what is called “spawning” in Unity). Please select *Assets > realvirtual> 3DPrefabs > Can* and drag and drop it into the scene. Place the can at the beginning and on top of the conveyor. Another way for creating the “standard” can source is to select the *TransportSurface* within the scene and to press **INS** on the keypoard. Your model now looks like this: ![](/doc/unity/assets/tutorial-source.png) Added source to the conveyor Please move the source to the beginning of the conveyor. ### Test the conveyor [Section titled “Test the conveyor”](#test-the-conveyor) Now we can test the conveyor. Start the simulation with the Unity *Play* button. ![](/doc/unity/assets/tutorial-startingmodel.png) Your first Digital Twin - a conveyor with the source You might see that the texture on the conveyor is not moving in the right relation and the right direction. You need to set the texture scale yourself. Please select the *TransportSurface* and enter a *-2* into property *Texture Scale.* ### Insert a Sensor [Section titled “Insert a Sensor”](#insert-a-sensor) As a last step we would like to place a [*Sensor* ](/doc/unity/components-and-scripts/sensors/sensor/)(light beam) at the end of the conveyor. Please create an empty *GameObject* into the Scene by selecting *GameObject > Create Empty* or by selecting ![](/doc/unity/assets/tutorial-empty.png)on the QuickEdit overlay. If your new GameObject is added as a child please drag and drop it to the top level in your model. Rename the new GameObject to *Sensor*. Next select *Tools > realvirtual > Add Component > Add Sensor* or select *Sensor* on the QuickEdit overlay. Last but not least you need to move the *Sensor* GameObject to the end of the *TransportSurface*. Your model now looks like this: ![](/doc/unity/assets/tutorial-sensor.png) Added Sensor to the end of the TransportSurface Now you can start again the simulation and you will see, that the Sensor is getting occupied (red): ![](/doc/unity/assets/tutorial-simulatesensor.png) Sensor in the Digital Twin during simulation Caution Don’t forget to save your model by selecting *File > Save* ### Summary and what’s next [Section titled “Summary and what’s next”](#summary-and-whats-next) This is just a first quick starter. Please check the [Demo model](/doc/unity/basics/demo-model/) and learn how the functions are realized. Also check the section [Physics ](/doc/unity/basics/physics/)to learn more about the physics simulations, collision detection and kinematic movements. Based on that you should check the whole section [Components & Scripts](/doc/unity/basics/broken-reference/) to learn more about the details. © 2025 realvirtual GmbH [https://realvirtual.io](https://realvirtual.io/) - All rights reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or by any means, including printing, saving, photocopying, recording, or other electronic or mechanical methods, without the prior written permission of the publisher. # Editor User Interface > Building the Digital Twin in the Unity editor with realvirtual.io The editor user interface is the environment within Unity where you define your digital twin using realvirtual.io. This interface leverages the full flexibility of Unity, allowing you to create and configure your digital twin. Once your digital twin is ready, you can publish it as a finished product for various platforms such as Windows exe, Android app, WebGL, and more. Refer to the [Supported Platforms](/doc/unity/advanced-topics/supported-platforms/) and [Publishing the Digital Twin](/doc/unity/basics/publishing-the-digital-twin/) sections for details on this process. The user interface for the published digital twin is covered in the [Runtime UI](/doc/unity/basics/runtime-ui/) section. ## Main menu bar [Section titled “Main menu bar”](#main-menu-bar) Most of the realvirtual.io functions can be found in the main menu bar under “realvirtual.io.” Here, you can add components or scripts to the scene and access various features. ![](/doc/unity/assets/RVAddobject.png) Unity UI and realvirtual.io main menu ## For a deeper understanding of the user interface and its functionalities, the documentation is organized into various subsections, each focusing on specific aspects of interaction and editing within the platform. These subsections are designed to guide users through the various tools and features available, enhancing their workflow and efficiency in managing 3D models and scenes. #### Key UI Features and Navigation: [Section titled “Key UI Features and Navigation:”](#key-ui-features-and-navigation) * [**Model Hierarchy Navigation**](/doc/unity/basics/user-interface/hierarchy-window/): Utilize the Hierarchy Window for a structured view and navigation through the Digital Twin hierarchy, allowing easy access and organization of the scene’s components. * [**3D Scene Editing**](/doc/unity/basics/user-interface/3d-views/): Engage with the 3D Views for comprehensive editing capabilities within your 3D scene, offering a direct and interactive way to manipulate Digital Twin elements. * [**Quick Edit Menu**](/doc/unity/basics/user-interface/quick-edit/): Access the most common tasks rapidly with the Quick Edit Menu, designed to streamline your workflow by providing shortcuts to frequently used actions. * [**Pivot Point Adjustment**](/doc/unity/basics/user-interface/move-pivot-points-pro/): Learn how to move Pivot Points of objects, facilitating precise alignment and positioning. * [**Selection in Large Models**:](/doc/unity/basics/selection-window/) Use the Selection Window for efficient selection within big models and assemblies, working with groups, hiding and unhiding groups ensuring you can easily find and manipulate specific elements in complex scenes. * [**3D Model Measurement**](/doc/unity/basics/user-interface/measurement-pro/): Measure distances within the 3D mode. © 2025 realvirtual GmbH [https://realvirtual.io](https://realvirtual.io/) - All rights reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or by any means, including printing, saving, photocopying, recording, or other electronic or mechanical methods, without the prior written permission of the publisher. # 3D Views > Scene and Game Window In Realvirtual.io, a notable distinction from many common simulation systems is the presence of two 3D views within Unity: the “Scene View” and the “Game View.” Typically, you work in the “Scene View” when adding, moving, and inspecting your Digital Twin. It provides a detailed environment for your design and development process. It’s important to note that the Scene View is exclusively available within the Unity Editor. When you publish your Digital Twin as a compiled executable for platforms like Windows, iOS, Android, WebGL, or MacOS, only the “Game View” becomes a part of the delivered application. The Game View serves as a preview of the final Digital Twin application. In some scenarios, such as virtual commissioning, you may not even need to publish your Digital Twin, and you can continue working solely within the Unity Editor’s Scene View. However, in other use cases, such as when delivering the Digital Twin to end-users as a 3D interface integrated with a physical machine, the Scene View becomes a valuable tool. Here, you can develop unique user interactions and preview how the final Digital Twin product will appear. When you initiate simulation mode, the Game View automatically starts. To maintain efficiency and workflow, we typically position the Game View window in the bottom left corner of the workspace. This arrangement ensures that the Scene View remains readily accessible throughout your work in the Unity Editor. ![](/doc/unity/assets/ui-withsmallgameview.png) Unity editor with Scene view and small Game view in the bottom right corner For further details on the standard functions and features of the Scene view in Unity, we recommend consulting the official Unity documentation. 🔗 ### Scene View Gizmos [Section titled “Scene View Gizmos”](#scene-view-gizmos) Gizmos in the Scene View of Realvirtual.io are helpful tools while editing your Digital Twin in the 3D environment. You can access Gizmos via the icon located in the top right corner of the Scene View. This allows you to enable or adjust the size of Gizmos according to your needs. When all Gizmos are turned off, you won’t see any Gizmos or the QuickEdit Overlay window. We recommend setting the size of 3D icons to 0, especially for camera and light icons, as they are typically not necessary during editing: [](/doc/unity/assets/ui-gizmos%20\(1\).mp4) Scene view Gizmos settings Realvirtual.io provides unique Gizmos for certain components, primarily for drives. These specialized Drive Gizmos are visible when the Gameobject with the added drive is selected in the Hierarchy view. During edit mode, the Drive Gizmo indicates the positive direction of the drive, aiding in precise adjustments and configurations. ![](/doc/unity/assets/ui-drivegizmo.png) Drive Gizmo during edit mode In simulation mode, Drive Gizmos display the current position of the drive, along with a green arrow indicating the drive’s current moving direction. This feature enhances real-time monitoring and control during simulations. [](/doc/unity/assets/ui-drivegizmosim.mp4) Drive Gizmo during simulation mode # Clean Restart (Pro) ## Clean Restart Unity [Section titled “Clean Restart Unity”](#clean-restart-unity) Automatically restart Unity with a clean cache to fix import issues and ensure clean configuration changes. Note **Professional Feature**: Clean Restart Unity is only available in realvirtual Professional. **realvirtual → Settings → Clean Restart Unity (Pro)** ### What It Does [Section titled “What It Does”](#what-it-does) 1. Saves your current work 2. Closes Unity completely 3. Deletes the Library folder (Unity’s cache) 4. Restarts Unity automatically 5. Reimports all assets with clean cache Caution This process takes 5-15 minutes depending on project size. ### When to Use [Section titled “When to Use”](#when-to-use) * **After configuration changes** (switching between Professional/Starter/etc.) * **Import errors or corrupted assets** * **Shader compilation problems** * **Unexpected Unity behavior** * **Before important builds** ### How to Use [Section titled “How to Use”](#how-to-use) 1. Click **realvirtual → Settings → Clean Restart Unity (Pro)** 2. Confirm the dialog 3. Wait for Unity to restart and reimport assets The process is fully automated - just wait for completion. ### For Non-Professional Users [Section titled “For Non-Professional Users”](#for-non-professional-users) If you don’t have realvirtual Professional, you can achieve the same result manually: #### Manual Clean Restart Steps: [Section titled “Manual Clean Restart Steps:”](#manual-clean-restart-steps) 1. **Save your work** in Unity 2. **Close Unity completely** 3. **Delete the Library folder** in your project directory * Navigate to your project folder * Delete the entire `Library` folder 4. **Restart Unity** and open your project 5. **Wait for reimport** (5-15 minutes) #### Important Notes: [Section titled “Important Notes:”](#important-notes) * The `Library` folder is Unity’s cache - deleting it is safe * Your project files (`Assets`, `ProjectSettings`) are never touched * Unity will recreate the Library folder automatically ### Troubleshooting [Section titled “Troubleshooting”](#troubleshooting) **Unity won’t close?** Wait 2 minutes, then use Task Manager (Windows) or Activity Monitor (Mac) to force-close Unity processes. **File access errors?** Temporarily disable antivirus real-time scanning during the process. **Long reimport times?** This is normal for large projects - be patient and let Unity finish. # Demo Scenes Browser Note This feature was added in realvirtual **6.3**. ## Overview [Section titled “Overview”](#overview) The Demo Scenes Browser provides categorized access to all sample scenes included with realvirtual Starter and Professional. ## Opening the Browser [Section titled “Opening the Browser”](#opening-the-browser) * Menu: **Tools > realvirtual > Demo Scenes** * Or via the realvirtual toolbar dropdown in the editor toolbar ![](/doc/unity/assets/demo-scenes-browser.png) Demo Scenes Browser ## Categories [Section titled “Categories”](#categories) ### Starter [Section titled “Starter”](#starter) | Category | Scenes | | --------------------- | ----------------------------------------------------------------------------------- | | **Getting Started** | Main introduction scene with conveyor belt system, drives, sensors, and MU handling | | **Drives** | Drive types: raycast-based position limits, force drive, conditional start | | **Transport Systems** | Conveyors, chains, guided transport, radial conveyors, surface transfer | | **Object Handling** | Gripping, MU cutting, physics, MU changes | ### Professional [Section titled “Professional”](#professional) | Category | Scenes | | --------------------- | -------------------------------------------------------------------------- | | **PLC Interfaces** | Protocol demos: OPC-UA, TwinCAT, S7, Modbus, MQTT, and more | | **Robotics** | IK robots, target blending, kinematic MU | | **Robot Interfaces** | Real controller interfaces: KUKA, Universal Robots, Fanuc, Denso, and more | | **Advanced Features** | Multiplayer, statistics, volume tracking | ## Importing Demo Scenes [Section titled “Importing Demo Scenes”](#importing-demo-scenes) Click **Import** next to any scene. This uses Unity’s Package Manager Samples import system. Scenes are imported to: * `Assets/Samples/realvirtual Starter/6.3.0/Demo Scenes/` * `Assets/Samples/realvirtual Professional/6.3.0/Demo Scenes (Pro)/` You can also click **Open Package Manager** at the bottom to access the standard Unity Package Manager for manual sample import. ## See Also [Section titled “See Also”](#see-also) * [Installation](/doc/unity/basics/installation/) * [Folder Structure](/doc/unity/basics/folder-structure/) # Group Assignment Tool (Pro) > Assign GameObjects to groups by clicking directly in the Scene View Note The Group Assignment Tool is a new feature in realvirtual **6.3.4**. It is a **Professional-only** feature and is not available in the Starter version. The Group Assignment Tool is a dedicated scene-picking tool for organizing GameObjects into [Groups](/doc/unity/components-and-scripts/motion/group/) by clicking, dragging, or assigning whole connected assemblies directly in the Scene View. It complements the hierarchy-based [Selection Window](/doc/unity/basics/selection-window/) and the axis-based [Kinematic Tool](/doc/unity/basics/user-interface/kinematic-tool-pro/) with a pure scene-picking workflow for rapid bulk assignment. ![Group Assignment Tool assigning fences to a group in the Scene View](/doc/unity/assets/group-assignment-tool.jpg) Painting meshes into the "Fences" group directly in the Scene View ## Opening the Tool [Section titled “Opening the Tool”](#opening-the-tool) Open the tool in one of three ways: * Menu `Tools > realvirtual > Group Assignment (Pro)` * Keyboard shortcut `Alt+G` * The Group Assignment toolbar toggle in the Scene View overlay toolbar ## Scene Picking [Section titled “Scene Picking”](#scene-picking) The large button at the top toggles **Scene Picking** on and off. When it is **ON** (green) you can pick meshes in the Scene View; when **OFF** (yellow) the tool is idle and normal selection works as usual. Press `Escape` in the Scene View to switch picking off at any time. ## Active Group [Section titled “Active Group”](#active-group) Pick the group you are currently assigning to from the **Active Group** dropdown, or type a name into **New Group** and press **+ Create** to start a fresh group. The active group name is shown in its group color and is remembered across Editor sessions. ## Modes [Section titled “Modes”](#modes) | Mode | Action | | ------------- | ----------------------------------------------------------------------------------------------- | | **Assign** | Click (or drag over) meshes to add them to the active group. | | **Remove** | Click meshes to remove them from the active group. | | **Connected** | Click a mesh to assign its entire connected assembly (flood-fill). Requires the Burst Compiler. | You can also use modifier keys while in any mode: **Shift + Click** removes, and **Ctrl + Click** assigns the connected assembly. ### Connected Mode and Tolerance [Section titled “Connected Mode and Tolerance”](#connected-mode-and-tolerance) In **Connected** mode, hovering a mesh previews the whole connected blob in the group color, and clicking assigns all of it at once. The **Tolerance** slider (0–5 mm) controls how large a gap between meshes is still treated as “connected” — increase it to bridge small gaps in imported CAD geometry. A status line shows how many blobs and meshes were detected, and an **Undo Last** button reverts the most recent connected assignment in one step. Note Connected mode requires the Burst Compiler. Without it the button is disabled. ## Options [Section titled “Options”](#options) | Option | Description | | -------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ | | **Include Children** | Also assigns the clicked object’s child meshes to the group. | | **Exclusive (only unassigned meshes)** | Skips meshes that already belong to any group, so you only fill the gaps. Blocked meshes are highlighted red on hover. | | **Isolate Unassigned** | Hides all meshes that already have a group, leaving only the unassigned ones visible — a fast way to find what still needs assigning. | | **Show All Group Colors** | Tints every grouped mesh in its group color directly in the Scene View. Uses a MaterialPropertyBlock, so there is no per-frame performance cost. | A progress line below the options shows how many meshes in the scene are already assigned, for example `73/100 meshes assigned (73%)`. ## Groups List [Section titled “Groups List”](#groups-list) The **GROUPS** list shows every group in the scene with a color swatch, member count, and a filter field. Click a group name to make it active. Each row has the following buttons: | Button | Action | | -------- | ------------------------------------------------------------- | | **Sel** | Selects all members of the group in Unity. | | **Isol** | Isolates the group — hides every mesh that is not a member. | | **Hide** | Hides all members of the group. | | **✕** | Removes the group and all its assignments after confirmation. | ## History [Section titled “History”](#history) The **History** panel lists the last 10 assignments (newest first). For each entry you can press **✕** to remove that object from the group again, or **◎** to ping and frame the object in the Scene View. ## Bottom Bar [Section titled “Bottom Bar”](#bottom-bar) | Button | Action | | -------------------- | -------------------------------------------------------------------------- | | **Show All** | Restores everything hidden by Isolate / Hide / Isolate Unassigned. | | **Reset Highlights** | Clears all hover and group-color highlights. | | **Refresh** | Rescans the scene and rebuilds the group list, statistics, and highlights. | ## Quick Start [Section titled “Quick Start”](#quick-start) 1. Open the tool with `Alt+G` and make sure **Scene Picking** is ON. 2. Choose an **Active Group** or create a new one with **+ Create**. 3. In **Assign** mode, click or drag over the meshes you want to add. Use **Ctrl + Click** to grab a whole connected assembly. 4. Use **Show All Group Colors** to review the result, then refine with **Shift + Click** (remove) where needed. ## See Also [Section titled “See Also”](#see-also) * [Group](/doc/unity/components-and-scripts/motion/group/) – the component that stores the group assignment * [Selection Window (Pro)](/doc/unity/basics/selection-window/) – hierarchy-based selection and grouping * [Kinematic Tool (Pro)](/doc/unity/basics/user-interface/kinematic-tool-pro/) – axis-based assignment for kinematic chains * [Group Manager](/doc/unity/basics/runtime-ui/group-manager/) – runtime visibility control of groups © 2026 realvirtual GmbH [https://realvirtual.io](https://realvirtual.io/) - All rights reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or by any means, including printing, saving, photocopying, recording, or other electronic or mechanical methods, without the prior written permission of the publisher. # Hierarchy Window > Navigating the model hierarchy The Hierarchy window is a fundamental feature in Realvirtual.io that allows users to manage the components of their virtual models. In this view, you can manipulate and organize various components, known as “Gameobjects,” within your scene, providing an efficient way to structure and maintain your virtual environment. In Realvirtual.io, the term “Gameobject” is used interchangeably with the Unity engine’s concept of a GameObject. Essentially, a Gameobject represents an object within your virtual scene, encompassing everything from physical entities to more abstract elements. ![](/doc/unity/assets/image%20\(5\).png) Hierarchy vidw Within the Hierarchy window, you have the flexibility to add new Gameobjects or remove existing ones through the context menu. ![](/doc/unity/assets/image%20\(1\)%20\(1\)%20\(1\)%20\(1\)%20\(1\)%20\(1\)%20\(1\)%20\(1\)%20\(1\)%20\(1\)%20\(1\)%20\(1\).png) Hierarchy context menu ### Component Icons [Section titled “Component Icons”](#component-icons) Gameobjects in the Hierarchy window can be enhanced by the addition of various components. Realvirtual.io provides an extensive library of specialized components designed for machinery and automation, including Drives, Sensors, TransportSurfaces, PLC Interfaces, and more. To help users quickly identify these components, standard components are represented by unique icons in the Hierarchy View. These icons serve as visual cues, making it easier to understand the composition of a Gameobject at a glance. ![](/doc/unity/assets/ui-icons-hierarchy.png) Icons in Hierarchy View ### Hiding elements [Section titled “Hiding elements”](#hiding-elements) To maintain a clean and organized workspace, the Hierarchy window includes a convenient feature for hiding elements. Located on the right side of the Hierarchy View, a small switch box allows you to deactivate (and hide) a Gameobject and all of its associated subcomponents. This functionality is particularly useful when working on complex scenes with numerous elements, helping you focus on specific aspects of your virtual model without unnecessary distractions. ### PLCInputs and PLCOutputs in Hierarchy [Section titled “PLCInputs and PLCOutputs in Hierarchy”](#plcinputs-and-plcoutputs-in-hierarchy) Realvirtual.io organizes automation interfaces of robots, PLCs, and more as signals. It provides multiple interfaces to link your Digital Twin to real automation systems like Siemens, Beckhoff, Rockwell, ABB, and UR Robots. Signals are associated with specific interfaces and can often be auto-imported from PLCs. In the Hierarchy view during simulations, you can see signals and their properties. PLCInputs are read, and PLCOutputs are green. You can interact with boolean signals by forcing or unforcing them to specific values for testing and control. [](/doc/unity/assets/ui-signals.mp4) Signals in Hierarchy View For a comprehensive understanding of the standard functions and features of the Hierarchy View, we recommend referring to the official Unity documentation. 🔗 # Kinematic Tool (Pro) > Defining kinematics in complex CAD designs Note The Kinematic Tool is only included in realvirtual.io Professional edition. If you don’t use the Professional edition please use [Kinematic ](/doc/unity/components-and-scripts/motion/kinematic/)and [Group ](/doc/unity/components-and-scripts/motion/group/)together with manually adding [Drives](/doc/unity/components-and-scripts/motion/drive/) or Physical joints. The `KinematicTool` provides a graphical user interface (GUI) for creating, configuring, and managing kinematic axes and their components within realvirtual. It enables users to easily create and manipulate axes, set axis references, manage limits, and handle connections between axes and other components. The tool saves all configurations in the Axis script, which is automatically added to relevant components. In the background, the KinematicTool adds necessary standard components such as [Drives](/doc/unity/components-and-scripts/motion/drive/), [Kinematic](/doc/unity/components-and-scripts/motion/kinematic/), and [Group ](/doc/unity/components-and-scripts/motion/group/)based on the kinematic definition. Users can define Kinematic Axes (with [Drives](/doc/unity/components-and-scripts/motion/drive/)) that precisely follow the Drives’ positions, as well as Physical Axes (with Unity PhysX Joints) that are controlled purely by Unity’s physics connections. For a detailed walkthrough of using the Kinematic Tool, be sure to check out our [YouTube tutorial](https://youtu.be/nPNgIWcwDAM). [Video](https://www.youtube-nocookie.com/embed/bC-M5JNC08M) ## Open the Kinematic Tool [Section titled “Open the Kinematic Tool”](#open-the-kinematic-tool) To open the Kinematic Tool window, you can: * Select **Tools > realvirtual > Kinematic Tool** in the realvirtual.io menu. * Click the **“Axis”** button within the realvirtual scene overlay menu. * Use the hotkey **“Alt+K”**. ![](/doc/unity/assets/KinematicTool.png) ## Create a Kinematic Axis [Section titled “Create a Kinematic Axis”](#create-a-kinematic-axis) **Open the Kinematic Tool:** * The Axis will be created as a child of the currently selected GameObject when you open the Kinematic Tool. * Enter a new **Axis Name** in the provided field. * Click **Create Axis** to generate the Axis. ![](/doc/unity/assets/kinematic-createaxis%20\(1\).png) Create a new Axis ## Select Axis Reference [Section titled “Select Axis Reference”](#select-axis-reference) After creating the Axis: 1. **Select a Reference GameObject:** * Choose a GameObject that will define the position of the Axis. This GameObject does not need to be part of the Axis itself; it serves to establish the center point of rotation or direction of movement. 2. **Visualize Reference Points:** * While in Set Axis Reference mode, you can hover over GameObjects. The geometrical center will be marked with a white cross, while the pivot point of the object will be indicated by green, red, and blue crosses. These centers can be used as reference points. 3. **Choose Reference Type:** * **Pivot Point:** Preferably use the pivot point of the GameObject for accurate Axis positioning. * **Bounding Box Center:** Use this if the pivot point is not suitable. * **Radius Center:** Select this if no appropriate object is available. For the Radius Center, you need to choose three vertices on the object to define the center point. ![](/doc/unity/assets/kinematic-setreference.png) Select Axis Reference By following these steps, you ensure precise positioning and orientation of your Kinematic Axis. ## Select Axis Direction [Section titled “Select Axis Direction”](#select-axis-direction) * **Select the Axis Direction:** * After selecting the reference point, the next step is to set the direction of the Axis. You can choose the direction, which will be displayed as a pink line in the editor. Or you can iterate through some options with “Ctrl + D”. * It is possible to efine an offset for the current axis rotation. Browse standard values using\ ”Ctrl + R”. * **Visualize the Axis Type:** * The type of the Axis will be indicated using a gizmo, which helps in visualizing the axis configuration. * **Adjust Gizmo Distance:** * Modify the line length and distance by using the Gizmo Distance option. This allows for precise adjustments to the visual representation of the Axis in the scene. ![](/doc/unity/assets/kinematic-setdirection%20\(1\).png) Selecting the Axis Direction * **Axis Direction:** Choose the direction from the drop-down menu or browse options with “Ctrl + D”. * **Axis Rotation:** Define an offset for the current axis rotation. Browse standard values using\ ”Ctrl + R”. When creating a physical axis that adheres to specific movement constraints, you should define upper and lower limits. This ensures that the axis respects these boundaries during operation. ## Select parts belonging to the Axis [Section titled “Select parts belonging to the Axis”](#select-parts-belonging-to-the-axis) An Axis is a kinematic component that consists of several GameObjects moving together. To define which GameObjects are part of the Axis, follow these steps: ### Select Parts Mode (Selecting with hovering over the parts) [Section titled “Select Parts Mode (Selecting with hovering over the parts)”](#select-parts-mode-selecting-with-hovering-over-the-parts) 1. Select Parts Mode: * Activate “Select Parts” mode to start defining which parts will be associated with the Axis. 2. Highlight and Select Parts: * Hover over the parts in the Scene that should belong to the Axis. The mesh of the parts will be highlighted for easy identification. Click the left mouse button to add the highlighted parts to the Axis. 3. Deselect Parts: * To remove parts from the selection, hold the “Shift” key while clicking on them. This mode is particularly useful if the CAD structure is not oriented towards kinematics, requiring you to select each part individually. ### Select Parts in the Scene (Selecting in the Hierarchy View). [Section titled “Select Parts in the Scene (Selecting in the Hierarchy View).”](#select-parts-in-the-scene-selecting-in-the-hierarchy-view) To exit “Select Parts” mode, click the pink button associated with this mode. You can then select parts directly in the Hierarchy view. This approach is useful if the CAD structure is already somewhat kinematic-oriented, and you wish to select entire hierarchy elements. After selecting elements in the Hierarchy view, click “Add Selected Parts” to include all selected parts and their subparts in the Axis. ### **Select Parts by Collision Detection** [Section titled “Select Parts by Collision Detection”](#select-parts-by-collision-detection) 1. **Select Neighbours:** * Use the “Select Neighbours” function to select all neighboring parts of the currently defined Axis parts. This function only recognizes immediate neighbors. 2. **Fill:** * The “Fill” option selects all parts located between the currently selected components. 3. **Select Connected:** * The “Select Connected” function identifies all parts connected to the selected components, including those that are not immediate neighbors. After using “Select Neighbours,” “Fill,” or “Select Connected,” the detected parts will be highlighted in Unity’s Hierarchy view. You can review the selections before finalizing the process. Click “Add Selected Parts” to incorporate these parts into the Axis. ## Adding a Drive [Section titled “Adding a Drive”](#adding-a-drive) To control the Axis with a drive, click “Add Drive.” This action means the Axis’s position will be fully managed by the Drive. If you choose not to add a Drive, the Axis will be controlled entirely by physical joints. ## Changing the View, Isolate and Hide Mode [Section titled “Changing the View, Isolate and Hide Mode”](#changing-the-view-isolate-and-hide-mode) While selecting parts, you can adjust the view by using the “Isolate” or “Hide” buttons. These options allow you to isolate or hide selected parts for better visibility and management. ![](/doc/unity/assets/kinematic%20\(1\).png) Isolate Mode while seelcting parts ## Defining the Kinematic Hierarchy [Section titled “Defining the Kinematic Hierarchy”](#defining-the-kinematic-hierarchy) ### **For Drive-Controlled Axis:** [Section titled “For Drive-Controlled Axis:”](#for-drive-controlled-axis) * To define a kinematic hierarchy for Drive-controlled axes, you can simply arrange one axis below another in the hierarchy. ![](/doc/unity/assets/kinematic-hierarchy.png) Kinematic hierarchy by parent child relations in Gameobjet hierarchy * Alternatively, you can specify the Kinematic parent under “Connected Axis.” This will automatically establish the kinematic hierarchy when the simulation begins. ### **For Physical Axis:** [Section titled “For Physical Axis:”](#for-physical-axis) * Physical axes are controlled by Unity physics through joints and do not have a drive. Therefore, you should avoid using the GameObject hierarchy to represent the kinematic chain. Instead, use “Connected Axis” to define kinematic connections. * In cases where you need to have two axes on one kinematic object, define the additional axis as a child of the first physical axis and select “Secondary Axis.” This setup will automatically create two or more joints on one Rigidbody when the simulation starts. ![](/doc/unity/assets/kinematic-secondaryaxis.png) Secondary Axis (TCPConnection) one one Axis (TCP) © 2025 realvirtual GmbH [https://realvirtual.io](https://realvirtual.io/) - All rights reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or by any means, including printing, saving, photocopying, recording, or other electronic or mechanical methods, without the prior written permission of the publisher. # Material Window (Pro) > Improve work with imported CAD-data Note The Material Window is only available within the professional version. Note Duplicate detection feature was added in realvirtual **6.0.7** (Professional) The Material Window makes it easy to assign materials to selected objects and includes integrated duplicate detection to identify identical meshes in your scene for performance optimization. ![](/doc/unity/assets/material-window-duplicates.png) Material Window showing duplicate detection with "Found 3 identical copies" header and Identical (4) buttons ### Opening the material window [Section titled “Opening the material window”](#opening-the-material-window) To open the material window please select: Tools > realvirtual > MaterialWindow (Pro). ### Choose a material palette [Section titled “Choose a material palette”](#choose-a-material-palette) To select a palette, simply click on the current material list. If you want to create your own material, click on “New material set”. This creates an asset called: “MaterialPalet” in the Assets folder and displays its parameters in the Inspector. You can then create your material list. ### Duplicate Detection [Section titled “Duplicate Detection”](#duplicate-detection) When you select an object in the scene hierarchy, the Material Window automatically detects identical meshes: **Selection Header** * **Selected Object Name** – Displays the name of the currently selected GameObject * **Duplicate Count** – Shows “Found X identical copies” if duplicates are detected **Identical Meshes Indicator** * **Identical (X) Button** (green) – Appears on the right side of each material row * **Click to Open Duplicate Finder** – Opens the full Duplicate Finder window for detailed analysis * **Real-time Detection** – Updates automatically when selecting different objects This integrated duplicate detection helps you quickly identify optimization opportunities while working with materials, making it easy to find and consolidate identical geometries in your scene. ### Select and set materials [Section titled “Select and set materials”](#select-and-set-materials) The material window contains a palette of materials with the following actions: * **Apply** – Assigns the material to the currently selected object * **Apply All** – Assigns the material to all objects in the current selection * **Identical (X)** – Opens Duplicate Finder for the material’s associated meshes (when duplicates exist) ## See Also [Section titled “See Also”](#see-also) * [Duplicate Finder](/doc/unity/components-and-scripts/tools/duplicate-finder/) - Full duplicate detection tool with scene visualization * [Model Checker](/doc/unity/basics/user-interface/model-checker/) - Scene validation and optimization tool # Measurement (Pro) > Taking measures in the editor window Note Measurement is only included in realvirtual.io Professional The Measurement tool, designed for use within the Unity Editor’s scene window, facilitates the precise measurement of distances between two points in a scene. It extends its functionality by calculating the center point upon selecting a third point, drawing the circle that intersects these points, and providing the circle’s diameter and radius. [](/doc/unity/assets/MeasureTool.mp4) Measure tool in unity editor mode ### Accessing the Tool [Section titled “Accessing the Tool”](#accessing-the-tool) * Navigate to `Tools > realvirtual > Measurement (Pro)` in the main menu to open the tool. ![](/doc/unity/assets/measuretoolDialog.png) ### How to Use [Section titled “How to Use”](#how-to-use) 1. **Initial Point Selection**: Upon opening, the tool automatically sets to select the first point. After choosing the first point, it transitions to selecting the second point. 2. **Measuring Distance**: After the second point is selected, the tool calculates and displays the distance between the two points, including distance breakdowns on each axis. Optionally, distances can be displayed in millimeters. 3. **Determining a Circle**: * Click the ‘Point3’ button to enter the selection mode for a third point. * Selecting the third point draws the circle defined by the three points and shows the circle’s diameter and radius in the tool’s window. 4. **Resetting Selections**: The ‘Reset’ button clears all selections, enabling the user to start anew with the selection process. # Model Checker > Finding common issues in your model In new scenes, the Model Checker runs automatically upon scene startup to detect common issues and recommend performance optimizations. You can activate the checker using the shortcut Alt+T or via the main menu. To deactivate it, use the provided buttons in the UI. Select the “Info” button to view relevant documentation pages, or choose “Show” for certain issues to highlight related game objects in the scene. ![](/doc/unity/assets/modelchecker.png) Model Checker for detecting common issues in the current scene. Alternatively, the Model Checker can be disabled through the setting in the scene’s realvirtualController. ![](/doc/unity/assets/modelchecker-enabled.png) Turning off model checker in realvirtualController Here is an overview of the performed checks: 1. **CheckNonStaticMeshes:** Identifies non-moving GameObjects without Drive components in parent hierarchies. 2. **CheckStaticMeshes:** Detects static meshes under drives that prevent movement. 3. **HugeMeshes:** Warns about objects with excessively large vertex counts (>5% of total) compared to others. 4. **NumberOfMeshes:** Advises on optimizing performance by reducing the number of meshes if exceeding 1000. 5. **NonSharedMaterials:** Alerts about GameObjects with a high number of distinct materials (>20) for optimization. 6. **MUsWithoutRigidbody:** Highlights MUs lacking Rigidbody components for physics interactions. 7. **GuidedTransport:** Identifies MUs without GuidedMU components needed for guided transport surfaces. 8. **SensorRaycastLayer:** Advises adding standard layers (rvMU or rvMUSensor) for Raycast Sensors to detect collisions with MUs. 9. **CheckSinkLayer:** Advises using the standard layer (rvSensor) for Sink components for collision detection with MUs. 10. **SensorColliderLayer:** Suggests using the standard layer (rvSensor) for Collider Sensors for efficient collision detection with MUs. 11. **ComplexColliders:** Notes the presence of numerous Mesh Colliders (>20) and suggests using simpler colliders like Box Colliders for better performance. 12. **ManyColliders:** Alerts about a high number of colliders (>300) in the scene, advising reduction for performance improvement. 13. **CollidersOnNonStandardLayers:** Identifies Colliders not on standard layers (rvMU, rvMUSensor, rvTransport, rvSelection, rvSensor), recommending standard layers for efficient collision detection. 14. **NumberOfLights:** Advises optimizing performance by reducing the number of lights (>2) and turning off shadows. These checks aim to improve scene performance and functionality by identifying common issues and providing actionable recommendations. # Move Pivot Points (Pro) The Move Pivot tool provides precise control over GameObject pivot points and positioning within the Unity Editor, specifically designed for realvirtual automation components. ## Overview [Section titled “Overview”](#overview) The Move Pivot tool is a specialized Unity Editor window that allows you to reposition GameObjects by aligning them to specific vertices, midpoints, or other objects’ pivot points. This tool is particularly useful for precise positioning of automation components, sensors, and mechanical parts in industrial simulation environments. Note This feature is only available in the realvirtual Professional version. The tool supports three primary positioning methods: * **Vertex-based positioning**: Align objects to selected mesh vertices with single-point, two-point midpoint, or three-point center calculations * **Object-to-object alignment**: Position objects relative to other GameObjects’ pivot points or geometric centers * **Circle and bore center detection**: Click a round surface and let the tool calculate its exact center, axis and radius — see [Circle and Bore Center Detection](#circle-and-bore-center-detection) > **💡 Hint**\ > The Move Pivot tool respects Unity’s undo system, allowing you to safely experiment with different positioning configurations. ## Opening the Tool [Section titled “Opening the Tool”](#opening-the-tool) Access the Move Pivot tool through: * **Menu**: **realvirtual** > **Move Pivot (Pro)** * **Quick Access**: Available in the realvirtual quick tools menu or Scene View overlay ![Move Pivot Overlay Button](/doc/unity/assets/move-pivot-overlay-button.png) Move Pivot tool accessible via Scene View overlay button The tool automatically selects the currently highlighted GameObject in the Hierarchy as the primary object to move. ![Move Pivot Tool Interface](/doc/unity/assets/move-pivot-tool-interface.png) Move Pivot tool interface showing object selection and positioning options ## Properties [Section titled “Properties”](#properties) ### Object Selection [Section titled “Object Selection”](#object-selection) #### Object 1 (Target Object) [Section titled “Object 1 (Target Object)”](#object-1-target-object) The GameObject that will be moved and repositioned. * **Selection method**: Automatically uses the currently selected GameObject, or click **Reset** to clear and manually select a new target * **Visual feedback**: The selected object is highlighted with visual indicators in the Scene View #### Object 2 (Reference Object) [Section titled “Object 2 (Reference Object)”](#object-2-reference-object) An optional reference GameObject for object-to-object alignment operations. * **Selection method**: Click **Select Object2** and then click on the desired GameObject in the Scene View * **Visual indicators**: * RGB-colored axes display the object’s pivot point * White-colored axes show the geometric center ### Point Selection [Section titled “Point Selection”](#point-selection) #### Point 1, Point 2, Point 3 [Section titled “Point 1, Point 2, Point 3”](#point-1-point-2-point-3) Individual vertex points selected from mesh geometry for precise positioning calculations. * **Selection method**: Click the respective point button, then click on mesh vertices in the Scene View * **Visual feedback**: Selected points are marked with colored gizmos * **Precision**: Zoom in on target areas for more accurate vertex selection ## Editor Tools [Section titled “Editor Tools”](#editor-tools) ### Interactive Gizmos [Section titled “Interactive Gizmos”](#interactive-gizmos) The tool provides real-time visual feedback through colored gizmos: * **Object highlighting**: Target objects display selection indicators * **Pivot visualization**: Colored axes show current and proposed pivot positions * **Point markers**: Selected vertices are marked with distinct visual indicators * **Alignment preview**: Visual guides show the results of alignment operations ### Scene View Integration [Section titled “Scene View Integration”](#scene-view-integration) * **Click selection**: Direct vertex and object selection in the Scene View * **Hover feedback**: Objects and vertices highlight when hoverable * **Camera navigation**: Full compatibility with Unity’s Scene View navigation ![Move Pivot Scene View](/doc/unity/assets/move-pivot-scene-view.png) Move Pivot tool in action showing selected points, current pivot position, and visual gizmos in the Scene View ## Usage Examples [Section titled “Usage Examples”](#usage-examples) ### Single Point Alignment [Section titled “Single Point Alignment”](#single-point-alignment) Position an object’s pivot to a specific mesh vertex: 1. Select the target GameObject in the Hierarchy 2. Open **realvirtual** > **Move Pivot (Pro)** 3. Click **Point 1** to activate vertex selection mode 4. Click on the desired vertex in the Scene View 5. Use the alignment options to move the object’s pivot to the selected point ### Midpoint Positioning [Section titled “Midpoint Positioning”](#midpoint-positioning) Align an object between two vertices: 1. Follow steps 1-2 from single point alignment 2. Click **Point 1** and select the first vertex 3. Click **Point 2** and select the second vertex 4. Use the midpoint alignment option to position the object between the two points ### Three-Point Center Alignment [Section titled “Three-Point Center Alignment”](#three-point-center-alignment) Position an object at the geometric center of three vertices: 1. Select your target GameObject and open the Move Pivot tool 2. Select **Point 1**, **Point 2**, and **Point 3** on different mesh vertices 3. Apply the three-point center alignment to position the object at the calculated center ![Three-Point Center Alignment](/doc/unity/assets/move-pivot-triangle-center.png) Three-point center alignment showing calculated center position from selected vertices ### Object-to-Object Positioning [Section titled “Object-to-Object Positioning”](#object-to-object-positioning) Align one object’s pivot with another object’s pivot or center: 1. Select the target GameObject (Object 1) 2. Click **Select Object2** and choose the reference GameObject 3. Choose between: * **Pivot alignment**: Aligns Object 1’s pivot with Object 2’s pivot point (RGB axes) * **Center alignment**: Aligns Object 1’s pivot with Object 2’s geometric center (white axes) ## Circle and Bore Center Detection [Section titled “Circle and Bore Center Detection”](#circle-and-bore-center-detection) Note This method was added in realvirtual **6.3.6** (Professional), which is currently in beta and planned for the upcoming release. Placing a pivot on the axis of a bore, a shaft or a cylinder is the most common reason to move a pivot on imported CAD — and the hardest to do by hand. The bounding-box center, a single vertex and a triangle centroid all lie beside the true center, because CAD tessellation is unevenly dense: the middle of a round face carries far fewer triangles than its rim, so any averaged position drifts toward the denser area. **Move to Circle / Bore Center** removes the guesswork. You click the round surface once and the tool derives the exact center, axis and radius from the geometry itself. ### Quick Start [Section titled “Quick Start”](#quick-start) 1. Select the GameObject whose pivot you want to move. 2. Open the Move Pivot tool and choose **Move to Circle / Bore Center** from the method dropdown. 3. Click the round surface in the Scene View — the cylindrical wall of a shaft or bore, or a flat face that contains a bore. 4. The detected circle, its axis and the resulting pivot position appear as gizmos. Check the reported radius and deviation. 5. Click **Apply**. The detection runs on the click only, never while you hover, so large assemblies stay responsive. ### Properties [Section titled “Properties”](#properties-1) **Place at** (dropdown) Determines where along the detected axis the pivot lands: at the height you clicked, in the middle of the feature, or at either end. Use *Middle of extent* for a shaft that should rotate about its center, and *Clicked position* when the pivot belongs on a specific face. **Surface angle** (degrees) The maximum angle between neighbouring triangles that still counts as the same surface, 35° by default. Raise it for very coarse tessellation, lower it if the detection runs across a chamfer onto an adjacent face. **Align local axis to circle axis** (boolean) Rotates the object so the chosen local axis (X, Y or Z) points along the detected axis — the fastest way to prepare a part for a rotational **Drive**. This works when the circle sits on a *different* object than the one being rotated; aligning an object to a feature on itself is geometrically impossible, since the geometry turns with the object, and the tool tells you so. ### What the tool reports [Section titled “What the tool reports”](#what-the-tool-reports) The panel always shows the radius, the axis and the deviation of the fit. A small deviation confirms that the surface really is round and that the detection covered it completely. If a reliable circle cannot be determined, the tool refuses to return a result and names the reason instead of silently placing the pivot somewhere plausible — for example when only part of the circle is covered, when the surface is curved but not cylindrical (a sphere, torus or free-form face), or when the surface is not round enough. Click a more complete round face, or raise the surface angle if a coarsely tessellated cylinder is being cut short. ### Automating it [Section titled “Automating it”](#automating-it) The same detection is available to AI assistants and scripts through the MCP tool `transform_circle_center`, which takes an object path and a world-space ray and returns center, axis and radius. Interactive and automated results are identical, because both use the same detection core. ## Tips and Best Practices [Section titled “Tips and Best Practices”](#tips-and-best-practices) ### Precision Techniques [Section titled “Precision Techniques”](#precision-techniques) * **Zoom for accuracy**: Use Scene View zooming to ensure precise vertex selection * **Multiple angles**: View selection areas from different angles to confirm correct vertex targeting * **Grid snapping**: Enable Unity’s grid snapping for additional positioning precision ### Workflow Optimization [Section titled “Workflow Optimization”](#workflow-optimization) * **Test before committing**: Use Unity’s undo system to experiment safely with different positioning options * **Scene organization**: Work with simplified scene views when positioning complex assemblies * **Verification**: Always verify the selected object and intended pivot point before applying changes ### Complex Scenes [Section titled “Complex Scenes”](#complex-scenes) * **Object isolation**: Use Unity’s isolation mode for complex scenes with overlapping geometry * **Layer management**: Organize objects on different layers for easier selection * **Naming conventions**: Use clear GameObject names for easier identification during selection ## Reset and Undo Operations [Section titled “Reset and Undo Operations”](#reset-and-undo-operations) ### Reset Functionality [Section titled “Reset Functionality”](#reset-functionality) The **Reset** button clears all current selections and settings: * Deselects all point selections * Clears Object 1 and Object 2 references * Removes all visual gizmos and indicators * Returns the tool to its initial state ### Undo Support [Section titled “Undo Support”](#undo-support) All Move Pivot operations are fully integrated with Unity’s undo system: * Use **Ctrl+Z** (Windows) or **Cmd+Z** (Mac) to revert positioning changes * Multiple undo levels supported for complex positioning sequences * Undo history preserved across tool sessions ## See Also [Section titled “See Also”](#see-also) * [Unity Editor Tools](/doc/unity/basics/editor-tools/) - Overview of realvirtual editor utilities * [Component Positioning](/doc/unity/components/positioning-components/) - Guide to precise component placement * [Scene Setup Best Practices](/doc/unity/basics/scene-setup/) - Efficient scene organization techniques # Project Path Display > A compact Unity Editor window that displays the current project path. Note **Enhanced in Version 6.0.3**: Project Path Display now integrates directly with Unity’s main toolbar for better visibility and accessibility. A compact Unity Editor feature that displays the current project path directly in Unity’s toolbar for easy reference during development. ## Overview [Section titled “Overview”](#overview) The Project Path Display shows the full path of your current Unity project in Unity’s main toolbar, providing immediate visual confirmation of which project you’re working on. This feature is particularly useful when working with multiple realvirtual projects or when team members need to verify project directories. ## Features [Section titled “Features”](#features) ### Toolbar Integration [Section titled “Toolbar Integration”](#toolbar-integration) The Project Path Display is now integrated directly into Unity’s main toolbar, providing immediate visibility without taking up additional screen space: ![Project Path in Unity Toolbar](/doc/unity/assets/project-path-display-toolbar.png) Project path displayed in Unity's main toolbar showing "E:\realvirtual6\game4automation\realvirtual" ### Configuration Options [Section titled “Configuration Options”](#configuration-options) Access the Project Path Display settings through the right-click menu in the toolbar: ![Project Path Display Settings](/doc/unity/assets/project-path-display-settings.png) Right-click menu showing "Show Project Path in Toolbar" and "Apply Standard Settings" options ## Properties [Section titled “Properties”](#properties) * **Toolbar Integration**: Displays directly in Unity’s main toolbar for maximum visibility * **Auto-updating**: Path updates automatically if the project changes * **Space Efficient**: No additional window required - integrated into existing interface * **Always Accessible**: Visible whenever Unity is open * **Context Menu**: Easy toggle on/off through right-click options ## Usage [Section titled “Usage”](#usage) ### Enabling the Feature [Section titled “Enabling the Feature”](#enabling-the-feature) **Method 1: realvirtual Menu** ![realvirtual Menu Options](/doc/unity/assets/realvirtual-menu-options.png) realvirtual menu showing "Show Project Path in Toolbar" and "Apply standard settings" options 1. Go to **realvirtual** menu in Unity’s main menu bar 2. Select **“Show Project Path in Toolbar”** (✓ indicates it’s enabled) 3. The full project path will immediately appear in the toolbar **Method 2: Right-Click Context Menu** 1. **Right-click** on the Unity toolbar (in the project path area) 2. Select **“Show Project Path in Toolbar”** from the context menu 3. The full project path will immediately appear in the toolbar ### Disabling the Feature [Section titled “Disabling the Feature”](#disabling-the-feature) 1. **Uncheck** “Show Project Path in Toolbar” from either the realvirtual menu or right-click context menu 2. The project path display will be hidden from the toolbar ## Additional Features [Section titled “Additional Features”](#additional-features) ### Project Settings [Section titled “Project Settings”](#project-settings) The realvirtual menu also provides access to **“Apply standard settings”** which configures comprehensive Unity project settings optimized for industrial automation. For detailed information about this feature, see the dedicated [Project Settings](/doc/unity/basics/project-settings/) page. ## See Also [Section titled “See Also”](#see-also) * [Editor User Interface](/doc/unity/basics/user-interface/) - Overview of all editor interface tools * [Quick Edit](/doc/unity/basics/user-interface/quick-edit/) - Quick edit overlay menu with toolbar integration # Quick Edit ## What’s New in Version 6.0.3 [Section titled “What’s New in Version 6.0.3”](#whats-new-in-version-603) * **New Toolbar Integration**: QuickEdit can now be activated via the realvirtual toolbar buttons in Scene View * **Modern UI Toolkit**: Complete visual redesign with improved styling * **Better Organization**: Components grouped by functionality * **Enhanced Pivot Tools**: Integrated MovePivot functionality with dedicated toolbar button * **Improved Performance**: Faster rendering and responsiveness * **Dark Theme**: Professional dark interface matching Unity’s theme * **Dual Activation**: Both toolbar button and F1 hotkey activation methods available Note **Updated in Version 6.0.3**: QuickEdit has been redesigned with modern UI Toolkit and enhanced overlay integration. ## Overview [Section titled “Overview”](#overview) The QuickEdit overlay is a powerful Scene View tool that provides instant access to essential realvirtual components and functions. The redesigned interface features a modern, dark-themed UI with organized component categories and enhanced pivot tool integration. ![New QuickEdit UI Toolkit Interface](/doc/unity/assets/quickedit-new-ui-toolkit.png) QuickEdit overlay with modern UI Toolkit design and enhanced component organization ## Key Features [Section titled “Key Features”](#key-features) ### Component Categories [Section titled “Component Categories”](#component-categories) The new QuickEdit interface organizes components into logical groups: * **Positioning Tools**: Local, Global, Pivot controls with X-, Y+, Z+ axis buttons * **Ground Operations**: “To Ground”, “Pivot to B…”, “Align Y Up” * **Object Management**: “Empty” and “To Empty” for GameObject creation * **Core Components**: Transport Surface, Sensor, Axis, Kit * **Interaction**: Grip, Fixer, Joint * **Motion Systems**: Simple Drive, Cylinder, Gear, CAM, Follow Position, Destination Drive, Drive Erratic, Drive Speed ### Enhanced Controls [Section titled “Enhanced Controls”](#enhanced-controls) * **Pivot Integration**: Direct access to pivot manipulation tools * **Speed Control**: Target Speed slider with precise value input * **Playback Controls**: Back, Stop, Forward buttons for simulation control * **Context-Sensitive**: Available functions adapt to selected object(s) ## How to Use [Section titled “How to Use”](#how-to-use) ### Activation Methods [Section titled “Activation Methods”](#activation-methods) **Method 1: Toolbar Button (New in 6.0.3)** The QuickEdit overlay can now be activated via the new realvirtual toolbar in the Scene View: ![realvirtual Toolbar Buttons](/doc/unity/assets/quickedit-toolbar-buttons.png) New realvirtual toolbar with Quick Edit and Move Pivot buttons in Unity Scene View **Method 2: Keyboard Shortcut** Press **F1** in Scene View to toggle QuickEdit overlay (traditional method) ### Usage Steps [Section titled “Usage Steps”](#usage-steps) 1. **Activation**: Click the **Quick Edit** button in the realvirtual toolbar or press **F1** 2. **Selection**: Select objects in the Scene View or Hierarchy 3. **Component Addition**: Click component buttons to add to selected objects 4. **Pivot Control**: Use positioning tools for precise object manipulation 5. **Speed Adjustment**: Use the Target Speed slider for drive components ## Drive Control Settings [Section titled “Drive Control Settings”](#drive-control-settings) When working with Drive components, QuickEdit provides controls for setting up drive parameters that will be used during Play Mode: ![QuickEdit Drive Controls](/doc/unity/assets/quickedit-drive-controls.png) Drive control section for configuring target speed and jog settings for Play Mode ### Control Settings [Section titled “Control Settings”](#control-settings) * **Back (◀)**: Sets the drive to jog backward when Play Mode starts * **Stop (■)**: Sets the drive to stop/idle state for Play Mode * **Forward (▶)**: Sets the drive to jog forward when Play Mode starts ### Speed Configuration [Section titled “Speed Configuration”](#speed-configuration) * **Target Speed**: Sets the target speed value for the selected drive (shown as “100” in mm/s) * **Pre-Play Configuration**: Speed setting is applied to the drive component for use in Play Mode * **Units**: Speed configured in millimeters per second (mm/s) ### Usage for Play Mode Preparation [Section titled “Usage for Play Mode Preparation”](#usage-for-play-mode-preparation) 1. **Select Drive**: Click on a Drive component in the Scene View or Hierarchy 2. **Set Speed**: Configure the Target Speed value for Play Mode operation 3. **Set Direction**: Choose Back, Stop, or Forward for initial Play Mode behavior 4. **Enter Play Mode**: The drive will use the configured settings when simulation starts This feature is particularly useful for: * **Play Mode Setup**: Configure drive behavior before entering Play Mode * **Speed Configuration**: Set target speeds for automation sequences * **Initial State Setting**: Define whether drives should jog forward, backward, or remain stopped * **Simulation Preparation**: Prepare drive parameters for testing automation logic ## QuickEdit in Play Mode [Section titled “QuickEdit in Play Mode”](#quickedit-in-play-mode) During Play Mode, QuickEdit transforms into a powerful real-time control and monitoring interface, allowing you to interact with drives and control simulation parameters while the automation is running: ![QuickEdit in Play Mode](/doc/unity/assets/quickedit-playmode-active.png) QuickEdit during Play Mode showing active drive controls, timescale adjustment, and real-time drive monitoring ### Simulation Controls [Section titled “Simulation Controls”](#simulation-controls) ![Simulation Speed Controls](/doc/unity/assets/quickedit-simulation-speed-controls.png) Close-up view of Timescale and Drive Speed Override controls for simulation speed adjustment #### Timescale Control [Section titled “Timescale Control”](#timescale-control) * **Timescale Slider**: Adjust simulation speed from slow motion to accelerated time (shown: 368.8) * **Current Value Display**: Shows current timescale multiplier in real-time * **Slider Range**: From 0.1 (slow motion) to max (very fast simulation) * **Real-time Adjustment**: Changes apply immediately to entire simulation speed #### Drive Speed Override [Section titled “Drive Speed Override”](#drive-speed-override) * **Global Speed Control**: Override all drive speeds with a master multiplier (shown: 1.0) * **Independent Control**: Separate from timescale - affects only drive movements * **Slider Range**: From 0 (stopped) to max speed multiplier * **Testing Feature**: Ideal for testing automation sequences at different drive speeds ### Active Drive Monitoring [Section titled “Active Drive Monitoring”](#active-drive-monitoring) #### Drive Selection and Control [Section titled “Drive Selection and Control”](#drive-selection-and-control) * **Drive List**: Shows currently selected or active drives in the scene * **Real-time Status**: Displays current drive positions and states * **Position Display**: Shows exact drive positions (e.g., “A3: 205.8°”) * **Live Updates**: Values update continuously during simulation #### Manual Drive Control [Section titled “Manual Drive Control”](#manual-drive-control) * **Back (◀)**: Manually jog selected drive backward during simulation * **Stop (■)**: Stop selected drive immediately * **Forward (▶)**: Manually jog selected drive forward during simulation * **Override Automation**: Manual controls can override automated sequences ### Real-time Features [Section titled “Real-time Features”](#real-time-features) #### Visual Feedback [Section titled “Visual Feedback”](#visual-feedback) * **Active Drives**: Highlighted drives show which components are currently moving * **Position Indicators**: Real-time position values displayed for monitoring * **Status Colors**: Visual indicators show drive states (moving, stopped, etc.) #### Interactive Control [Section titled “Interactive Control”](#interactive-control) * **Live Adjustment**: All controls respond immediately during simulation * **No Pause Required**: Adjust parameters without stopping the simulation * **Multi-drive Support**: Monitor and control multiple drives simultaneously ### Use Cases in Play Mode [Section titled “Use Cases in Play Mode”](#use-cases-in-play-mode) * **Speed Testing**: Adjust timescale to observe automation at different speeds * **Drive Override**: Take manual control of drives during automated sequences * **Performance Tuning**: Test different speed settings in real-time * **Debugging**: Stop specific drives to isolate issues during simulation * **Training**: Demonstrate system behavior at various speeds * **System Optimization**: Fine-tune drive speeds and timing while observing results ### Key Differences from Edit Mode [Section titled “Key Differences from Edit Mode”](#key-differences-from-edit-mode) | Feature | Edit Mode | Play Mode | | -------------------- | ----------------------- | ---------------------------------- | | **Drive Controls** | Set initial parameters | Real-time drive control | | **Speed Settings** | Configure for Play Mode | Active speed override | | **Timescale** | Not available | Real-time simulation speed control | | **Position Display** | Static values | Live updating positions | | **Purpose** | Preparation and setup | Active simulation control | ## Configuration [Section titled “Configuration”](#configuration) ### Aligning Pivot Points [Section titled “Aligning Pivot Points”](#aligning-pivot-points) To align pivot points, you can use the Pivot button. This window will open the Move Pivot window. For more information check the page [Move Pivot.](/doc/unity/basics/user-interface/move-pivot-points-pro/) ### Changing Quickedit Visibility [Section titled “Changing Quickedit Visibility”](#changing-quickedit-visibility) You can toggle the visibility of the Quickedit window on/off using the Hotkey F1. If you wish to change the hotkey, you can do so within the realvirtual.io controller inside the scene. ![](/doc/unity/assets/quickedit-hotkey.png) ## Prerequisites [Section titled “Prerequisites”](#prerequisites) * Unity 6000.0.28f1 (Unity 6) or later with realvirtual framework * Scene must contain a realvirtual.io controller component * Basic familiarity with Unity Scene View interface ## Troubleshooting [Section titled “Troubleshooting”](#troubleshooting) * **QuickEdit not appearing**: Ensure F1 hotkey is enabled in the realvirtual.io controller settings * **Toolbar buttons missing**: Verify Unity 6+ installation and proper realvirtual framework setup * **Drive controls unresponsive**: Check that drive components are properly configured and selected * **Outdated interface**: Ensure you’re using realvirtual version 6.0.3 or later for the new UI Toolkit design ## See Also [Section titled “See Also”](#see-also) * [Move Pivot Points (Pro)](/doc/unity/basics/user-interface/move-pivot-points-pro/) - Advanced pivot manipulation tools * [Reparenting Tool (Pro)](/doc/unity/basics/user-interface/reparenting-tool-pro/) - Hierarchy management * [Runtime UI](/doc/unity/basics/runtime-ui/) - Play Mode interface controls # Recent Items (Pro) > Quick navigation to recently used GameObjects, Assets, and Scenes Note **Professional Feature**: Recent Items is only available in realvirtual Professional version 6.0.7 and above. Recent Items provides quick access to recently used GameObjects, project assets, and scenes through a Scene View overlay panel. ![Recent Items Overlay Panel](/doc/unity/assets/recent-items-overlay.png) ## Overview [Section titled “Overview”](#overview) Recent Items automatically tracks your selection history and organizes items into three categories: * **Scene Objects**: GameObjects from your scenes (shows up to 5 items) * **Project Assets**: Scripts, prefabs, materials, etc. (shows up to 5 items) * **Scenes**: Scene files you’ve opened (shows up to 3 items) Objects in different scenes are marked with **(→)** and prompt you to switch scenes when clicked. ## How to Use [Section titled “How to Use”](#how-to-use) 1. Click the **Recent** button in the realvirtual toolbar to toggle the overlay 2. Click any item to navigate to it immediately 3. The overlay closes automatically after selection 4. Use **Clear All** button to remove history ## Features [Section titled “Features”](#features) * **Auto-tracking**: Continuously monitors your selections * **Unity Icons**: Each item shows its appropriate icon (blue for prefabs, etc.) * **Time Stamps**: Shows when you last accessed each item (2m, 5h, 3d, etc.) * **Smart Scene Switching**: Prompts before switching to different scenes * **Persistent History**: Maintains history across Unity sessions * **Auto-refresh**: Updates every 2 seconds when visible ## Prerequisites [Section titled “Prerequisites”](#prerequisites) * Unity 6 (6000.0.28f1) or newer * realvirtual Professional 6.0.7+ ## See Also [Section titled “See Also”](#see-also) * [Quick Edit](/doc/unity/basics/user-interface/quick-edit/) - Scene View overlay for component addition * [Move Pivot Points (Pro)](/doc/unity/basics/user-interface/move-pivot-points-pro/) - Advanced pivot tools * [Selection Window (Pro)](/doc/unity/basics/selection-window/) - Advanced selection management *** © 2025 realvirtual GmbH [https://realvirtual.io](https://realvirtual.io/) - All rights reserved. # Reparenting Tool (Pro) The Reparenting Tool allows you to efficiently move multiple GameObjects to a new parent in the hierarchy. Unlike Unity’s drag-and-drop, this tool offers batch operations, safety validation, and flexible workflow options. ## How to Use [Section titled “How to Use”](#how-to-use) Open the tool via `Tools > realvirtual > Reparenting (Pro) (Alt+R)` or press `Alt+R`. **Basic Workflow:** 1. Select a target parent using the object field or “Use Selected” button 2. Select objects in the hierarchy and click “Add Selected” to add them to the move list 3. Click the green “MOVE TO PARENT” button to execute the operation 4. Use the yellow undo button if needed to reverse the operation **Alternative Workflow:** You can also add objects to the move list first, then select a parent later - the tool works in any order. ## Interface Elements [Section titled “Interface Elements”](#interface-elements) * **Target Parent**: Object field to select the destination parent, or use “Use Selected” button * **Add Selected**: Adds currently selected hierarchy objects to the move list * **Clear List**: Removes all objects from the move list * **Objects List**: Expandable view showing queued objects (click “X” to remove individual items) * **MOVE TO PARENT**: Turns green when ready, shows object count in parentheses * **Undo Button**: Yellow button appears after successful operations ## Safety Features [Section titled “Safety Features”](#safety-features) The tool automatically prevents common errors: * **Circular dependencies**: Won’t let you make a parent become its own child * **Prefab protection**: Blocks moving into prefab assets or connected prefab instances with helpful error messages * **Smart validation**: Excludes the selected parent from objects to move, removes duplicates and null references Objects maintain their world position and rotation after being moved. ## Common Error Messages [Section titled “Common Error Messages”](#common-error-messages) * *“Cannot move objects into a prefab asset”* → Instantiate the prefab in the scene first * *“Cannot move objects into a connected prefab instance”* → Unpack the prefab or choose a regular GameObject * *“Would create circular dependency”* → Choose a different parent or restructure the hierarchy * *“No valid objects selected to move”* → Add different objects or select a different parent The tool is ideal for organizing imported CAD models, preparing prefabs, or restructuring complex scenes with multiple object groups. *** © 2025 realvirtual GmbH [https://realvirtual.io](https://realvirtual.io/) - All rights reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or by any means, including printing, saving, photocopying, recording, or other electronic or mechanical methods, without the prior written permission of the publisher. # Changing MUs Components for dynamically modifying MU (Movable Unit) appearance, materials, and behavior during simulation. ## Available Components [Section titled “Available Components”](#available-components) ### Visual Modifications [Section titled “Visual Modifications”](#visual-modifications) * **[PartChanger](/doc/unity/components-and-scripts/changing-mus/partchanger/)** - Changes the visual appearance of MUs by switching between predefined appearances * **[MUSwitcher](/doc/unity/components-and-scripts/changing-mus/muswitcher/)** - Controls visibility of grouped GameObjects within MUs based on sensor detection * **[MaterialChanger](/doc/unity/components-and-scripts/changing-mus/materialchanger/)** - Dynamically changes materials on MU components ### Processing Operations [Section titled “Processing Operations”](#processing-operations) * **[Cutter](/doc/unity/components-and-scripts/changing-mus/cutter/)** - Simulates cutting operations on MUs with visual feedback ## Key Features [Section titled “Key Features”](#key-features) * **Sensor Integration**: Changes triggered by sensor detection events * **PLC Integration**: Control via PLCInputBool signals for industrial automation * **Visual Feedback**: Real-time appearance changes during simulation * **Logic Integration**: Works with Logic Steps and automation sequences ## See Also [Section titled “See Also”](#see-also) * [MU (Movable Unit)](/doc/unity/components-and-scripts/mu-movable-unit/) - Base MU functionality * [Sensors](/doc/unity/components-and-scripts/sensors/) - Sensor components for triggering changes * [Logic Steps](/doc/unity/components-and-scripts/defining-logic/logicsteps/) - Automation logic integration # Cutter > Cutting MUs into multiple parts The Cutter component is designed to efficiently segment Movable Units (MUs) into distinct pieces by slicing the meshes within these units along a specified plane. This process divides the MUs into a positive side and a negative side, ensuring that all included meshes are precisely cut according to the plane’s orientation. This functionality is integral for simulations requiring dynamic object modification, such as cutting or dividing objects into separate parts for further interaction. The Cutter component offers versatility in its cutting operation, allowing it to either divide the entire Movable Unit (MU) or selectively slice only specific meshes within the MUs that are designated by tags. This example demonstrates two distinct cutting processes using the Cutter component, where in both instances, the positive part of each cut is deleted—a configurable option. During the first cut, the entire Movable Unit (MU) is subjected to the slicing action. In the second cut, the process is refined to only target and slice the outer mesh of the MU. The DemoCutter Scene, showcasing the Cutter component’s functionality, is located in the demo folder. [](/doc/unity/assets/Unity_dP4queD00l.mp4) Cutting MUs with the Cutter component ## **Prerequisites** [Section titled “Prerequisites”](#prerequisites) The Cutter component requires the ‘BzKovSoft.ObjectSlicer’ package from the Unity Asset Store. 🔗 [Mesh slicer on Unity Asset Stroe](https://assetstore.unity.com/packages/tools/modeling/mesh-slicer-59618) Ensure this package is installed and the Scripting Define Symbol `REALVIRTUAL_CUTTER` is set in your project settings. A demo package showcasing the Cutter component’s capabilities is available. For more details and to download the package, please refer to the description on the Unity Asset Store. ## **Properties** [Section titled “Properties”](#properties) ![](/doc/unity/assets/image%20\(17\).png) Cutter component The simplest method to utilize the Cutter component is by dragging and dropping the Cutter prefab directly into your scene. All cutting actions performed by this component are based on the Plane, which is oriented according to the Y direction of the component. **Settings** * **Cut Material**: Assigns a material to the faces created by the cut. * **Delete Options**: Allows for the deletion of either the positive or negative side of the cut object. * **Block For Seconds After Cut**: Temporarily disables cutting after a cut is performed to prevent rapid successive cuts. * **Submesh Cutting**: Option to cut only specified submeshes by tagging them. **Signals / IOs** * **Start Cut**: A boolean signal that, when true, initiates the cutting process. This can be linked to an external PLC signal for automation. * **Signal Cut**: Represents an external trigger for starting the cutting process. ## **Functionality** [Section titled “Functionality”](#functionality) 1. **Cutting Process**: * The component detects colliders entering its trigger area (defined by the included box collider), identifying objects for cutting. * When the `Start Cut` signal is activated, the component slices through the detected objects based on the configured settings. 2. **Submesh and Full MU Cutting**: * If `OnlySubmeshes` is enabled, only the parts of objects tagged with `SubmeshTag` are cut. Please make sure to define the tags for the Submeshes * Without `OnlySubmeshes`, entire objects within the trigger area are subject to cutting. 3. **Post-Cut Handling**: * Objects can be selectively destroyed based on the `DeletePositiveCut` and `DeleteNegativeCut` settings. # MaterialChanger The MaterialChanger enables seamless material adjustments for the MeshRenderer on a GameObject. Changes can be triggered by collisions, sensor status, or PLC signals. ![](/doc/unity/assets/materialchanger.png) ### Properties[](#properties) [Section titled “Properties ”](#properties) **Material off / on**\ Materials that should be used. **Status on**\ The current status. **Change on collision**\ Change material based on a collision. A collider needs in this case to be attached to the same Gameobject. **Change on Sensor**\ Changes the material based on the sensor status. **Change on PLC Output**\ Changes the material based on the defined PLC Output. © 2025 realvirtual GmbH [https://realvirtual.io](https://realvirtual.io/) - All rights reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or by any means, including printing, saving, photocopying, recording, or other electronic or mechanical methods, without the prior written permission of the publisher. # MUSwitcher > Included since version 6.2.3 beta The **MU Switcher** component allows dynamic switching of parts or variants of [Moving Units (MUs) ](/doc/unity/components-and-scripts/mu-movable-unit/)based on sensor triggers. It is typically used in scenarios where different configurations or visual representations of an MU need to be activated during runtime (e.g., for visual changes, turning easy MUs into complex ones and so on). [](/doc/unity/assets/muswitcher%20\(1\).mp4) Changing MUs with MUSwitcher (Demo2 in DemoChangeMU demonstration model) ## Properties [Section titled “Properties”](#properties) **Switch To Group**: The name of the group (e.g., `MUVariant1`) that should be activated when an MU enters the sensor area. ![](/doc/unity/assets/muswitcher-inspector.png) MUSwitcher attached to a Sensor When an MU enters the sensor associated with the `MUSwitcher`: 1. All subcomponents of the MU that are part of the specified group (matching the `Switch To Group`) are **enabled** (set active). 2. All other groups are **disabled** (set inactive). 3. Any GameObjects under the MU that do not belong to a group remain in their current active state ## Requirements [Section titled “Requirements”](#requirements) * The `MUSwitcher` must be attached to the same GameObject as a `Sensor` component. * MU subcomponents must include a `Group` component that defines their `GroupName`. ![](/doc/unity/assets/muswitcher-mu.png) Example of a part with several Groups # PartChanger Instead of using PartChanger you can use MUSwitcher which might be an easier and more convienient way for changing a MU during simulation The PartChanger is able to change the visual appearance of a part on certain events. For doing this all child components under the object with the [MU](/doc/unity/components-and-scripts/mu-movable-unit/) script attached to are getting replaced by a new part. The new part should always be a Prefab which is saved somewhere in the project. You can find a Demo scene for the PartChanger under Assets/realvirtual/Scenes/DemoChangeMU.unity The part changer can change the visual appearance of the component where the part changer is attached to (*Change this part* option) or to change the visual appearance of an [MU](/doc/unity/components-and-scripts/mu-movable-unit/) which is detected by a Sensor (*Change On Sensor* option) ![](/doc/unity/assets/partchanger.png) ### Configuration of the PartChanger[](#configuration-of-the-partchanger) [Section titled “Configuration of the PartChanger ”](#configuration-of-the-partchanger) You need to set a Part Number in the Part changer. This is the number, starting from 0, in the list of available Appearances. The list of available Appearances can be on the [MU](/doc/unity/components-and-scripts/mu-movable-unit/) or on the PartChanger itself if no MU is changed. #### Change detected MU on Sensor [Section titled “Change detected MU on Sensor”](#change-detected-mu-on-sensor) Is changing the appearance of [MUs](/doc/unity/components-and-scripts/mu-movable-unit/) which are entering the defined sensor. #### Change this part [Section titled “Change this part”](#change-this-part) Is changing the appearance of the object where the PartChanger script is attached to. This means that the part changer needs to be attached to an MU. #### Conditions [Section titled “Conditions”](#conditions) You can select a condition when the Part should be changed. #### `Condition Sensor Is Touched` [Section titled “Condition Sensor Is Touched”](#condition-sensor-is-touched) This property allows the visual appearance of a part to change when a sensor detects a part. If set to true, the part will change as soon as the sensor touches an [MU](/doc/unity/components-and-scripts/mu-movable-unit/). #### `Condition Part Number Is Changing` [Section titled “Condition Part Number Is Changing”](#condition-part-number-is-changing) When enabled, this property changes the visual appearance of the part whenever the `PartNumber` value changes. This is useful for dynamically updating the appearance based on external triggers, such as updates from a PLC or other logic controllers. #### `Condition PLC Signal Change` [Section titled “Condition PLC Signal Change”](#condition-plc-signal-change) If enabled, this property changes the part’s visual appearance when the corresponding PLC signal (`PLCChangePartNow`) changes. This is especially useful when integrating with PLC systems to trigger a part change based on automation logic. The part will be updated each time the signal changes its state. #### Signals [Section titled “Signals”](#signals) You can connect two PLC Signals. One for starting the visual change and one for selecting a new part number. ![](/doc/unity/assets/partchanger-settings.png) © 2025 realvirtual GmbH [https://realvirtual.io](https://realvirtual.io/) - All rights reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or by any means, including printing, saving, photocopying, recording, or other electronic or mechanical methods, without the prior written permission of the publisher. # Collision Detection realvirtual provides group-based collision detection for monitoring physical contacts between defined sets of objects during simulation. ## Components [Section titled “Components”](#components) | Component | Description | Edition | | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ------------ | | [Group Collision Checker](/doc/unity/components-and-scripts/collision/group-collision-checker/) | Runtime collision detection between named groups with GPU highlight and PLC signals | Professional | ## Concept [Section titled “Concept”](#concept) The collision detection system builds on the [Group](/doc/unity/components-and-scripts/motion/group/) component. You assign objects to named groups, then the GroupCollisionChecker monitors cross-group contacts while suppressing self-collision within each group. This is particularly useful for: * Detecting robot-to-machine collisions without false alarms from internal joints * Monitoring gripper-to-fixture contact * Safety zone violation detection * Multi-robot workspace overlap monitoring # Group Collision Checker (Pro) ## Overview [Section titled “Overview”](#overview) The **GroupCollisionChecker** detects runtime collisions between named realvirtual groups. Objects within the same group never collide with each other (self-collision is suppressed), while objects from different groups trigger collision events automatically. This is useful for monitoring whether a robot arm collides with machine fixtures, or a gripper penetrates a workpiece holder — without false alarms from joints within the same kinematic chain. [](/doc/unity/assets/group-collision-checker.mp4) Collision between the robot group and the machine door is detected and highlighted in real time Note This feature was added in realvirtual **6.3.0** (Professional) ## How It Works [Section titled “How It Works”](#how-it-works) The system uses a single dedicated physics layer (`rvCollissionCheck`) that is isolated from all other realvirtual layers (sensors, transport surfaces, sinks). Within that layer: * **Same-group** collider pairs are suppressed via `Physics.IgnoreCollision` * **Cross-group** collider pairs trigger collision events automatically * Only **one** physics layer is consumed regardless of how many groups you define This design avoids layer exhaustion and prevents side effects on sensors or transport systems. ## Quick Start [Section titled “Quick Start”](#quick-start) 1. Add a **GroupCollisionChecker** component to any GameObject in your scene 2. Add entries to **Collision Groups** — each entry is a realvirtual Group name plus a collider mode 3. Optionally assign a **MultiObjectOverlayRendererFeature** reference for GPU-based highlighting 4. Press Play — collisions are detected and reported via signals, events, and Inspector status ## Properties [Section titled “Properties”](#properties) ### Collision Groups [Section titled “Collision Groups”](#collision-groups) **Collision Groups** (list) The groups to monitor. Each entry defines: * **Group Name** — the realvirtual Group name (as assigned via the Group component) * **Collider Mode** — how colliders are created for objects in this group: * **BoxApproximation** — creates a BoxCollider from the renderer bounds. Fast and safe, but coarse. * **MeshCollider** — creates a convex MeshCollider. More accurate, uses the convex hull (max 255 vertices). * **ExistingOnly** — uses only already-present colliders. Objects without a collider are skipped. ### Settings [Section titled “Settings”](#settings) **Auto Setup On Start** (boolean) When enabled, the collision system initializes automatically when the simulation starts. Disable this to call `SetupCollisionSystem()` manually from script. ### Highlight [Section titled “Highlight”](#highlight) **Highlight On Collision** (boolean) Enables GPU-accelerated visual highlighting of colliding objects via the URP Overlay Renderer Feature. **Overlay Feature** (reference) Assign a dedicated `MultiObjectOverlayRendererFeature` instance from your URP Renderer Asset. This must be a separate instance from the one used by the Selection system. **Highlight Color** (Color) The highlight overlay color applied to colliding objects. Default: red. **Overlay Mode** (enum) The rendering style for the highlight: Default, XRay, or Blink. **Blink Speed** (float) Blink frequency in cycles per second when Overlay Mode is set to Blink. **Reset Mode** (enum) Controls when highlights are removed: * **WhileColliding** — highlight disappears automatically when collision ends * **OnEnterPersistent** — highlight stays until manually reset via the ResetHighlight signal ### Interface Connection (PLC Signals) [Section titled “Interface Connection (PLC Signals)”](#interface-connection-plc-signals) **CollisionActive** (PLCInputBool) Output to PLC — true when at least one cross-group collision is active. **CollisionCount** (PLCInputInt) Output to PLC — number of currently active collision pairs. **ResetHighlight** (PLCOutputBool) Input from PLC — a rising edge clears all collision highlights. **ResetCollisions** (PLCOutputBool) Input from PLC — a rising edge resets all collision tracking. ### Events [Section titled “Events”](#events) **OnCollisionEnterEvent** (UnityEvent) Fired when a cross-group collision begins. Provides both GameObjects involved. **OnCollisionExitEvent** (UnityEvent) Fired when a cross-group collision ends. Provides both GameObjects involved. ### Advanced [Section titled “Advanced”](#advanced) **Excluded Pairs** (list) Specific cross-group pairs to exclude from detection. For example, exclude “Gripper” vs. “Workpiece” if gripper contact is intentional. ### Status (Read-Only) [Section titled “Status (Read-Only)”](#status-read-only) **Is Colliding** — true when at least one collision is active **Active Collision Count** — number of active collision pairs **Total Proxy Count** — total managed collider proxies **Highlighted Renderer Count** — renderers currently highlighted **Active Pairs** — human-readable list of current collision pairs ## Collider Mode Recommendations [Section titled “Collider Mode Recommendations”](#collider-mode-recommendations) | Group Type | Recommended Mode | Reason | | --------------- | ---------------- | ------------------------------------------------------ | | Robot joints | ExistingOnly | Manually placed capsule/box colliders are more precise | | Machine frame | BoxApproximation | Many parts, coarse detection sufficient | | Gripper / tools | MeshCollider | Accurate shape matters for contact detection | | Safety zones | ExistingOnly | Manually placed box triggers as zone boundaries | ## Typical Use Cases [Section titled “Typical Use Cases”](#typical-use-cases) **Robot vs. Machine Frame** — A 6-axis robot arm (Group “RobotArm”) moves near a machine frame (Group “MachineFrame”). Self-collision within the robot’s joints is suppressed. Any contact between robot and frame triggers a red blinking highlight and sets the PLC signal to stop the robot. **Gripper vs. Fixture** — A gripper (Group “Gripper”) picks parts from a fixture (Group “Fixture”). Gripper-to-workpiece contact is excluded via Excluded Pairs. Only unintended gripper-to-fixture contact triggers an alarm. **Multiple Robots** — Two robots (Group “Robot1”, Group “Robot2”) work in overlapping reach zones. Each robot’s internal joints don’t trigger alarms, but any robot-to-robot contact does. ## Highlight Setup (URP) [Section titled “Highlight Setup (URP)”](#highlight-setup-urp) To use the highlight feature, you need a second `MultiObjectOverlayRendererFeature` in your URP Renderer: 1. Open your URP Renderer Asset (typically `URP-Default-Renderer.asset`) 2. Click **Add Renderer Feature** and select **Multi Object Overlay Renderer Feature** 3. Name it “CollisionOverlay” to distinguish it from the selection overlay 4. Assign this new feature to the **Overlay Feature** field on the GroupCollisionChecker The existing overlay feature (used by the Selection system) remains untouched. ## Scripting API [Section titled “Scripting API”](#scripting-api) ```csharp // Manual setup (if AutoSetupOnStart is false) checker.SetupCollisionSystem(); // Clear highlights without resetting tracking checker.ClearAllHighlights(); // Reset all tracking (highlights + active pairs) checker.ClearCollisionTracking(); // Subscribe to collision events via C# delegates checker.OnGroupCollisionEnter += (objA, objB) => { Debug.Log($"Collision: {objA.name} <-> {objB.name}"); }; checker.OnGroupCollisionExit += (objA, objB) => { Debug.Log($"Collision ended: {objA.name} <-> {objB.name}"); }; ``` ## See Also [Section titled “See Also”](#see-also) * [Group](/doc/unity/components-and-scripts/motion/group/) — assigning objects to groups * [Group Manager](/doc/unity/basics/runtime-ui/group-manager/) — hiding/showing groups at runtime * [Selection Window](/doc/unity/basics/selection-window/) — filtering by groups in the editor © 2025 realvirtual GmbH [https://realvirtual.io](https://realvirtual.io/) - All rights reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or by any means, including printing, saving, photocopying, recording, or other electronic or mechanical methods, without the prior written permission of the publisher. # Machining Tool **MachiningTool** defines the shape and dimensions of a cutter that removes material from a **MachiningVolume**. Note This feature was added in realvirtual **6.3.5** (Professional) ## Overview [Section titled “Overview”](#overview) MachiningTool sits on the GameObject that represents your physical cutter - typically a mesh moved by a **Drive** at a spindle or robot end effector. Its geometry, not the visual mesh, defines exactly what gets subtracted from any MachiningVolume it touches, so the shape you configure here should match your real tool. Move the tool through a workpiece during Play mode to remove material in real time. ## Properties [Section titled “Properties”](#properties) ### Tool Geometry [Section titled “Tool Geometry”](#tool-geometry) **Shape** (enum: Cylinder / BallNose / Torus / ConicalEnd) The cutter shape used for material removal: * **Cylinder** - a flat-end mill, ideal for pocketing and facing. * **BallNose** - a cylinder with a hemispherical tip, for smooth 3D contours. * **Torus** - a bull-nose / corner-radius mill, using **Corner Radius** for the rounded edge. * **ConicalEnd** - a tapered cutter for chamfering, using **Taper Angle**. **Tool Diameter** (millimeters) The cutting diameter of the tool. **Tool Length** (millimeters) The overall length of the cutting section of the tool. **Corner Radius** (millimeters) The edge rounding radius, used by the **BallNose** and **Torus** shapes. **Taper Angle** (degrees) The half-angle of the taper, used by the **ConicalEnd** shape - larger angles produce a wider chamfer cutter. ## Quick Start [Section titled “Quick Start”](#quick-start) 1. Add the **MachiningTool** component to your cutter GameObject. 2. Choose the **Shape** that matches your real tool, and set **Tool Diameter** and **Tool Length**. 3. Add the object (or its Drive-driven parent) to a MachiningVolume’s **Tools** list, or tag it with a matching **Tool Group**. 4. Move the tool through the workpiece with a **Drive** during Play mode to cut material. ## Common Use Cases [Section titled “Common Use Cases”](#common-use-cases) * **Matching a Real Cutter** - Configure Shape, Tool Diameter and Tool Length to mirror the physical tool used on the shop floor for an accurate virtual commissioning result. * **Multi-Tool Machining Centers** - Combine several MachiningTool objects (mill, drill, chamfer cutter) referenced by the same MachiningVolume for a realistic multi-operation cycle. * **Tool Changers** - Swap tools at runtime using **Tool Group** on the MachiningVolume, so newly spawned or exchanged tools are picked up automatically. ## See Also [Section titled “See Also”](#see-also) * [Machining Volume](/doc/unity/components-and-scripts/csg/machining-volume/) - The workpiece stock that MachiningTool removes material from * [Drive](/doc/unity/components-and-scripts/motion/drive/) - Move the tool along the real machining path # Machining Volume **MachiningVolume** turns a GameObject into a machinable workpiece, removing material in real time as a **MachiningTool** passes through it. Note This feature was added in realvirtual **6.3.5** (Professional) ## Overview [Section titled “Overview”](#overview) MachiningVolume simulates real-time material removal for virtual commissioning of CNC milling, drilling and grinding applications. Internally it represents the workpiece as a voxel-based stock: as one or more MachiningTool objects move through the volume, material is subtracted continuously and the visible mesh is rebuilt as a watertight, closed surface - no pre-baked cut animations, no scripted geometry swaps. ![](/doc/unity/assets/machining-volume-demo.png) A 3-axis gantry mill cutting serpentine grooves into an aluminum block with MachiningVolume Use MachiningVolume together with **Drive** components to move the tool along the real machining path, and connect PLC signals to reset and monitor the process exactly as on a real CNC control. ## Transform Requirement [Section titled “Transform Requirement”](#transform-requirement) The machining pipeline needs a **rigid workpiece transform**: tool radii are real millimeters and the machined surface is rebuilt unscaled. MachiningVolume therefore bakes any transform scale into the stock geometry when the simulation starts and resets the transform to scale 1. The displayed size does not change - a scaled Unity primitive machines exactly as you see it in the Scene view. This has one consequence worth knowing before you build the workpiece: * **Box, Sphere and Capsule colliders** on the same GameObject are adjusted automatically and keep their world size. Nothing to do. * **A Mesh Collider** cannot be adjusted - its geometry lives in a shared mesh asset that must never be rewritten, because every other object using that mesh would change with it. It shrinks by exactly the baked scale factor, so the volume reports it with a warning in the Console and the Inspector shows the same warning while you are still authoring the scene. To resolve the warning, either replace the Mesh Collider with a Box, Sphere or Capsule collider carrying the real dimensions at scale 1 - the Inspector prints the exact numbers - or move the Mesh Collider to a **child** GameObject, which the volume never touches. Colliders on child objects and a scaled **parent** hierarchy are outside this mechanism: keep the parents of a machining volume unscaled for exact results. ## Properties [Section titled “Properties”](#properties) ### Workpiece Settings [Section titled “Workpiece Settings”](#workpiece-settings) **Grid Resolution** (Vector3Int) Voxel grid resolution along X, Y and Z (for example 64 x 64 x 64). Higher resolution produces finer, smoother cut surfaces but increases memory use and mesh rebuild cost - start low and increase only where the extra detail is visible. **Workpiece Size** (millimeters) The size of the workpiece stock along X, Y and Z, used for the Box and Cylinder shapes. **Shape** (enum: Box / Cylinder / Mesh) The starting stock shape. **Box** creates a rectangular block spanning Workpiece Size. **Cylinder** creates a capped cylinder inscribed in Workpiece Size, oriented along **Cylinder Axis**. **Mesh** voxelizes any closed, watertight mesh into the stock - use this to machine arbitrary CAD parts instead of a primitive shape. **Cylinder Axis** (enum: X / Y / Z) The axis a Cylinder workpiece lies along. X or Z produces a lying (horizontal) cylinder, Y produces an upright cylinder. Only used when Shape is Cylinder. **Stock Mesh** (Mesh) The source mesh for Shape = Mesh. Leave empty to machine the mesh already assigned to the workpiece’s Mesh Filter (what you see is what gets machined). The mesh must be closed and readable, and any transform scale on the GameObject is baked into the stock automatically, so a scaled Unity primitive machines exactly as displayed - see [Transform Requirement](#transform-requirement) for what this means for colliders. ### Tools [Section titled “Tools”](#tools) **Tools** (list) The MachiningTool objects that subtract material from this volume every simulation tick, evaluated in list order. Assign tools directly, or let **Tool Group** discover them automatically. **Tool Group** (string) An optional realvirtual Group name. Any object carrying a MachiningTool component and this group is added to Tools automatically, including MUs spawned at runtime - useful for tool-changer setups or machining stations fed by a Source. Leave empty to use only the explicit Tools list. **Sweep Tool Motion** (boolean) When enabled, the volume subtracts the swept path of each tool between simulation steps instead of only its end position, so fast tool motion still cuts a continuous groove rather than a series of disconnected dents. **Max Sweep Substeps** (integer) The maximum number of tool poses sampled along the swept motion path per simulation step, per tool. Raise this if very fast tool moves leave visible gaps in the cut; lower it to save performance. ### Mesh Output [Section titled “Mesh Output”](#mesh-output) **Meshing** (enum: MarchingCubes / DualContouring) The surface reconstruction algorithm. **MarchingCubes** is the robust default with slightly rounded edges. **DualContouring** (experimental) produces sharper edges and corners, at higher computational cost. **Crease Angle** (degrees) The hard-edge threshold used by Dual Contouring: surface normals that diverge by more than this angle get a sharp, unsmoothed edge instead of a rounded one. Set to 0 to disable and always smooth-shade. **Generate UVs** (boolean) Generates UV coordinates on the machined surface using triplanar projection, so materials with textures map correctly onto newly cut faces. **Statistics Interval** (seconds) How often the **Material Remaining Percent** and **Voxels Modified** statistics in the Inspector are refreshed. ### Signals / IOs [Section titled “Signals / IOs”](#signals--ios) **Signal Spindle On** (PLC output) While false, no material is removed - use this to simulate the spindle being switched off. **Signal Reset** (PLC output) A rising edge restores the workpiece to its original, unmachined state - wire this to a “load new blank” or “cycle reset” step in your control logic. **Signal Machining Active** (PLC input) True while material is actively being removed or the mesh is still catching up with recent cuts - use it as a busy/in-cycle indicator. ### Status (read-only) [Section titled “Status (read-only)”](#status-read-only) **Material Remaining Percent** The percentage of the original stock volume still present. **Voxels Modified** The number of voxels removed since the workpiece was last initialized or reset. ## Quick Start [Section titled “Quick Start”](#quick-start) 1. Add a **MeshFilter** and **MeshRenderer** to your workpiece GameObject (a Unity primitive works, or your own CAD stock mesh). 2. Add the **MachiningVolume** component and choose a **Shape** - Box, Cylinder, or Mesh for a custom CAD stock. 3. Add a **MachiningTool** component to the object representing your cutter, and set its shape and dimensions. 4. Drag the tool into the **Tools** list of the MachiningVolume (or assign a matching **Tool Group** instead). 5. Move the tool through the workpiece with a **Drive** and press Play - material is removed live as the tool passes through. ## Common Use Cases [Section titled “Common Use Cases”](#common-use-cases) * **CNC Milling Virtual Commissioning** - Validate a real milling program’s tool path and cycle time against a live 3D representation of the finished part. * **Robot Deburring / Grinding** - Simulate a robot-mounted grinding or deburring tool removing material along a programmed path. * **PLC-Driven Machining** - Drive the spindle and axes from a real PLC interface, using **Signal Reset** and **Signal Machining Active** for cycle control exactly as on the real machine. * **Arbitrary CAD Stock Machining** - Machine an imported CAD part directly using Shape = Mesh, instead of approximating it with a Box or Cylinder. ## See Also [Section titled “See Also”](#see-also) * [Machining Tool](/doc/unity/components-and-scripts/csg/machining-tool/) - Defines the cutter geometry that removes material from a MachiningVolume * [Drive](/doc/unity/components-and-scripts/motion/drive/) - Move the tool along the real machining path # Defining Logic > Building simulation models There are 3 main use cases for realvirtual.io - Simulation, Virtual Commissioning and using the 3D Digital Twin in parallel with a real machine as a 3D HMI. For the use case simulation (but maybe also in some special cases also for the other usecases) you might want to implement your own custom logic. There are several ways for doing that, [logicsteps.md](/doc/unity/components-and-scripts/defining-logic/logicsteps/ "mention"), [unity-scripting.md](/doc/unity/components-and-scripts/defining-logic/unity-scripting/ "mention"), [Broken link](/doc/unity/components-and-scripts/defining-logic/broken-reference/ "mention") and [unity-visual-scripting.md](/doc/unity/components-and-scripts/defining-logic/unity-visual-scripting/ "mention"). # Behavior Graph > Using Unity6 Behavior Graph for Visual Scripting Unity’s **Behavior Graph** provides a powerful and visual way to design and manage behaviors within your projects. Here is a guide to getting started with it in a realvirtual.io context. You can find a Demo scene here: Assets/realvirtual/BehaviorGraph/DemoBehaviorGraph.unity ![](/doc/unity/assets/behavior-graph.png) Behavior Graph in the Behavior Demo Scene ## Prerequisites and Installation [Section titled “Prerequisites and Installation”](#prerequisites-and-installation) * **Install Behavior Graph**: * Open Unity and go to **Window > Package Manager**. * Locate **Behavior** in the list of available Unity packages. * Select and install the package. * ```plaintext
``` * **Set Up Scripting Define Symbols**: * Navigate to **Edit > Project Settings > Player**. * Under the **Other Settings** section, locate **Scripting Define Symbols**. * Add `REALVIRTUAL_BEHAVIOR` to the list of symbols. * Save and close the settings. ![](/doc/unity/assets/behavior-playersettings.png) ## Editing a Behavior Graph [Section titled “Editing a Behavior Graph”](#editing-a-behavior-graph) The Behavior Graph allows you to visually design behavior flow for your Unity components. For more detailed information on Unity’s Behavior Graph system, refer to the Unity Documentation on Behavior Graphs. 🔗 **Creating a New Behavior Graph**: * Right-click in the **Project** window and select **Create > Behavior Graph**. * Name your new graph file. **Assigning the Behavior Graph**: * Add a **Behavior Agent** component to a GameObject in your scene. * Assign the newly created graph file to the component. #### Using Behavior Graphs Across Scenes [Section titled “Using Behavior Graphs Across Scenes”](#using-behavior-graphs-across-scenes) * **Behavior Graphs are reusable**: You can use the same behavior graph across multiple scenes by attaching it to different objects. * **Scene-specific connections**: To connect the graph variables to scene objects, you must link them in the **Behavior Agent** (see below). ![](/doc/unity/assets/behavior-agent.png) **Opening the Graph Editor**: * Double-click the graph file in the **Project** window to open the Behavior Graph Editor. **Adding Nodes**: * Right-click anywhere in the graph editor to open the context menu. * Select the type of node you want to add. There are several special realvirtual.io Nodes available. ![](/doc/unity/assets/behavior-add.png) ![](/doc/unity/assets/behavior-realvirtual.png) * Drag connections between nodes to define the behavior flow. **Configuring Nodes**: * Select a node to view its properties in the **Inspector** window. * Configure properties like triggers, conditions, or actions for each node. **Testing the Behavior**: * Save the graph and play the scene to test your behavior. * Debugging tools in Unity can help you monitor node activations and transitions. ![](/doc/unity/assets/behavior-realvirtual%20\(1\).png) # LogicSteps (Pro) LogicSteps provide a visual, component-based system for creating automation sequences without PLCs or programming. You can control drives, sensors, and signals through predefined logic components that execute in sequence. [](/doc/unity/assets/logicsteps-animation.mp4) LogicSteps system in action showing sequential execution flow and real-time status updates ![](/doc/unity/assets/logicsteps-inspector.png) LogicSteps container configuration in Unity Inspector showing parallel and sequential execution options ## Overview [Section titled “Overview”](#overview) LogicSteps enable automation engineers to create complex production sequences using Unity’s Inspector interface. Each step is a component attached to a GameObject, and the component order determines execution sequence. The system supports both sequential and parallel execution patterns through container components. Note The main advantage of LogicSteps is the ability to define operation sequences and conditions without programming or additional software installation. Tip **New in Current Release**: Parallel and Serial Container components are now included for improved visual structuring and organization of LogicSteps workflows. These containers provide clearer hierarchy visualization and better execution flow management. LogicSteps automatically handle execution flow, progress visualization, and state management. Blocking steps pause execution until completion, while non-blocking steps execute immediately. ![LogicSteps Inspector interface](/doc/unity/assets/logicsteps.png) ## Properties [Section titled “Properties”](#properties) ### Base LogicStep Properties [Section titled “Base LogicStep Properties”](#base-logicstep-properties) All LogicStep components inherit these common properties: #### Name [Section titled “Name”](#name) Unique identifier for the logic step. * **Type**: String * **Default**: Empty * **Use case**: Required for jump operations and sequence debugging #### State [Section titled “State”](#state) Progress indicator for blocking operations. * **Type**: Float (0-100) * **Default**: 0 * **Use case**: Visual feedback for step completion progress (hidden for non-blocking steps) #### Step Active [Section titled “Step Active”](#step-active) Indicates if this step is currently executing. * **Type**: Boolean (read-only) * **Use case**: Runtime debugging and monitoring ## Container Components [Section titled “Container Components”](#container-components) ### Serial Container [Section titled “Serial Container”](#serial-container) Executes child LogicSteps in sequential order. #### Debug Mode [Section titled “Debug Mode”](#debug-mode) Enables detailed execution logging. * **Type**: Boolean * **Default**: false * **Use case**: Troubleshooting sequence execution #### Active Logic Step [Section titled “Active Logic Step”](#active-logic-step) Index of currently executing step. * **Type**: Integer (read-only) * **Use case**: Monitor current execution position #### Number Logic Steps [Section titled “Number Logic Steps”](#number-logic-steps) Total number of child steps. * **Type**: Integer (read-only) * **Use case**: Sequence overview and validation ### Parallel Container [Section titled “Parallel Container”](#parallel-container) Executes child LogicSteps simultaneously. #### Debug Mode [Section titled “Debug Mode”](#debug-mode-1) Enables detailed execution logging. * **Type**: Boolean * **Default**: false * **Use case**: Troubleshooting parallel execution ## Available LogicStep Types [Section titled “Available LogicStep Types”](#available-logicstep-types) ### Delay [Section titled “Delay”](#delay) Pauses execution for a specified duration. #### Duration [Section titled “Duration”](#duration) Time to wait in seconds. * **Type**: Float * **Default**: 1.0 * **Range**: 0.1 to 3600.0 * **Use case**: Timing delays in production sequences ![Delay LogicStep configuration](/doc/unity/assets/logicstep-delay.png) ### Drive To [Section titled “Drive To”](#drive-to) Moves a drive to a specific position and waits for completion. #### Drive [Section titled “Drive”](#drive) Target drive component to control. * **Type**: Drive reference * **Default**: None * **Use case**: Connect to the drive you want to position #### Destination [Section titled “Destination”](#destination) Target position in millimeters or degrees. * **Type**: Float * **Default**: 0 * **Use case**: Set absolute or relative target position #### Destination From PLC Output [Section titled “Destination From PLC Output”](#destination-from-plc-output) Alternative position source from PLC interface. * **Type**: PLCOutputFloat reference * **Default**: None * **Use case**: Dynamic positioning from external control systems #### Relative [Section titled “Relative”](#relative) Treats destination as offset from current position. * **Type**: Boolean * **Default**: false * **Use case**: Incremental movements relative to current position #### Live Edit [Section titled “Live Edit”](#live-edit) Enables real-time parameter adjustment during runtime. * **Type**: Boolean * **Default**: false * **Use case**: Runtime tuning and debugging ![Drive To LogicStep configuration](/doc/unity/assets/logicstep-driveto.png) ### Start Drive To [Section titled “Start Drive To”](#start-drive-to) Note Updated in realvirtual **6.3** with Relative movement support. Initiates drive movement **without waiting for completion** (non-blocking). Execution continues immediately to the next step while the drive moves in the background. This is useful when you want to start multiple drives simultaneously or continue with other logic while a drive is moving. To wait for the drive to finish, follow with a **Wait for Signal Bool** step monitoring the drive’s AtPosition signal. #### Drive [Section titled “Drive”](#drive-1) Target drive component to control. * **Type**: Drive reference * **Default**: None #### Destination [Section titled “Destination”](#destination-1) Target position in millimeters or degrees. * **Type**: Float * **Default**: 0 #### Direction [Section titled “Direction”](#direction) Movement direction. * **Type**: Enum (Automatic / Forward / Backward) * **Default**: Automatic #### Relative [Section titled “Relative”](#relative-1) Treats destination as offset from current position. * **Type**: Boolean * **Default**: false * **Use case**: Incremental movements relative to current position #### Live Edit [Section titled “Live Edit”](#live-edit-1) Enables real-time parameter adjustment during runtime. * **Type**: Boolean * **Default**: false **Usage pattern:** ```plaintext 1. Start Drive To (position 500, non-blocking) 2. Set Signal Bool (activate something while drive moves) 3. Wait for Signal Bool (drive AtPosition = true) ``` ![Start Drive To LogicStep configuration](/doc/unity/assets/logicstep-startdriveto.png) ### Start Drive Speed [Section titled “Start Drive Speed”](#start-drive-speed) Sets drive speed for continuous movement. #### Drive [Section titled “Drive”](#drive-2) Target drive component to control. * **Type**: Drive reference * **Default**: None * **Use case**: Connect to the drive you want to control #### Speed [Section titled “Speed”](#speed) Movement speed in mm/s or deg/s. * **Type**: Float * **Default**: 100 * **Range**: -1000 to 1000 * **Use case**: Positive for forward, negative for backward, zero to stop ![Start Drive Speed LogicStep configuration](/doc/unity/assets/logicstep-startdrivespeed.png) ### Wait for Drives at Target [Section titled “Wait for Drives at Target”](#wait-for-drives-at-target) Pauses execution until specified drives reach their target positions. #### Drives [Section titled “Drives”](#drives) List of drives to monitor. * **Type**: Drive array * **Default**: Empty * **Use case**: Synchronize multiple drive movements ![Wait for Drives at Target LogicStep configuration](/doc/unity/assets/logicstep-waitfordrivesattarget.png) ### Wait for Sensor [Section titled “Wait for Sensor”](#wait-for-sensor) Pauses execution until sensor reaches specified state. #### Sensor [Section titled “Sensor”](#sensor) Target sensor component to monitor. * **Type**: Sensor reference * **Default**: None * **Use case**: Connect to proximity, vision, or other sensor types #### Wait for Occupied [Section titled “Wait for Occupied”](#wait-for-occupied) Determines which sensor state triggers continuation. * **Type**: Boolean * **Default**: true * **Use case**: true waits for occupied, false waits for not occupied ![Wait for Sensor LogicStep configuration](/doc/unity/assets/logicstep-waitforsensor.png) ### Wait for Signal Bool [Section titled “Wait for Signal Bool”](#wait-for-signal-bool) Pauses execution until boolean signal reaches specified state. #### Signal [Section titled “Signal”](#signal) Target signal to monitor. * **Type**: Signal reference * **Default**: None * **Use case**: Connect to PLC or internal boolean signals #### Wait for True [Section titled “Wait for True”](#wait-for-true) Determines which signal state triggers continuation. * **Type**: Boolean * **Default**: true * **Use case**: true waits for signal true, false waits for signal false ### Set Signal Bool [Section titled “Set Signal Bool”](#set-signal-bool) Sets a boolean signal to true or false. #### Signal [Section titled “Signal”](#signal-1) Target signal to modify. * **Type**: Signal reference * **Default**: None * **Use case**: Control PLC outputs or internal flags #### Set to True [Section titled “Set to True”](#set-to-true) Value to assign to the signal. * **Type**: Boolean * **Default**: true * **Use case**: true sets signal high, false sets signal low ![Set Signal Bool LogicStep configuration](/doc/unity/assets/logicstep-setsignaltobool.png) ### Wait for Signal Float [Section titled “Wait for Signal Float”](#wait-for-signal-float) Note This feature was added in realvirtual **6.0.10** (Professional & Starter) Pauses execution until a float signal meets a specified condition. Supports five comparison operators with configurable tolerance for equality checks. Useful for waiting on analog values like temperatures, pressures, or position feedback. #### Signal [Section titled “Signal”](#signal-2) Target float signal to monitor. * **Type**: Signal reference * **Default**: None * **Use case**: Connect to any float-type signal (PLCOutputFloat, PLCInputFloat, etc.) #### Comparison [Section titled “Comparison”](#comparison) Comparison operator for evaluating the signal value against the target. * **Type**: ComparisonType (dropdown) * **Default**: GreaterOrEqual * **Options**: GreaterThan (>), LessThan (<), Equals (==), GreaterOrEqual (>=), LessOrEqual (<=) * **Use case**: Select the condition that must be met before proceeding #### Value [Section titled “Value”](#value) Target value to compare the signal against. * **Type**: Float * **Default**: 0 * **Use case**: Set the threshold or target value in signal units #### Tolerance [Section titled “Tolerance”](#tolerance) Tolerance for equality comparison to handle floating-point precision. * **Type**: Float * **Default**: 0.01 * **Minimum**: 0.0001 * **Use case**: Only applies when Comparison is set to Equals. A tolerance of 0.01 means values within ±0.01 of the target are considered equal ### Set Signal Float [Section titled “Set Signal Float”](#set-signal-float) Note This feature was added in realvirtual **6.0.10** (Professional & Starter) Sets a float signal to a specified value and immediately proceeds to the next step. This non-blocking step is commonly used for setting speed values, position targets, or analog control outputs. #### Signal [Section titled “Signal”](#signal-3) Target float signal to modify. * **Type**: Signal reference * **Default**: None * **Use case**: Connect to any float-type signal (PLCInputFloat, PLCOutputFloat, etc.) #### Value [Section titled “Value”](#value-1) Float value to assign to the signal. * **Type**: Float * **Default**: 0 * **Use case**: Set the desired value in signal units (e.g., speed in mm/s, temperature in °C) ### Jump on Signal [Section titled “Jump on Signal”](#jump-on-signal) Conditionally jumps to a named step based on signal state. #### Jump to Step [Section titled “Jump to Step”](#jump-to-step) Name of the target LogicStep to jump to. * **Type**: String * **Default**: Empty * **Use case**: Must match the Name property of target step exactly #### Signal [Section titled “Signal”](#signal-4) Signal to evaluate for jump condition. * **Type**: Signal reference * **Default**: None * **Use case**: Connect to boolean signal for conditional logic #### Jump On [Section titled “Jump On”](#jump-on) Signal state that triggers the jump. * **Type**: Boolean * **Default**: true * **Use case**: true jumps when signal is high, false jumps when signal is low ![Jump on Signal LogicStep configuration](/doc/unity/assets/logicstep-jumponsignal.png) ### Enable [Section titled “Enable”](#enable) Controls GameObject active state. #### GameObject [Section titled “GameObject”](#gameobject) Target GameObject to enable or disable. * **Type**: GameObject reference * **Default**: None * **Use case**: Show/hide objects or enable/disable components #### Enable [Section titled “Enable”](#enable-1) Desired active state for the GameObject. * **Type**: Boolean * **Default**: true * **Use case**: true activates GameObject, false deactivates it ### Cinemachine Camera [Section titled “Cinemachine Camera”](#cinemachine-camera) Controls virtual camera activation for scene visualization. #### Virtual Camera [Section titled “Virtual Camera”](#virtual-camera) Target Cinemachine virtual camera. * **Type**: CinemachineVirtualCamera reference * **Default**: None * **Use case**: Switch camera views during automation sequences ### Grip Pick [Section titled “Grip Pick”](#grip-pick) Note This step was added in realvirtual **6.3** (Professional). Triggers a [Grip](/doc/unity/components-and-scripts/picking-and-placing-mus/grip/) component to pick MUs. #### Grip [Section titled “Grip”](#grip) Target Grip component. * **Type**: Grip reference * **Default**: None #### Blocking [Section titled “Blocking”](#blocking) If `true`, waits up to 10 seconds for the MU to be successfully gripped before proceeding. * **Type**: Boolean * **Default**: false * **Use case**: Enable when subsequent steps depend on the MU being picked. Leave disabled when you just want to trigger the pick and continue. ### Grip Place [Section titled “Grip Place”](#grip-place) Note This step was added in realvirtual **6.3** (Professional). Triggers a [Grip](/doc/unity/components-and-scripts/picking-and-placing-mus/grip/) component to place (release) all currently held MUs. #### Grip [Section titled “Grip”](#grip-1) Target Grip component. * **Type**: Grip reference * **Default**: None #### Blocking [Section titled “Blocking”](#blocking-1) If `true`, waits up to 10 seconds for all MUs to be successfully placed before proceeding. * **Type**: Boolean * **Default**: false * **Use case**: Enable when subsequent steps depend on the MU being placed at its target. ### Set Active Only [Section titled “Set Active Only”](#set-active-only) Note This step was added in realvirtual **6.3** (Professional). Sets the **ActiveOnly** property on one or more realvirtualBehavior components. This non-blocking step allows you to enable or disable specific behaviors during a sequence without affecting other components. #### Behaviors [Section titled “Behaviors”](#behaviors) List of realvirtualBehavior components to modify. * **Type**: List of realvirtualBehavior references * **Default**: Empty #### Set To Always [Section titled “Set To Always”](#set-to-always) If `true`, sets ActiveOnly to Always (active). If `false`, sets it to Never (inactive). * **Type**: Boolean * **Default**: true * **Use case**: Temporarily disable drives or behaviors during a sequence phase ### Statistics LogicSteps [Section titled “Statistics LogicSteps”](#statistics-logicsteps) #### Stat Start Cycle [Section titled “Stat Start Cycle”](#stat-start-cycle) Marks the beginning of a production cycle for statistics. #### Stat End Cycle [Section titled “Stat End Cycle”](#stat-end-cycle) Marks the end of a production cycle for statistics. #### Stat State [Section titled “Stat State”](#stat-state) Records state information for performance analysis. #### Stat Output [Section titled “Stat Output”](#stat-output) Generates statistical output data. ## Usage Examples [Section titled “Usage Examples”](#usage-examples) ### Basic Sequence Setup [Section titled “Basic Sequence Setup”](#basic-sequence-setup) 1. Create an empty GameObject for your sequence 2. Add LogicStep components in desired execution order 3. Configure each step’s properties in the Inspector 4. Use **Name** property for steps referenced by jumps 5. Run the scene to execute the sequence ### Sequential Process Example [Section titled “Sequential Process Example”](#sequential-process-example) ```plaintext 1. Start Drive Speed (move conveyor forward) 2. Wait for Sensor (part detected) 3. Delay (settling time) 4. Drive To (position actuator) 5. Set Signal Bool (activate gripper) 6. Set Signal Float (set pressure to 5.0 bar) 7. Wait for Signal Float (wait until pressure >= 4.5 bar) 8. Drive To (return actuator) 9. Start Drive Speed (continue conveyor) ``` ### Parallel Execution [Section titled “Parallel Execution”](#parallel-execution) 1. Add **Parallel Container** component 2. Add child LogicSteps that should execute simultaneously 3. Each child step runs independently 4. Container completes when all children finish ### Conditional Logic [Section titled “Conditional Logic”](#conditional-logic) 1. Use **Jump on Signal** for branching logic 2. Set up signal monitoring for decision points 3. Create named target steps for jump destinations 4. Implement error handling with conditional jumps ## Editor Tools [Section titled “Editor Tools”](#editor-tools) ### Adding LogicSteps [Section titled “Adding LogicSteps”](#adding-logicsteps) * **Scene Menu**: Right-click when LogicStep component is attached * **Component Menu**: Component > realvirtual > Add Component > LogicStep * **Quick Access**: Overlay menu appears with all available steps ![LogicStep selection overlay](/doc/unity/assets/logicstep-overlay.png) ### Sequence Management [Section titled “Sequence Management”](#sequence-management) * **Drag and Drop**: Reorder components to change execution sequence * **Progress Bars**: Visual feedback for blocking operations * **Live Edit**: Runtime parameter adjustment for debugging * **Debug Mode**: Detailed logging for troubleshooting ![LogicSteps basic concepts](/doc/unity/assets/logicsteps-basics.png) ## Custom LogicStep Development [Section titled “Custom LogicStep Development”](#custom-logicstep-development) ### Creating Custom Steps [Section titled “Creating Custom Steps”](#creating-custom-steps) 1. Create new script in LogicSteps folder 2. Inherit from `LogicStep` base class 3. Implement required methods: * `NonBlocking()`: Return true for non-blocking steps * `OnStarted()`: Execute step logic 4. Call `NextStep()` when step completes ### Example Implementation [Section titled “Example Implementation”](#example-implementation) ```csharp public class LogicStep_StartDriveSpeed : LogicStep { public Drive drive; public float Speed; protected new bool NonBlocking() { return true; } protected override void OnStarted() { if (drive != null) { drive.TargetSpeed = Mathf.Abs(Speed); if (Speed > 0) { drive.JogForward = true; drive.JogBackward = false; } else if (Speed == 0) { drive.JogForward = false; drive.JogBackward = false; } else if (Speed < 0) { drive.JogForward = false; drive.JogBackward = true; } } NextStep(); } } ``` ### Base Class Methods [Section titled “Base Class Methods”](#base-class-methods) * `protected void NextStep()`: Advance to next step in sequence * `protected void NextStep(string stepName)`: Jump to named step * `public void StartStep()`: Initialize step execution * `protected void Start()`: Begin sequence at runtime ### Required Implementations [Section titled “Required Implementations”](#required-implementations) * `protected new bool NonBlocking()`: Define step execution type * `protected override void OnStarted()`: Implement step behavior > **💡 Hint**\ > Always call `NextStep()` when your custom step completes to ensure proper sequence flow. ## See Also [Section titled “See Also”](#see-also) * [Drive](/doc/unity/components-and-scripts/motion/drive/) - Motor control for LogicStep drive operations * [Sensor](/doc/unity/components-and-scripts/sensors/sensor/) - Sensor components for wait conditions * [Unity Visual Scripting](/doc/unity/components-and-scripts/defining-logic/unity-visual-scripting/) - Alternative visual programming approach * [Behavior Graph](/doc/unity/components-and-scripts/defining-logic/behavior-graph/) - Advanced logic definition system *** © 2025 realvirtual GmbH [https://realvirtual.io](https://realvirtual.io/) - All rights reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or by any means, including printing, saving, photocopying, recording, or other electronic or mechanical methods, without the prior written permission of the publisher. # Recorder The recorders capture drive positions and position/orientation of moveable units (MUs). This is helpful when these parameters are controlled by connected PLCs. Recording allows for playback of the sequence without PLC connection. For drive tracking, free navigation in the recording is possible, but for MUs, this feature will be added in a future release. ### Drives Recorder [Section titled “Drives Recorder”](#drives-recorder) The Drive Recorder is a feature that records the position of a drive during runtime in GameMode. To use the Drive Recorder, you need to attach the “DrivesRecorder” component to a GameObject. You can choose to record all drives in the hierarchy below the game object where you added the recorder component or all drives within the scene. In addition to the DrivesRecorder component, you need to create a ScriptableObject DrivesRecording. Right mouse click in the folder where your scene is located. The image below illustrates how to create the DrivesRecording object. ![](/doc/unity/assets/rvDrivesRecording.png) The DrivesRecorder provides the following attributes: ![](/doc/unity/assets/drivesRecorder.png) Attributes DrivesRecorder | Attribute | Function | | | ------------------------------------------------------- | --------------------------------------------------------------------------------- | - | | Drives Recording | Recording object which stores the record | | | Record all drives within the scene | boolean wether all drives in the scene should be recorded | | | Recording / Replaying | Information which mode is currently active | | | Replay Start Frame | Frame at which the replay starts | | | Replay End Frame | Frame at which the replay ends | | | Loop | loops the current replay | | | Record On Start | boolean: true -> record starts with the start of the game mode | | | Play On Start | boolean: true -> replay starts with the start of the game mode | | | Current Frame/ Number Frames/ Current Seconds/ Duration | Information about the current the current recording or replay | | | Jump To Position | jump to a certain frame | | | Replay End | subscribe an event which is called when the replay ends | | | Buttons | the buttons are used during runtime to start and stop the recording or the replay | | ### Mu Recorder [Section titled “Mu Recorder”](#mu-recorder) The MUrecorder is a tool that captures the location and orientation of MUs (Mobile Units) in a scene. It automatically starts recording when the runtime mode is initiated, and it captures MUs that are already present in the scene as well as those that are created by sources during runtime. Note The MUrecorder is in an initial development stage and is currently functional. Further development is planned to incorporate the same features as the DrivesRecorder in future releases. To utilize the MUrecorder, the MUrecording component must be added to all sources that require MUs to be recorded. Additionally, an instance of the scriptable object MUrecording must be created and assigned to the MUrecording component. The image below illustrates the process of creating the MUrecording in the project. [](/doc/unity/assets/rvAddRecorderDr.mp4) The MUrecorder provides the following attributes: ![](/doc/unity/assets/MUrecorder.png) | Attribute | Function | | | -------------------------- | ------------------------------------------ | - | | MUrecording | Recording object which stores the record | | | Record | boolean: true -> Recording is active | | | Replay | boolean: true -> Replay is active | | | Is Recording/ Is Replaying | Information which mode is currently active | | © 2025 realvirtual GmbH [https://realvirtual.io](https://realvirtual.io/) - All rights reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or by any means, including printing, saving, photocopying, recording, or other electronic or mechanical methods, without the prior written permission of the publisher. # Unity Scripting > Programming Unity with C# Unity Scripting is done with C# scripts. All realvirtual.io functionality is done based on C# Scripting. The possibilities are endless. As an editor you need to have a C# editor like Visual Studio or Rider installed. You can find a lot of information about C# and C# scripting on the Internet. For a full documentation of the Unity API please go to this page: 🔗 If you are already a programmer you might prefer to use C# scripts instead of the visual scripting approaches like [logicsteps.md](/doc/unity/components-and-scripts/defining-logic/logicsteps/ "mention"), [unity-visual-scripting.md](/doc/unity/components-and-scripts/defining-logic/unity-visual-scripting/ "mention") or [Broken link](/doc/unity/components-and-scripts/defining-logic/broken-reference/ "mention"). ## Installation of Visual Studio, Rider or another Scripting environment [Section titled “Installation of Visual Studio, Rider or another Scripting environment”](#installation-of-visual-studio-rider-or-another-scripting-environment) Before scripting in C# you need to install Visual Studio or Rider. Please check the documentation on the Unity website about installing Visual Studio: 🔗 Note Please make sure, that your scripting environment is linked as external tool like shown below: ![](/doc/unity/assets/VS-external-tools.png) ## Scripting realvirtual.io with C\# [Section titled “Scripting realvirtual.io with C# ”](#scripting-realvirtualio-with-c) Most important thing is, if you wan to use realvirtual.io classes and properties, to embed it by putting this using in front of your code (or alternatively put your code into the `using game4automation;` Here is a small example of a PLC like script for controlling a Drive based on a Sensor: ```csharp using realvirtual; using UnityEngine; //! PLC Script for the game4automation demo model public class PLC_CanConveyor : ControlLogic { public bool On = true; [Header("References")] public PLCOutputBool StartConveyor; public PLCInputBool SensorOccupied; public PLCInputBool ButtonConveyorOn; public PLCOutputBool LampCanAtPosition; // Call this when all Updates are done void FixedUpdate() { if (SensorOccupied.Value == false && On && ButtonConveyorOn.Value == true) { StartConveyor.Value = true; } else { StartConveyor.Value = false; } LampCanAtPosition.Value = SensorOccupied.Value; } } ``` # Unity Visual Scripting Caution Starting with Unity6 and realvirtual 6 we removed Visual Scripting. It is replaced by Unity Behavior Graph. Starting with realvirtual.io Professional 2021, we have added support for Unity Visual Scripting. You can find out more about Unity Visual Scripting here in the Unity documentation . Unity’s Visual Scripting is a visual approach to programming. You can even track the status of the script during simulation. However, compared to the realvirtual.io LogicSteps alternative and to Playmaker, Unity Visual Scritping is less “step chain” oriented. ![](/doc/unity/assets/unityvs_example.png) ## Installation[](#installation) [Section titled “Installation ”](#installation) Unity Visual Scripting is an optional package and must be installed via the Unity Package Manager. You can search for “Visual Scripting” and you will find the latest package. Press “Install” to install the package. ![](/doc/unity/assets/unityvs_packagemanager.png) After Unity Visual Scripting is installed you need to set the compiler define. Please go to “Edit > ProjectSettings > Player > Other Settings”. There you will find a section “Script Compilation - Scripting Define Symbols”. Please add there “REALVIRTUAL\_VISUALSCRIPTING” ![](/doc/unity/assets/unityvs_symbols.png) Now you will need to regenerate the visual scripting nodes by going to “Edit > ProjectSettings > VisualScripting”. Please select “Regenerate Nodes” ![](/doc/unity/assets/unityvs_regeneratenodes.png) After you regenerated the Nodes also the realvirtual.io Nodes are available and you can start using visual scripting. ## realvirtual.io nodes[](#realvirtual-io-nodes) [Section titled “realvirtual.io nodes ”](#realvirtualio-nodes) With a click of the right mouse button on the graph you can select game4Automation and add a realvirtual.io. Currently there are 5 special nodes. ![](/doc/unity/assets/unityvs_nodes.png) All nodes have an event entry port on the left side. This port must be connected to an event sender node in order for the node’s logic to execute. #### Drive Speed [Section titled “Drive Speed”](#drive-speed) This node sets the speed of the selected drive. The output event port is always executed once the input event port is set. ![](https://game4automation.com/documentation/current/images/unityvs_drivespeed.png) #### Drive State [Section titled “Drive State”](#drive-state) Drive State reads the status of the selected drive and passes it on to the output ports. ![](https://game4automation.com/documentation/current/images/unityvs_drivestate.png) #### Drive to Target [Section titled “Drive to Target”](#drive-to-target) Sets the drive to move to a specified destination when the start port receives an event. To be informed about the arrived status, you have to execute the update input event port continuously, e.g. by the Fixed Update event. ![](https://game4automation.com/documentation/current/images/unityvs_drivetotarget.png) #### PLC Output Bool [Section titled “PLC Output Bool”](#plc-output-bool) Reads or writes a bool signal. ![](https://game4automation.com/documentation/current/images/unityvs_plcbool.png) #### Sensor State [Section titled “Sensor State”](#sensor-state) Is reading the state of the sensor as soon as the Start port is getting an event. ![](https://game4automation.com/documentation/current/images/unityvs_sensorstate.png) ## Building your own nodes [Section titled “Building your own nodes”](#building-your-own-nodes) There are a variety of default unity nodes. Please refer to the Unity documentation for all the default nodes. You can also create your own nodes. The best start is to check the source code of the provided realvirtual.io nodes. © 2025 realvirtual GmbH [https://realvirtual.io](https://realvirtual.io/) - All rights reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or by any means, including printing, saving, photocopying, recording, or other electronic or mechanical methods, without the prior written permission of the publisher. # Realvirtual > (before 2022: Game4automation) ### Introduction[](#introduction) [Section titled “Introduction ”](#introduction) Every scene which is using realvirtual.io functions needs to include the *realvirtual.io* asset (before 2022 Game4automation) on the top hierarchy level of the scene. You need to keep the name and the location. If you create a new scene with the *realvirtual* menu, the *realvirtual.io a*sset is automatically included. You can also add the *realvirtual.io* asset by manually adding it to an existing scene: ![](/doc/unity/assets/rvaddRVobj.png) The *realvirtual.io* Asset includes the Realvirtual*Controller* (see below) as well as a standard scene navigation, standard lights, the Runtime UI as well as a base plate. ### realvirtual.io Controller[](#realvirtual-io-controller) [Section titled “realvirtual.io Controller ”](#realvirtualio-controller) The most important part of the *realvirtual.io* Asset is the RealvirtualController Script. This asset keeps the scene settings. Most realvirtual.io objects will call this controller or get some settings from it. This is, why the RealvirtualController is a must for all scenes with realvirtual.io functions. ![](/doc/unity/assets/realvirtual-controller.png) ## General Options[](#general-options) [Section titled “General Options ”](#general-options) **Connected** Setting for defining, if the simulation is starting in “Connected” mode. If true, this will set the global connecting status to connected (see also [Connection-Status](/doc/unity/basics/runtime-ui/#connection-status)). **Model Checker Enabled** Enables the model checking when simulation starts (see[ Model Checker](/doc/unity/basics/user-interface/model-checker/)) **Validate Before Start** Enables pre-play validation that checks for common configuration issues before starting the simulation. When enabled, realvirtual performs automatic validation of your scene setup and displays warnings in the console for issues that should be resolved before running the simulation. **Validation On Components Added** Enables validation checks when components are added to GameObjects during Editor mode. This provides immediate feedback when adding components that might have configuration conflicts. For complete documentation of the validation system, see [Pre-Play Validation](/doc/unity/components-and-scripts/game4automation/pre-play-validation/). **Stop Physics when Paused** Starting from release 2022.15, physics simulations do not stop when the simulation is paused in RuntimeUI. This allows you to continue navigating the scene with the mouse even while the simulation is paused. However, if you need to fully stop the simulation, including all physics calculations, you can enable the “Stop Physics When Paused” option. This will ensure that both the simulation and physics are completely paused. **Scale** Defines how many millimeters fits into one Unity Unit. If, as usual, one Unity unit is considered as one Meter, the Scale should be set to 1000. The Scale is used for all input fields of Behavior components whith distance or length properties. Note As a standard in all Behavior components the values for distances and lengths are always considered as Millimeters. **Speed Override** Overrides the speed of all drives. You can slow down or speed up all drives in the scene by selecting another value for the speed override. A value of two means doubled speed. Note Please consider, that this value also influences the physical behavior of the model. For example if a Value of 10 is selected the bottles in the demo model will tumble around. **Time Scale** Speeds up the simulation. This also speeds up the physics so that the simulation is just running faster but internally in the calculations running in real time. Note If the time scale is to hight it might happen that sensors are not getting active any more because the products are passing to fast the sensors. **Hide Groups** Hides the defined Groups when the simulation is started. Groups can be defined manually by adding the Group component to any gameobject or - in a more comfortable way - by using the [Selection Window](/doc/unity/basics/selection-window/) (This is only available in Professional Version). **Restart** In certain scenarios, such as fairs or demonstration models, you may need the simulation to automatically start and stop after a specific duration. By enabling the restart function, you can set a predefined time interval for the scene to restart. This ensures that your simulation runs continuously without manual intervention, making it ideal for presentations or automated demos. **Additive Scene Loading** Caution **Deprecated since realvirtual 6.3.4.** Additive scene loading is no longer the recommended approach for structuring larger models. We recommend composing your model from **prefabs** within a single **master scene** instead. Additive scene loading remains available for backward compatibility but may be removed in a future release. With realvirtual.io 2021.06, we have added support for additive scene loading. With additive scene loading, multiple individual scenes can form an entire model. More about the basics of additive scenes is described here in the Unity documentatio(). When using additive scene loading, the Game4automationController is automatically disabled in the additive scenes. All [MUs](/doc/unity/components-and-scripts/mu-movable-unit/) created by [Soruces](/doc/unity/components-and-scripts/mu-movable-unit/source/) are automatically created within the main scene. Within AdditiveScenes the path (Assets/….) can be defined within the Unity project to all scenes that should be loaded additively. It can be defined separately whether the scene should only be loaded in Edit Mode or also in Play Mode. ## UI Options [Section titled “UI Options”](#ui-options) **Hierarchy Update Cycle** Cylcle for updating the icons and signal values in the hierarchy view during runtime. **Scale Handles** The scale size of the realvirtuil.io Gizmos. **Standard Source** The standard Source that should be inserted into the model when Hotkey Source (Ins) is pressed. **Editor Gizmo Settings** The color settings for Editor Tools like[ Kinematic Tool.](/doc/unity/basics/user-interface/kinematic-tool-pro/) **UI Enabled On Start** Enables and disables the full UI on simulation start (runtime inspector and runtime menu bar). **Runtime Inspector Enabled** Enables and disables the runtime inspector. **Object Selection Enabled** Enables the object selection and highlighning of components in the scene. See also [RuntimeUI](/doc/unity/basics/runtime-ui/). **Hide Info Box** Hides the info box at simulation start. **Runtime Application UI** A pointer to the Application UI (menu, runtime inspector and so on). **Runtime Automation UI** A pointer to the Automation UI (the buttons and lights which are controlling the automation) ## Skin Controller [Section titled “Skin Controller”](#skin-controller) The `Skin Controller` is a component of the realvirtual prefab that configures the UI settings for realvirtual. ![](/doc/unity/assets/skincontroller.png) The Skin Controller customizes button and window colors, font size, and font color. It includes two predefined settings. To create a custom definition, right-click in the project panel and select **Create > realvirtual > Create realvirtual UI Skin**.\ Within the Skin definition are several sections. Relevant for the basic in realvirtual are the marked areas in the picture below. ![](/doc/unity/assets/realvirtualUISKin.png) ## Visual Settings (deprecated) [Section titled “Visual Settings (deprecated)”](#visual-settings-deprecated) Note In realvirtual.io Version 6, the management of visual settings has been updated, particularly with the new [EnvironmentController ](/doc/unity/components-and-scripts/game4automation/environment-controller/)component. The [EnvironmentControlle](/doc/unity/components-and-scripts/game4automation/environment-controller/)r is responsible for configuring environmental aspects such as lighting, skyboxes, and ambient settings within your digital twin projects.\\ **Enable Visual Settings** If set to false the realvirtual.io controller will not change anything from its own on lightning, camera and so on so all settings below will not be applied. **Standard Base Plate And Lights** You can turn of with this the standard base plate and the lights which are included in the *game4automation* Asset. **Base Plate Dimensions** The dimensions of the base plate in meters. **Sun Light intensity** Sets the intensity of all sun lights (which are all lights market with the tag *g4a sun*) **First Light intensity** Sets the intensity of all first lights (which are all lights market with the tag *g4a firstlight*).\ This lights are usually used for the light which is lightning the scene like the big light in a building. **Second Light intensity** Sets the intensity of all second lights (which are all lights market with the tag *g4a secondlight*)\ This lights are usually used mainly for decoration purposes, like small spot lights in a building. **Quality Level** Sets the overall visual quality. This has impact on the render performance and screen update rate. Ultra is the best. Unity is very good performing so Ultra is OK for most use cases. In lower settings for example shadows and reflections are turned off. **Hierarchy Icons** Settings for the Hierarchy Icons and annotations in the Hierarchy view **Hotkeys** Hotkey settings. © 2025 realvirtual GmbH [https://realvirtual.io](https://realvirtual.io/) - All rights reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or by any means, including printing, saving, photocopying, recording, or other electronic or mechanical methods, without the prior written permission of the publisher. # Environment Controller Starting from **realvirtual.io Version 6**, the EnvironmentController leverages Unity’s **Universal Rendering Pipeline (URP)** to provide enhanced visual fidelity and customization options. You can find the **EnvironmentController** in **Tools > realvirtual > Environments** as part of the **realvirtual Prefab** in your scene. *** ### Overview [Section titled “Overview”](#overview) The EnvironmentController provides three preset visual modes: * **Default**: A balanced environment for general use. * **Dark**: Suitable for low-light or nighttime scenarios. * **White**: Ideal for bright, minimalistic environments. The component allows adjustments to floor size, fade effects, and toggling advanced features with straightforward controls. ![](/doc/unity/assets/environment-defaultmode.png) Environment - Default Mode ![](/doc/unity/assets/environment-darkmode.png) Environment - Dark Mode ![](/doc/unity/assets/environment-whitemode.png) Environment - White Mode *** ### Runtime Lighting (No Baking Required) [Section titled “Runtime Lighting (No Baking Required)”](#runtime-lighting-no-baking-required) Note Improved in realvirtual **6.3.4** (Starter & Professional) The EnvironmentController computes the **skybox ambient light and environment reflection live at runtime** (using `DynamicGI.UpdateEnvironment`). This runs once when the scene starts, in both Edit and Play mode, so your scenes are correctly lit **without baking lighting**. The cost is a one-time calculation at scene start with no per-frame impact. Because the ambient and reflection are generated from the skybox at runtime, the per-scene **baked lighting folder** Unity otherwise stores next to a scene (with `LightingData.asset`, `ReflectionProbe-*.exr` and lightmaps) is **no longer required** for skybox-lit scenes. Removing it slims down your project and stops these binary files from reappearing as changes in version control after every bake. #### Removing baked lighting folders [Section titled “Removing baked lighting folders”](#removing-baked-lighting-folders) Use **Tools > realvirtual > Settings > Remove Baked Lighting Folders…** to clean up the active scene or your whole project. The tool disables Baked Global Illumination on each scene, clears the scene’s Lighting Data reference, and deletes the per-scene baked lighting folder. You choose the scope in the confirmation dialog: **Active scene only** or **All scenes**. Caution This permanently deletes baked lighting data and cannot be undone except through version control. **Commit or back up your project first.** Scenes that rely on **real baked lightmaps** (baked shadows / ambient occlusion) will look different afterwards — only skybox-lit scenes are visually identical. *** ### Properties [Section titled “Properties”](#properties) **Mode** * Dropdown to select the desired environment mode: `Default`, `Dark`, or `White`. When **Advanced Mode** is enabled: * A hidden Skybox is activated, creating a more immersive environment by enhancing lighting and shadows. * A sphere is added to hide the skybox and to show a uni-color background. ![](/doc/unity/assets/environment-nonadvanced.png) Environment - Advanced Mode deactivated ![](/doc/unity/assets/environment-advanced.png) Environment - Advanced Mode activated #### Floor [Section titled “Floor”](#floor) * **Size**: * Numeric input to specify the floor size in Meter. * **Fade**: * Checkbox to enable or disable the fading effect on the floor. *** ### Customizing the Environment [Section titled “Customizing the Environment”](#customizing-the-environment) The recommended way to customize the Environment Controller is by **overwriting the values of the real irtual prefab** in your scene. This approach ensures that your changes are scene-specific while maintaining compatibility with the RealVirtual framework. #### Prefab Structure [Section titled “Prefab Structure”](#prefab-structure) Each visual setup is organized as a **sub-gameobject** within the prefab. These sub-gameobjects are activated dynamically based on the current **visual mode setting**. The three primary modes included are: * **Dark Mode** * **Default Mode** * **White Mode** Each mode contains the following key components: **1. Sun** * Represents the primary directional light source for the scene. * Customize the **intensity, color, and angle** of the light for desired effects. **2. Floor** * Defines the material and rendering properties for the ground plane. * Update the floor’s texture, material properties, or color to match your scene’s aesthetics. **3. Sky** * Manages the skybox or atmospheric effects. * Customize the sky material to change the overall ambiance of the environment. #### Effects and Post-Processing [Section titled “Effects and Post-Processing”](#effects-and-post-processing) Under the **Effects** section of each sub-gameobject, you will find settings related to **post-processing**. These can be tailored to adjust the mood, tone, and visual clarity of the scene. Common properties include: * **Bloom**: Adjust intensity and threshold for glow effects. * **Color Grading**: Modify contrast, saturation, and color tones. * **Ambient Occlusion**: Enhance shadow details for better depth perception. * **Motion Blur**: Add a sense of motion for dynamic scenes. * **Vignette**: Focus viewer attention by darkening edges. ![](/doc/unity/assets/environmentcontroller-effects.png) # Pre-Play Validation The Pre-Play Validation system automatically detects and resolves common configuration issues before simulation startup, reducing debugging time and ensuring reliable automation system behavior. ## Overview [Section titled “Overview”](#overview) Pre-Play Validation proactively identifies potential problems in your scene configuration and either automatically fixes them or provides clear guidance for resolution. This validation system catches issues early in the development process, preventing runtime failures and unexpected behavior during virtual commissioning. Key benefits include: * **Automated Problem Detection**: Identifies configuration conflicts before they cause runtime issues * **Intelligent Auto-Fixes**: Automatically resolves common problems like conflicting component settings * **Clear Diagnostic Messages**: Provides specific, actionable feedback for manual fixes * **Development Workflow Integration**: Runs seamlessly during normal development activities * **Reduced Debugging Time**: Catches issues before they become complex runtime problems > **💡 Hint** Enable validation early in your project development to establish good configuration practices and catch issues as they develop rather than during final testing. ![](/doc/unity/assets/preplay-validation-settings.png) Enable Pre-Play Validation in RealvirtualController settings ## Quick Start [Section titled “Quick Start”](#quick-start) ### Enable Validation (1 minute) [Section titled “Enable Validation (1 minute)”](#enable-validation-1-minute) 1. **Locate RealvirtualController** in your scene (usually on a “Controller” GameObject) 2. **Check Validation Settings** in the Inspector: * **Validate Before Start**: ✅ Enable for pre-simulation checks * **Validation On Components Added**: ✅ Enable for real-time component validation 3. **Test the System**: Start Play mode and check Unity Console for validation messages ### Understanding Validation Output [Section titled “Understanding Validation Output”](#understanding-validation-output) Validation messages appear in Unity Console with this format: ```plaintext [Validation] RuleName: Description of issue and action taken Context: GameObject "ObjectName" → Component type ``` ## Configuration Options [Section titled “Configuration Options”](#configuration-options) ### RealvirtualController Settings [Section titled “RealvirtualController Settings”](#realvirtualcontroller-settings) **Validate Before Start** Runs comprehensive scene validation when entering Play mode. * **Type**: Boolean * **Default**: true * **Use case**: Catch configuration issues before simulation starts * **Performance**: Minimal impact on startup time **Validation On Components Added** Validates components immediately when added in Editor mode. * **Type**: Boolean * **Default**: true * **Use case**: Prevent invalid configurations during scene building * **Performance**: Real-time validation with no runtime impact ### Development Workflow Integration [Section titled “Development Workflow Integration”](#development-workflow-integration) **Recommended Settings for Different Phases**: **Early Development**: Both validations enabled * Helps establish proper configuration patterns * Catches issues as components are added **Production/Testing**: Pre-play validation enabled, component validation optional * Ensures scene integrity before critical testing * Reduces validation interruptions during rapid development **Final Release**: Validation can be disabled for performance * Remove validation overhead in final builds * All configuration issues should be resolved by this stage ![](/doc/unity/assets/preplay-validation-console.png) Validation warnings displayed in Unity Console Note **Best Practice**: Keep both validations enabled during development. The system is designed to be non-intrusive while providing valuable feedback for scene configuration quality. ## Validation Rules Reference [Section titled “Validation Rules Reference”](#validation-rules-reference) The validation system includes specialized rules that target common configuration problems in industrial automation setups. ### Control System Validation [Section titled “Control System Validation”](#control-system-validation) #### BehaviorInterface Jogging Conflict Resolution [Section titled “BehaviorInterface Jogging Conflict Resolution”](#behaviorinterface-jogging-conflict-resolution) **Problem Detected**: Drive components with both BehaviorInterface control and manual jogging enabled **Why This Matters**: * BehaviorInterface components provide programmatic drive control for automation sequences * Manual jogging controls (JogForward/JogBackward) are intended for manual testing and debugging * Having both active creates conflicting control signals and unpredictable behavior **Automatic Resolution**: * Disables `JogForward` and `JogBackward` properties on affected Drive components * Preserves BehaviorInterface control for proper automation operation * Maintains drive functionality while eliminating control conflicts **Example Scenario**: ```plaintext Conveyor System with BehaviorInterfaceConveyor component: ✅ Before: Drive has jogging enabled + active BehaviorInterface ❌ Problem: Conflicting control signals cause erratic movement ✅ After: Jogging disabled, BehaviorInterface maintains full control ``` **Console Message**: ```plaintext [Validation] BehaviorInterfaceJoggingRule: Disabled jogging on Drive. Active BehaviorInterface will control drive position and conflicts with manual jogging. Context: GameObject "ConveyorDrive" → Drive component ``` #### Multiple BehaviorInterface Prevention [Section titled “Multiple BehaviorInterface Prevention”](#multiple-behaviorinterface-prevention) **Problem Detected**: GameObjects with multiple active BehaviorInterface components **Why This Matters**: * Each GameObject should have only one active control interface * Multiple interfaces create ambiguous control authority * Can cause timing conflicts and synchronization issues **Automatic Resolution**: * Keeps the first active BehaviorInterface component * Disables additional BehaviorInterface components * Preserves the primary control interface functionality **Example Scenario**: ```plaintext Robot Arm with multiple control interfaces: ✅ Before: BehaviorInterfaceRobot + BehaviorInterfaceSequence both active ❌ Problem: Conflicting position commands from two controllers ✅ After: Primary interface remains active, secondary disabled ``` ### Motion System Validation [Section titled “Motion System Validation”](#motion-system-validation) #### Single Drive Component Enforcement [Section titled “Single Drive Component Enforcement”](#single-drive-component-enforcement) **Problem Detected**: Multiple Drive components on the same GameObject **Why This Matters**: * Unity GameObjects support only one primary motion controller * Multiple Drive components create conflicting transform updates * Can cause jittery movement, position fighting, or complete motion failure **Immediate Resolution**: * Removes duplicate Drive components as soon as they’re added * Preserves the original Drive component configuration * Triggers immediately during component addition (not just pre-play) **Prevention Strategy**: ```plaintext Hierarchy Design: ✅ Correct: One Drive per GameObject ├── ConveyorSystem (Drive component) ├── RobotArm (Drive component) └── ElevatorPlatform (Drive component) ❌ Incorrect: Multiple Drives on same GameObject ├── ComplexMachine (Drive + Drive) ← Second Drive removed ``` #### Transport Surface Hierarchy Validation [Section titled “Transport Surface Hierarchy Validation”](#transport-surface-hierarchy-validation) **Problem Detected**: Improper Drive-TransportSurface hierarchy configurations **Critical Physics Requirements**: * TransportSurface components need Drive control for proper operation * Unity physics constraints prevent certain Drive-TransportSurface arrangements * Missing Drive references cause non-functional conveyor systems **Validation Logic**: **✅ Valid Configurations**: * TransportSurface with explicit DriveReference assigned * TransportSurface with exactly one Drive in parent hierarchy * TransportSurface as child of Drive GameObject **❌ Invalid Configurations**: * TransportSurface without Drive and no DriveReference * TransportSurface with multiple Drives above it in hierarchy * Drive component positioned above TransportSurface violating physics **Practical Examples**: ```plaintext ✅ Correct Hierarchy 1: Direct Reference Conveyor ├── Belt (TransportSurface + DriveReference to Drive) └── Motor (Drive component) ✅ Correct Hierarchy 2: Parent-Child Relationship ConveyorSystem (Drive component) └── Belt (TransportSurface component) ❌ Problematic Hierarchy: Missing Drive Control Conveyor └── Belt (TransportSurface only) ← No drive control ❌ Physics Violation: Drive Above TransportSurface FactoryFloor (Drive component) └── ConveyorSection (TransportSurface) ← Physics conflict ``` **Console Messages**: ```plaintext [Validation] TransportSurfaceDriveHierarchyRule: TransportSurface requires a Drive component in the hierarchy to function properly. Please add a Drive component or assign DriveReference. Context: GameObject "ConveyorBelt" → TransportSurface component ``` ## Validation Triggers [Section titled “Validation Triggers”](#validation-triggers) ### Pre-Play Validation [Section titled “Pre-Play Validation”](#pre-play-validation) Automatically runs when entering Play mode (if enabled): * **BehaviorInterface Jogging Conflicts**: Drive components with conflicting control methods * **Multiple BehaviorInterface Detection**: GameObjects with multiple active interfaces * **TransportSurface Hierarchy**: Drive-TransportSurface relationship validation ### Component Addition Validation [Section titled “Component Addition Validation”](#component-addition-validation) Runs immediately when components are added in Editor: * **Multiple Drive Prevention**: Blocks duplicate Drive components on same GameObject ## Practical Usage Examples [Section titled “Practical Usage Examples”](#practical-usage-examples) ### Common Development Scenarios [Section titled “Common Development Scenarios”](#common-development-scenarios) #### Scenario 1: Building a Conveyor System [Section titled “Scenario 1: Building a Conveyor System”](#scenario-1-building-a-conveyor-system) **Step-by-step with Validation Feedback**: 1. **Create Conveyor GameObject**: ```plaintext Hierarchy: ConveyorSystem ``` 2. **Add Drive Component**: ```plaintext ✓ Drive added successfully ``` 3. **Add Second Drive (Mistake)**: ```plaintext ⚠ [Validation] PreventMultipleDrivesRule: Only one Drive component allowed per GameObject. Removing duplicate Drive component. ✓ System prevents configuration error ``` 4. **Add TransportSurface**: ```plaintext ConveyorSystem (Drive) └── Belt (TransportSurface) ✓ Hierarchy validated - proper Drive-TransportSurface relationship ``` #### Scenario 2: Robot Arm with Automation Control [Section titled “Scenario 2: Robot Arm with Automation Control”](#scenario-2-robot-arm-with-automation-control) **Development Progression**: 1. **Initial Setup**: ```plaintext RobotArm (Drive + manual jogging enabled) ✓ Manual testing configuration ``` 2. **Add Automation Control**: ```plaintext RobotArm (Drive + BehaviorInterfaceRobot + jogging enabled) ⚠ [Validation] BehaviorInterfaceJoggingRule: Disabled jogging on Drive. Active BehaviorInterface will control drive position. ✓ System resolves control conflict automatically ``` 3. **Final Configuration**: ```plaintext RobotArm (Drive + BehaviorInterfaceRobot) ✓ Ready for automated operation ``` ### Manual Validation Control [Section titled “Manual Validation Control”](#manual-validation-control) #### Runtime Control [Section titled “Runtime Control”](#runtime-control) ```csharp // Dynamic validation control during development public class ValidationController : MonoBehaviour { public RealvirtualController realvirtualController; public void EnableValidation() { realvirtualController.ValidateBeforeStart = true; Debug.Log("Validation enabled for next Play mode start"); } public void DisableValidationTemporarily() { realvirtualController.ValidateBeforeStart = false; Debug.Log("Validation temporarily disabled"); } public void RunManualValidation() { if (realvirtualController != null) { realvirtualController.RunValidation(); } } } ``` #### Editor Integration [Section titled “Editor Integration”](#editor-integration) ```csharp // Custom editor integration for validation [CustomEditor(typeof(RealvirtualController))] public class RealvirtualControllerEditor : Editor { public override void OnInspectorGUI() { DrawDefaultInspector(); EditorGUILayout.Space(); EditorGUILayout.LabelField("Validation Tools", EditorStyles.boldLabel); if (GUILayout.Button("Run Validation Now")) { ((RealvirtualController)target).RunValidation(); } if (GUILayout.Button("Reset Validation Settings")) { ((RealvirtualController)target).ValidateBeforeStart = true; ((RealvirtualController)target).ValidationOnComponentsAdded = true; } } } ``` ### Custom Validation Rules [Section titled “Custom Validation Rules”](#custom-validation-rules) #### Extending the Validation System [Section titled “Extending the Validation System”](#extending-the-validation-system) The validation system supports custom rules for project-specific requirements: ```csharp // Custom validation rule example public class CustomComponentValidationRule : PrePlayRule { public override string RuleName => "CustomComponentValidationRule"; protected override bool IsValid(CustomComponent component) { // Custom validation logic return component.RequiredReference != null; } protected override void FixComponent(CustomComponent component) { // Automatic fix if possible if (component.RequiredReference == null) { component.RequiredReference = component.GetComponent(); } } protected override string GetWarningMessage(CustomComponent component) { return "CustomComponent requires a valid reference for proper operation."; } } ``` ## Troubleshooting [Section titled “Troubleshooting”](#troubleshooting) ### Validation Not Running [Section titled “Validation Not Running”](#validation-not-running) **Symptoms**: No validation messages appear in Unity Console when starting Play mode or adding components **Diagnostic Steps**: 1. **Verify RealvirtualController Configuration**: ```csharp // Check controller setup var controller = FindObjectOfType(); if (controller == null) { Debug.LogError("RealvirtualController not found in scene"); } else { Debug.Log($"Validation enabled: {controller.ValidateBeforeStart}"); } ``` 2. **Check Console Filter Settings**: * Ensure Unity Console shows “Info” level messages * Look for “\[Validation]” prefix in console messages * Check Console collapse setting doesn’t hide validation messages 3. **Verify Component Targets**: * Validation only runs on components with active validation rules * Test with known validation scenarios (add second Drive component) **Common Solutions**: * Enable “Validate Before Start” in RealvirtualController Inspector * Ensure RealvirtualController GameObject is active in scene * Check that validation target components exist in scene ### Understanding Validation Messages [Section titled “Understanding Validation Messages”](#understanding-validation-messages) **Message Format Analysis**: ```plaintext [Validation] RuleName: Action taken and reason Context: GameObject "Name" → Component Type ``` **Example Interpretation**: ```plaintext [Validation] BehaviorInterfaceJoggingRule: Disabled jogging on Drive. Active BehaviorInterface will control drive position and conflicts with manual jogging. Context: GameObject "ConveyorDrive" → Drive component Translation: - Rule: BehaviorInterface jogging conflict detection - Action: Automatically disabled jogging properties - Reason: Prevent control conflicts - Location: ConveyorDrive GameObject's Drive component ``` ### Validation Conflicts and False Positives [Section titled “Validation Conflicts and False Positives”](#validation-conflicts-and-false-positives) **When Validation Seems Wrong**: 1. **Understand the Rule Logic**: * Review rule documentation to understand why it triggered * Consider if your configuration follows realvirtual best practices * Check if special use case requires different approach 2. **Legitimate Special Cases**: ```csharp // Temporary validation disable for special configurations public class SpecialCaseController : MonoBehaviour { void Start() { var controller = FindObjectOfType(); if (controller != null) { // Disable for specific scenario controller.ValidateBeforeStart = false; Debug.Log("Validation disabled for special case scenario"); } } } ``` 3. **Configuration Review**: * Verify component hierarchy matches realvirtual patterns * Check component references and dependencies * Consider refactoring to standard configurations ### Performance and Integration Issues [Section titled “Performance and Integration Issues”](#performance-and-integration-issues) **Editor Performance Impact**: **Symptoms**: Noticeable delays when adding components or starting Play mode **Optimization Approaches**: * Disable component addition validation during rapid prototyping * Use pre-play validation only for final testing phases * Consider scene complexity and number of validation targets **Multi-Scene Validation Issues**: **Symptoms**: Validation inconsistencies across different scenes **Solutions**: * Ensure each scene has its own RealvirtualController * Validate scene-specific component configurations * Use prefabs for consistent validation setups across scenes ## See Also [Section titled “See Also”](#see-also) * [RealvirtualController](/doc/unity/components-and-scripts/basics/realvirtual-controller/) - Main controller component configuration * [Drive Component](/doc/unity/components-and-scripts/motion/drive/) - Core motion component affected by validation * [BehaviorInterface](/doc/unity/components-and-scripts/behavior-interfaces/) - Automation control components * [TransportSurface](/doc/unity/components-and-scripts/motion/transportsurface/) - Conveyor system components * [Development Best Practices](/doc/unity/components-and-scripts/advanced-topics/best-practices/) - Scene configuration guidelines *** © 2025 realvirtual GmbH [https://realvirtual.io](https://realvirtual.io/) - All rights reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or by any means, including printing, saving, photocopying, recording, or other electronic or mechanical methods, without the prior written permission of the publisher. # Interfaces > Connecting realvirtual.io with external controllers ### Overview [Section titled “Overview”](#overview) Automation Interfaces handle the communication between real or virtual automation controllers and realvirtual.io. For each type of communication, a special interface is required. The interfaces currently available are for [Siemens S7 ](/doc/unity/components-and-scripts/interfaces/s7-tcp/)(S7-300,400,1200,1500,Sinumerik, Simotion), [TwinCAT](/doc/unity/components-and-scripts/interfaces/twincat/), [TwinCATHMI](/doc/unity/components-and-scripts/interfaces/twincat-hmi/), [Simit](/doc/unity/components-and-scripts/interfaces/simit-shared-memory/), [PLCSim-Advanced ](/doc/unity/components-and-scripts/interfaces/plcsim-advanced/)(the virtual Siemens S7 1500 PLC), [RobotDK](/doc/unity/components-and-scripts/interfaces/robodk/), [MQTT](/doc/unity/components-and-scripts/interfaces/mqtt/), [Modbus ](/doc/unity/components-and-scripts/interfaces/modbus/)Server, [Simulink](/doc/unity/components-and-scripts/interfaces/simulink/), [FMI](/doc/unity/components-and-scripts/interfaces/fmi/), [ABB RobotStudio,](/doc/unity/components-and-scripts/interfaces/abb-robotstudio/) [UniversalRobots](/doc/unity/components-and-scripts/interfaces/universal-robots/), [EthernetIP](/doc/unity/components-and-scripts/interfaces/ethernetip/), [MQTT ](/doc/unity/components-and-scripts/interfaces/mqtt/)and[ OPCUA](/doc/unity/components-and-scripts/interfaces/opcua/). New interfaces are continously added. All interfaces are using standard PLCInput and PLCOutput objects (like PLCInputFloat or PLCOutputBool) for storing signal values. The Interface itself handles the real-time values of the signals. Some interfaces provide the ability to import all signals automatically and to create the suitable PLCInput or PLCOutput objects in the realvirtual.io hierarchy automatically. Sometimes the signals can be imported by communication with the controller itself, or sometimes a signal list used for programming the automation controller can be exported and used. Imported signals can be automatically connected to realvirtual.io signal objects by the ([SignalManager](/doc/unity/components-and-scripts/interfaces/signal-manager/)). ![](/doc/unity/assets/interfaces-structure.png) Interfae, Signals and Behavior Models The Signals are connected to the input and output properties of the[ Behavior Models](/doc/unity/components-and-scripts/motion/drive-behavior/). This Youtube tutorial explains the relation between Signals and Behavior Models: [Video](https://www.youtube-nocookie.com/embed/sCKEi-6EKYQ) ### Understanding Signal Direction [Section titled “Understanding Signal Direction”](#understanding-signal-direction) Caution **Signal Direction Can Be Confusing** realvirtual signal naming follows Unity’s perspective as the simulated plant, which is opposite to PLC controller perspective. Unity simulates field devices (sensors and actuators), not the PLC itself. #### Core Concept [Section titled “Core Concept”](#core-concept) Unity takes the role of the physical equipment, not the controller: * **PLCInput** = Unity writes data to the controller (simulates sensors sending data) * **PLCOutput** = Unity reads commands from the controller (simulates actuators receiving commands) #### Signal Mapping [Section titled “Signal Mapping”](#signal-mapping) | Unity’s Role | Data Flow | Use This Signal Type | | ----------------------- | ------------------ | -------------------- | | Simulate a sensor | Unity → Controller | **PLCInput** | | Simulate a button press | Unity → Controller | **PLCInput** | | Simulate a motor | Controller → Unity | **PLCOutput** | | Simulate a valve | Controller → Unity | **PLCOutput** | #### Naming Best Practice [Section titled “Naming Best Practice”](#naming-best-practice) Use clear directional naming in your controller programs to avoid confusion (e.g., `FromField.SensorValue` and `ToField.MotorSpeed` or `Sensors.BoxDetected` and `Actuators.ConveyorRun`). ### Signal Types [Section titled “Signal Types”](#signal-types) The following Signal types are supported by all Interfaces. In most cases the PLC itself can support more data types. For example Signed Int and Unsigned Int, are all transferred to the corresponding base type in realvirtual.io. | Signal Type | Description | | -------------- | -------------------------------------------------------------------------------------------- | | PLCInputBool | A PLC Input which is a boolean value (true/false) | | PLCInputInt | A PLC Input which is an integer value (can be also a Byte, UInt, SInt … on the PLC-Side) | | PLCInputFloat | A PLC Input which is a float value (can be also double, single on the PLC-Side) | | PLCInputText | A text (string) PLC Input. This datatype is only supported by TwinCATADS and MQTT interface | | PLCOutputBool | A PLC Output which is a boolean value (true/false) | | PLCOutputInt | A PLC Output which is an integer value (can be also a Byte, UInt, SInt … on the PLC-Side) | | PLCOutputFloat | A PLC Output which is an integer value (can be also a Byte, UInt, SInt … on the PLC-Side) | | PLCOutputText | A text (string) PLC Output. This datatype is only supported by TwinCATADS and MQTT interface | ### Check Signal status and connections to Behavior models [Section titled “Check Signal status and connections to Behavior models”](#check-signal-status-and-connections-to-behavior-models) You can check all signals in the Hierarchy view of your model: ![](/doc/unity/assets/interface-signalstatus.png) PLCInputs are shown in red and PLCOutputs are shown in green. All signals which have not been connected to realvirtual.io behavior models (this means all signals, which are currently not controlling the model or are not getting any information from the model) are shown in brackets. It is possible to check on the Signal component itself the connected Behavior models in the section *Signal Connection Info*: ![](/doc/unity/assets/interface-signalinfo.png) ### Forcing (overriding) signals [Section titled “Forcing (overriding) signals”](#forcing-overriding-signals) Signals can be forced to a certain value. By doing this, all connected components receive the forced value and not the value of the current input or output. Signals can be forced by setting *Settings>Override* in the Signal to true. The value is now defined by the Value you define in *Value Override*. Forced signals are always displayed in italic letters. ![](/doc/unity/assets/interface-forcing.png) For boolean values you can force them just by clicking on the value. This will force the value and toggle between true and false. For unforcing the value back again you need to click on the exclamation mark. Note To force **multiple signals together** as reusable, switchable scenarios — and to see every forced signal in the scene at a glance — use the [**Signal Force Set (Pro)**](/doc/unity/components-and-scripts/interfaces/signal-force-set/) component and the **Signal Force Monitor** window. This is ideal for virtual commissioning, where boundary signals (voltage present, emergency-stop released, system pressure) must be held at defined values. *(Professional)* ### Connecting Signals [Section titled “Connecting Signals”](#connecting-signals) To connect two signals you can use Connect Signals. The two signals must be of same datatype but it does not matters if they are input or output. In this example an InputFloat is connected to an Output Float. The signal value of the connected signal is transfered to the current signal. ![](/doc/unity/assets/interface-connectsignal.png) ### Signal Events [Section titled “Signal Events”](#signal-events) #### Signals in Behaviour Models [Section titled “Signals in Behaviour Models”](#signals-in-behaviour-models) Usually Signals should be used by Behavior Models which are defined by a script. In the Behaviour model references are used to identify the signals which are attached to the Behavior Model. Here is a simple example of a Behavior Model which can be attached to a Sensor: ```csharp [RequireComponent(typeof(Sensor))] //! The Sensor_Standard component is providing the Sensor behavior and connection to the PLC inputs and outputs. public class Sensor_Standard : BehaviorInterface { [Header("Settings")] public bool NormallyClosed = false; //!< Defines if sensor signal is *true* if occupied (*NormallyClosed=false*) of if signal is *false* if occupied (*NormallyClosed=true*) [Header("Interface Connection")] public PLCInputBool Occupied; //! Boolean PLC input for the Sensor signal. private Sensor Sensor; // Use this for initialization void Start() { Sensor = GetComponent(); } // Update is called once per frame void Update() { bool occupied = false; // Set Behavior Outputs if (NormallyClosed) { occupied = !Sensor.Occupied; } else { occupied = Sensor.Occupied; } // Set external PLC Outputs if (Occupied != null) Occupied.Value = occupied; } } ``` The public variable *public PLCInputBool Occupied* acts as referene to the Input Signal. Because the Sensor Behavior Model is attached to a GameObject with the Sensor base model also attached to it can get a reference to the sensor. In the Update cycle the Behavior Model is transferring the status between the Signals and the Sensor base object itself. Behavior Models give you the flexibility to program different behaviors and to still use the same base objects. You can see the relations in this picture: ![](/doc/unity/assets/interfaces-sensor.png) #### Unity Events and Signals [Section titled “Unity Events and Signals”](#unity-events-and-signals) You can receive Unity Events as soon as a signal is changed. To do so you can select in the Unity Editor a method on each signal which should be called once the signal is changing it’s status: ![](/doc/unity/assets/interfaces-signalevent.png) The method which is called receives as a parameter the Signal. The method must be defined like this: ```csharp public void SignalChangedEditor(Signal signal) { Debug.Log("Signal Changed Editor " + signal.ToString()); } ``` #### Subscribing for Signal changed events in a method [Section titled “Subscribing for Signal changed events in a method”](#subscribing-for-signal-changed-events-in-a-method) Another alternative is to subscribe to the Signal changed events in a method. You want see anything in the Unity Editor if you do so. The subscription is done each time Unity is starting the simulation. Here is an example: ```csharp void Start() { // Register Event During Runtime var com = GetComponent(); com.SignalChanged += SignalChangedRuntime; } public void SignalChangedRuntime(Signal signal) { Debug.Log("Signal Changed Runtime " + signal.ToString()); } ``` Please check the [Realvirtual.io Class Reference](https://game4automation.com/documentation/current/apidoc/html/classgame4automation_1_1_signal.html) for more information about the properties and methods of this component.\ \ \ \ \ © 2025 realvirtual GmbH [https://realvirtual.io](https://realvirtual.io/) - All rights reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or by any means, including printing, saving, photocopying, recording, or other electronic or mechanical methods, without the prior written permission of the publisher. # ABB RobotStudio Caution Please note: ABB RobotStudio interface is only available in realvirtual.io Professional. [RoboStudio](https://new.abb.com/products/robotics/de/robotstudio) is a powerful solution from ABB for offline programming and simulation of ABB robots. With the RobotStudio interface, the virtual ABB robot controller can be connected to realvirtual.io / Unity. The current axis positions as well as signals are cyclically exchanged between RobotStudio and realvirtual.io. Note The updating cycle of signals and axis positions is only about 1s when the simulation is stopped in ABB RobotStudio and is much faster (about 10ms) when the simulation is started in RobotStudio. ![](/doc/unity/assets/abb-full.png) ## Preparation of robots[](#preparation-of-robots) [Section titled “Preparation of robots ”](#preparation-of-robots) You need to prepare a robot with the usual realvirtual.io kinematics. Each axis of the robot must be assigned a drive and a Drive\_FollowPosition script. It is important that all drives are defined at the correct rotation position and that the positive direction of the drive is the same as for the real robot. An example robot can be found on the realvirtual.io community webpage (Github):\ ![](/doc/unity/assets/abb-robot.png) ## Preparation of ABB RoboStudio[](#preparation-of-abb-robostudio) [Section titled “Preparation of ABB RoboStudio ”](#preparation-of-abb-robostudio) The interface between realvirtual.io and RobotStudio uses the Simit shared memory interface that comes with RobotStudio. You need to add it in the station logic. ![](/doc/unity/assets/abb-shm.png) ![](/doc/unity/assets/abb-stationlogic.png) It is important that the SharedMemoryName matches the SharedMemoryName property of the ABBRobotStudioInterface in Unity. ## Interface configuration in Unity [Section titled “Interface configuration in Unity”](#interface-configuration-in-unity) In *SharedMemoryName*, enter the same name that is used in RobotStudio. ![](/doc/unity/assets/abb-interface.png) If you insert the ABB RoboStudio interface into your scene as a prefab or via the realvirtual.io menu, you will already get some sample signals imported. You may need to adapt these to your robot cell. ![](/doc/unity/assets/abb-signals.png) You have to define the signals manually in realvirtual.io, because ABB RoboStudio connects to the shared memory as a client and transfers the data depending on the listed signalm in the shared memory. There are naming convention for naming robot joints and input and output signals (e.g. \*Joint\[1]+ or \*Robot\[IRB7600\_400\_255]\[DigitalIO]StartRobot). **For more information on naming, see the ABB RoboStudio Help**. It is also very important that the input and output signals are mapped to identical bits on both sides by using the device mapping in ABB RoboStudio. The realvirtual.io signals are arranged in the memory in the order in which they are visible in Unity Inspector. You can check the memory location (in shared memory) by checking the signal comment in Unity Play mode. ![](/doc/unity/assets/abb-memory.png) It may be necessary to add some empty dummy signals so that the position of the bits of the data remains identical. You also need to make sure that input and output bits are not mixed in one byte. Here is the signal configuration for the example shown above: ![](/doc/unity/assets/abb-io.png) © 2025 realvirtual GmbH [https://realvirtual.io](https://realvirtual.io/) - All rights reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or by any means, including printing, saving, photocopying, recording, or other electronic or mechanical methods, without the prior written permission of the publisher. # Bosch Rexroth ctrlX OS (Pro) > Bosch Rexroth ctrlX OS interface with Data Layer bridge integration (Pro) Caution The ctrlX Interface is currently in **Beta** and will be officially released with **realvirtual Professional 6.3**. Note This interface requires the **REALVIRTUAL\_JSON** compiler define. See [Newtonsoft JSON](/doc/unity/advanced-topics/newtonsoft-json/) for setup instructions. ## Overview [Section titled “Overview”](#overview) The ctrlX Interface connects realvirtual directly to any **ctrlX OS device** like the **Bosch Rexroth ctrlX CORE** controller. It uses the **realvirtual WebSocket Bridge** — a .NET 8 snap application running on ctrlX OS — to exchange PLC signals in real time via the ctrlX Data Layer. Communication uses the high-performance [WebSocket Realtime Interface v2 protocol](/doc/unity/components-and-scripts/websocket-pro/#wire-protocol-v2-reference), enabling cyclic signal exchange at millisecond intervals. The ctrlX Interface extends the [WebSocket Realtime Interface](/doc/unity/components-and-scripts/interfaces/websocket-pro/) with ctrlX OS-specific features: REST API authentication, device status monitoring, remote bridge configuration, ctrlX Data Layer settings, and diagnostics — all from the Unity Inspector. **Key capabilities:** * **High-speed signal exchange** via WebSocket with configurable publish intervals down to 5 ms * **One-click signal import** from ctrlX Data Layer with automatic signal discovery * **REST API integration** for device info, bridge status, and diagnostics * **Remote bridge configuration** (publish interval, browse paths, logging level) * **Data Layer settings** (min publish/sample intervals) * **SSL/TLS support** for secure connections through the ctrlX reverse proxy ## Architecture [Section titled “Architecture”](#architecture) ```plaintext Unity (realvirtual) ctrlX OS device ┌─────────────────────┐ ┌──────────────────────────────┐ │ │ │ │ │ ctrlX Interface ──┼── WebSocket v2 ──▶ WebSocket Bridge │ │ │ │ │ │ │ ───┼── REST API ─────▶ ctrlX Data Layer │ │ │ │ │ │ │ │ │ PLC Runtime │ │ │ │ │ └─────────────────────┘ └──────────────────────────────┘ ``` The ctrlX Interface communicates with ctrlX OS devices through two channels: * **WebSocket v2** — High-speed cyclic signal exchange using the [WebSocket Realtime Interface v2 protocol](/doc/unity/components-and-scripts/websocket-pro/#wire-protocol-v2-reference). See that page for the full wire format specification. * **REST API** — Authentication, device info, bridge configuration, Data Layer settings, and diagnostics. ## realvirtual WebSocket Bridge [Section titled “realvirtual WebSocket Bridge”](#realvirtual-websocket-bridge) The **realvirtual WebSocket Bridge** is a .NET 8 snap application that runs on ctrlX OS. It bridges the ctrlX Data Layer to realvirtual Unity Digital Twins via the WebSocket Realtime Interface v2 protocol. ![](https://260262196-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpYxFg97YnJX96UzNNTSd%2Fuploads%2Fgit-blob-d78e66f033adb5a4cacb97e9b778f5490ded51ea%2Fctrlx-bridge-snap.png?alt=media) realvirtual WebSocket Bridge installed on a ctrlX OS device The bridge includes a built-in status page accessible via the ctrlX OS web interface, showing connection status, signal counts, write activity monitoring, and browse path configuration at a glance. ![](https://260262196-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpYxFg97YnJX96UzNNTSd%2Fuploads%2Fgit-blob-ee8f248b1d2546a86b7dd64efb3afe88823cc8d9%2Fctrlx-bridge-status.png?alt=media) realvirtual WebSocket Bridge status page showing connection status, signal counts, and write activity monitoring The bridge: * Subscribes to ctrlX Data Layer nodes and publishes their values over WebSocket * Receives signal updates from Unity and writes them back to the Data Layer * Supports configurable browse paths, publish intervals, and logging levels * Can be configured remotely from the Unity Inspector Note The realvirtual WebSocket Bridge snap is **available from realvirtual on demand**. Contact [realvirtual](https://realvirtual.io) to obtain the bridge application for your ctrlX CORE device. ## Setup [Section titled “Setup”](#setup) ### Prerequisites [Section titled “Prerequisites”](#prerequisites) 1. A **ctrlX OS device like ctrlX CORE** (physical or virtual) 2. The **realvirtual WebSocket Bridge** snap installed on the ctrlX OS device (available from realvirtual on demand) 3. Network connectivity between your PC and the ctrlX OS device ### Adding the Interface [Section titled “Adding the Interface”](#adding-the-interface) 1. In Unity, go to the menu **Tools > realvirtual > Interfaces > ctrlX Interface** to add the component 2. Enter the **ctrlX Address** (IP address of your ctrlX OS device) 3. Set **Username** and **Password** (default: `boschrexroth` / `boschrexroth`) 4. Click **Refresh** to verify the connection and see device info ![](https://260262196-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpYxFg97YnJX96UzNNTSd%2Fuploads%2Fgit-blob-1596ef5d3b2c1efd6fbe046b5a93b789178fc9f6%2Fctrlx-interface-inspector.png?alt=media) ctrlX Interface Inspector ### Importing Signals [Section titled “Importing Signals”](#importing-signals) 1. Make sure the ctrlX OS device is reachable and the bridge snap is running 2. Configure **Browse Paths** to point to your PLC symbols (e.g. `plc/app/Application/sym`) 3. Click **Import Signals** in the Connection section 4. The interface connects to the bridge, discovers all signals, and creates local PLC signal objects as children ### Quick Start [Section titled “Quick Start”](#quick-start) 1. Add the ctrlX Interface to your scene 2. Enter ctrlX address and credentials 3. Click **Refresh** to verify connectivity 4. Configure browse paths for your PLC program 5. Click **Import Signals** to create signal objects 6. Press Play — signals exchange automatically ## Properties [Section titled “Properties”](#properties) ### Connection [Section titled “Connection”](#connection) | Property | Description | | ----------------- | --------------------------------------------------------------------------------------------------------------------------------- | | **ctrlX Address** | IP address of the ctrlX OS device (e.g. `192.168.1.1`) | | **Username** | Login username for ctrlX REST API (default: `boschrexroth`) | | **Password** | Login password for ctrlX REST API (default: `boschrexroth`) | | **Use SSL** | Enable for `wss://` connections through the ctrlX reverse proxy. When enabled, port switches to 443 and path is set automatically | ### Status [Section titled “Status”](#status) | Property | Description | | -------------- | --------------------------------------------------------------- | | **ctrlX** | Device info: operating mode, hostname, OS version, architecture | | **Bridge** | Installed bridge snap version and status | | **WebSocket** | Current WebSocket connection state (Connected / Disconnected) | | **Signals** | Number of input and output signals | | **Comm Cycle** | Actual communication cycle time in milliseconds | | **Config** | Last configuration operation result | **Buttons:** * **Refresh** — Fetches device info and bridge status from ctrlX via REST API * **Test ctrlX** — Tests REST connectivity by authenticating and reporting the result * **Test Bridge** — Tests WebSocket connectivity to the bridge application ### Signal Import Configuration [Section titled “Signal Import Configuration”](#signal-import-configuration) | Property | Description | | ------------------------ | ------------------------------------------------------------------------------ | | **Default Direction** | Direction for imported signals when no pattern matches (`Input` or `Output`) | | **Use Pattern Matching** | Enable name-based direction detection using the patterns below | | **Input Patterns** | Name substrings that identify signals Unity writes to the PLC (e.g. `"Unity"`) | | **Output Patterns** | Name substrings that identify signals the PLC writes to Unity | ### Bridge Configuration [Section titled “Bridge Configuration”](#bridge-configuration) | Property | Description | | ------------------------- | ----------------------------------------------------------------------------------- | | **Publish Interval (ms)** | How often the bridge publishes signal updates over WebSocket (default: 5 ms) | | **Logging Level** | Bridge log verbosity: Debug, Information, Warning, or Error | | **Browse Paths** | Data Layer path prefixes for signal auto-discovery (e.g. `plc/app/Application/sym`) | | **Recursive** | Browse sub-folders recursively when discovering signals | Changes to bridge configuration are tracked and auto-applied after a short delay. ### Data Layer Settings [Section titled “Data Layer Settings”](#data-layer-settings) | Property | Description | | ----------------------------- | -------------------------------------------------------------------------------- | | **Min Publish Interval (ms)** | ctrlX Data Layer global minimum publish interval in milliseconds (default: 10) | | **Min Sample Interval (µs)** | ctrlX Data Layer global minimum sample interval in microseconds (default: 10000) | **Buttons:** * **Get DL** — Reads current Data Layer subscription settings from ctrlX * **Apply DL** — Writes the configured values to ctrlX Data Layer settings ### Bridge Logs [Section titled “Bridge Logs”](#bridge-logs) | Property | Description | | ---------------------- | ----------------------------------------------------- | | **Log Count** | Number of log entries to fetch from ctrlX diagnostics | | **Bridge Logs Only** | Filter to show only bridge snap log entries | | **Forward to Console** | Write each fetched log entry to the Unity console | **Buttons:** * **Fetch Logs** — Retrieves recent log entries from ctrlX OS diagnostics * **List Packages** — Lists all installed snaps on the ctrlX OS device ### Advanced [Section titled “Advanced”](#advanced) | Property | Description | | ------------------------- | ----------------------------------------------------------------------------------------- | | **WebSocket Port** | TCP port for WebSocket communication (default: 8080, auto-set to 443 when SSL is enabled) | | **Update Cycle (ms)** | Communication thread update interval in milliseconds | | **Client Name** | Identification name sent during WebSocket handshake | | **Connect On Play** | Automatically connect when entering play mode | | **Only Transmit Changed** | Only send signals whose values changed since the last cycle | | **Auto Reconnect** | Automatically reconnect on connection loss | | **Debug Mode** | Enable detailed logging for troubleshooting | ## SSL / Reverse Proxy [Section titled “SSL / Reverse Proxy”](#ssl--reverse-proxy) When **Use SSL** is enabled: * The port is automatically set to **443** * The WebSocket path is set to `/ctrlx-rv-bridge/ws` for routing through the ctrlX reverse proxy * All REST API calls use HTTPS * Self-signed certificates are accepted (common for ctrlX devices on local networks) When SSL is disabled, the interface connects directly to the bridge on port **8080** without encryption. ## Troubleshooting [Section titled “Troubleshooting”](#troubleshooting) **“Refresh” shows no device info:** * Verify the ctrlX address is correct and the device is reachable (`ping`) * Check username and password — default is `boschrexroth` / `boschrexroth` * Use **Test ctrlX** to verify REST API connectivity **Bridge shows “not found”:** * Install the realvirtual WebSocket Bridge snap on the ctrlX device * Check that the snap is in `active` state **WebSocket stays “Disconnected” during play:** * Verify the bridge snap is running on the ctrlX OS device * Check **WebSocket Port** matches the bridge configuration (default: 8080) * If using SSL, ensure port 443 is accessible and the bridge is behind the ctrlX reverse proxy * Enable **Debug Mode** for detailed connection logging **Signals not importing:** * Check that **Browse Paths** point to valid Data Layer nodes (e.g. `plc/app/Application/sym`) * Enable **Recursive** to discover signals in sub-folders * Verify the PLC application is loaded and running on the ctrlX OS device **Wrong signal directions after import:** * Configure **Input Patterns** and **Output Patterns** to match your naming convention * Or set the **Default Direction** to match the majority of your signals ## See Also [Section titled “See Also”](#see-also) * [WebSocket Realtime Interface (Pro)](/doc/unity/components-and-scripts/interfaces/websocket-pro/) — Base protocol, wire format specification, and code examples * [Custom Interfaces (FastInterface)](/doc/unity/components-and-scripts/interfaces/custom-interfaces/) — How to build your own interfaces * [Signal Manager](/doc/unity/components-and-scripts/interfaces/interface-tools/signal-manager/) — Managing PLC signals * [Interfaces Overview](/doc/unity/components-and-scripts/interfaces/) — All available interfaces * [ctrlX OS Overview](https://www.ctrlx-os.com/) — Information about ctrlX OS * [Bosch Rexroth ctrlX AUTOMATION platform](https://www.ctrlx-automation.com/) — Information about the automation toolbox # Custom Interfaces This guide shows you how to build your own industrial communication interfaces in realvirtual using the FastInterface framework. FastInterface provides thread-safe, high-performance communication with automatic signal management and connection handling. ## Overview [Section titled “Overview”](#overview) realvirtual’s FastInterface framework makes it easy to connect your simulation to external systems like PLCs, robots, IoT devices, or any system with a network API. You implement just three core methods, and FastInterface handles threading, reconnection, signal management, and UI integration automatically. **What you’ll learn:** * Setting up the FastInterface class structure * Implementing connection and communication logic * Handling signal exchange with thread safety * Using metadata for protocol mapping * Debugging and troubleshooting your interface ## FastInterface Architecture [Section titled “FastInterface Architecture”](#fastinterface-architecture) ![FastInterface Architecture Overview](/doc/unity/assets/fastinterface-architecture.png) This diagram illustrates the streamlined FastInterface development approach: ### FastInterface Foundation [Section titled “FastInterface Foundation”](#fastinterface-foundation) The **FastInterfaceBase** class provides six core services automatically: * **Thread Management**: Handles background thread lifecycle * **Auto Reconnection**: Automatic connection recovery on failure * **Signal Discovery**: Finds and manages all child signal components * **Error Handling**: Comprehensive error recovery and logging * **State Management**: Connection status tracking and monitoring * **Unity Integration**: Seamless Inspector UI and Unity compatibility ### Simple 3-Method Implementation [Section titled “Simple 3-Method Implementation”](#simple-3-method-implementation) You only need to implement **3 methods** to create a complete interface: 1. **EstablishConnection()** - Set up your protocol connection (TCP, serial, etc.) 2. **CommunicationLoop()** - Exchange data continuously with external system 3. **CloseConnection()** - Clean up resources and close connections ### Data Flow Architecture [Section titled “Data Flow Architecture”](#data-flow-architecture) The bottom section shows the **thread-safe data flow**: * **Unity Thread**: Manages GameObjects and signal components * **Background Thread**: Runs your protocol implementation safely * **External System**: Your target device (PLC, Robot, IoT, Server) Signal exchange uses built-in methods: * **Reading Signals**: `GetInputsForPLC()` - Unity → External System * **Writing Signals**: `SetOutputsFromPLC(data)` - External System → Unity **Core Components:** 1. **FastInterfaceBase Class** - The foundation that provides thread management, reconnection logic, and signal management infrastructure 2. **Background Thread** - All protocol communication runs on a dedicated background thread, keeping Unity’s main thread responsive 3. **Connection State Management** - Automatic connection monitoring with visual status indicators and error reporting 4. **Signal Manager** - Handles automatic discovery of child signal objects and manages thread-safe signal data exchange 5. **Thread-Safe Communication** - Built-in mechanisms for safely passing data between Unity’s main thread and the background communication thread 6. **Precise Timing Control** - Automatic integration with realvirtual’s PrePost FixedUpdate system for deterministic signal processing (Available in realvirtual 6.0.5+) **Standard Workflow:** The architecture ensures a consistent pattern across all FastInterface implementations: * **Initialize** → Copy Inspector properties to thread-safe variables * **Connect** → Establish connection on background thread with automatic retry logic * **Communicate** → Continuous loop reading Unity signals, sending to external system, receiving responses, and updating Unity signals * **Monitor** → Real-time connection state tracking with performance metrics * **Cleanup** → Proper resource cleanup with graceful shutdown **Key Benefits:** * **Consistency** - All custom interfaces follow the same proven architecture pattern * **Reliability** - Built-in connection recovery and error handling * **Performance** - Non-blocking communication with optimized signal change detection * **Visibility** - Inspector integration shows connection status, cycle counts, and timing metrics * **Safety** - Thread-safe design prevents Unity threading issues This standardized approach means you can focus on implementing your specific protocol logic while FastInterface handles all the complex threading, connection management, and Unity integration automatically. ## Precise Timing Control (realvirtual 6.0.5+) [Section titled “Precise Timing Control (realvirtual 6.0.5+)”](#precise-timing-control-realvirtual-605) FastInterface automatically integrates with realvirtual’s PrePost FixedUpdate system to provide deterministic timing for industrial automation applications. This system ensures that all FastInterface components process signals at precisely the same moments relative to Unity’s physics calculations. ### Timing Architecture [Section titled “Timing Architecture”](#timing-architecture) ```plaintext PreFixedUpdate → Unity FixedUpdate → PostFixedUpdate ↓ ↓ ↓ PLC→Unity Physics/Logic Unity→PLC ``` **Signal Processing Flow:** 1. **PreFixedUpdate Phase**: All FastInterface instances synchronously process PLC outputs (data FROM PLC TO Unity objects) 2. **FixedUpdate Phase**: Unity runs physics calculations, component logic, and movement updates 3. **PostFixedUpdate Phase**: All FastInterface instances synchronously process PLC inputs (data FROM Unity objects TO PLC) **No Configuration Required**: FastInterface automatically participates in the timing system - no additional setup or configuration needed. ## FastInterface Inspector [Section titled “FastInterface Inspector”](#fastinterface-inspector) ![FastInterface Inspector Panel](/doc/unity/assets/fastinterface-inspector.png) The FastInterface Inspector provides comprehensive monitoring and configuration for your custom interfaces. Understanding these fields is essential for effective interface development and troubleshooting: ### State Section [Section titled “State Section”](#state-section) * **State**: Shows the current connection status with visual indicators: * 🟢 **Connected** (green) - Interface is connected and communicating successfully * 🔴 **Disconnected** (red) - Interface is not connected * 🟡 **Connecting** (yellow) - Interface is attempting to establish connection * 🟠 **Error** (orange) - Interface encountered an error and will attempt reconnection * **Input Signals**: Number of input signals (Unity → External System) discovered automatically * **Output Signals**: Number of output signals (External System → Unity) discovered automatically * **Comm Cycle Ms**: Actual communication cycle time in milliseconds (performance indicator) * **Cycle Count**: Total number of communication cycles completed since connection ### Configuration Section [Section titled “Configuration Section”](#configuration-section) * **Update Cycle Ms**: Target cycle time in milliseconds for communication loop * **Only Transmit Changed Inputs**: ✅ Performance optimization - only sends changed input values * **Auto Reconnect**: ✅ Automatically attempts reconnection on connection loss * **Reconnect Interval Seconds**: Wait time between reconnection attempts * **Max Reconnect Attempts**: Maximum number of consecutive reconnection attempts (-1 = infinite) * **Debug Mode**: ✅ Enables detailed logging for troubleshooting **Key Benefits of the Inspector:** 1. **Real-time Monitoring** - Watch connection state and performance metrics live during runtime 2. **Performance Optimization** - “Only Transmit Changed Inputs” reduces network traffic significantly 3. **Automatic Recovery** - Built-in reconnection logic handles temporary connection losses 4. **Development Support** - Debug mode provides detailed logging for troubleshooting 5. **Signal Discovery** - Automatically counts and manages all child signal objects **Why use FastInterface:** * **Thread-safe** background communication without blocking Unity * **Automatic reconnection** with customizable retry logic * **Zero-configuration signal discovery** - automatically finds all child signals * **High performance** with optimized signal exchange and change detection * **Built-in debugging** with comprehensive logging and state visualization Note **New Standard**: FastInterface is the **new standard** for all realvirtual interface development. All new interfaces should use FastInterface for optimal performance, reliability, and maintainability. **Reference Implementations**: For production-quality examples, examine these FastInterface implementations in the realvirtual codebase: * **KEBA Interface** - Industrial robot controller communication * **KUKA Interface** - KUKA robot integration * **MQTT Interface** - IoT messaging protocol **Legacy Note**: Some older interfaces in realvirtual still use the deprecated InterfaceBaseClass/InterfaceThreadedBaseClass approach and will be migrated to FastInterface in future releases. Note **Migrating from Legacy Interfaces?** If you have existing interfaces built with the deprecated InterfaceBaseClass or InterfaceThreadedBaseClass, see [Legacy Interfaces (Deprecated)](/doc/unity/components-and-scripts/interfaces/legacy-interfaces-deprecated/) for migration guidance and reference documentation. ## Quick Start with Template [Section titled “Quick Start with Template”](#quick-start-with-template) The fastest way to create a custom interface is using the blueprint template. Copy one of these working templates from the realvirtual codebase: * **`BlueprintFastInterfaceSimple.cs`** - Minimal template for basic protocols * **`BlueprintFastInterface.cs`** - Full template with advanced features Copy `/Assets/realvirtual/Interfaces/Common/Fast/BlueprintFastInterfaceSimple.cs` and replace the TODO sections with your protocol logic: ```csharp using System.Threading; using System.Threading.Tasks; namespace realvirtual { public class MyCustomInterface : FastInterfaceBase { [Header("Connection Settings")] public string IPAddress = "192.168.1.100"; public int Port = 502; private TcpClient tcpClient; private NetworkStream stream; protected override async Task EstablishConnection(CancellationToken cancellationToken) { // Connect to your system tcpClient = new TcpClient(); await tcpClient.ConnectAsync(IPAddress, Port); stream = tcpClient.GetStream(); } protected override async Task CommunicationLoop(CancellationToken cancellationToken) { // Read Unity signals to send to external system var inputs = GetInputsForPLC(); // Send data using your protocol await SendData(inputs); // Receive data from external system var receivedData = await ReceiveData(); // Update Unity signals with received data SetOutputsFromPLC(receivedData); } protected override void CloseConnection() { stream?.Close(); tcpClient?.Close(); } } } ``` ## Step-by-Step Implementation [Section titled “Step-by-Step Implementation”](#step-by-step-implementation) ### Step 1: Create Your Interface Class [Section titled “Step 1: Create Your Interface Class”](#step-1-create-your-interface-class) Start by creating a new C# script that inherits from `FastInterfaceBase`: ```csharp using UnityEngine; using System; using System.Text; using System.Threading; using System.Threading.Tasks; using System.Collections.Generic; using System.Net.Sockets; namespace realvirtual { public class CustomNetworkInterface : FastInterfaceBase { [Header("Network Connection")] public string ServerIP = "192.168.1.100"; public int Port = 8080; [Header("Protocol Settings")] public string RequestCommand = "GET_DATA"; public int TimeoutMs = 1000; // Connection objects private TcpClient tcpClient; private NetworkStream stream; // Thread-safe copies for background thread access private string threadSafeServerIP; private int threadSafePort; } } ``` **Key points:** * Always inherit from `FastInterfaceBase` * Add Inspector properties for connection settings * Declare connection objects as private fields * Use `[Header]` attributes to organize Inspector settings ### Step 2: Implement Connection Logic [Section titled “Step 2: Implement Connection Logic”](#step-2-implement-connection-logic) The `EstablishConnection` method runs once on the background thread when starting communication: ```csharp protected override async Task EstablishConnection(CancellationToken cancellationToken) { ThreadSafeLogger.LogInfo($"Connecting to server {threadSafeServerIP}:{threadSafePort}", GetType().Name); try { tcpClient = new TcpClient(); await tcpClient.ConnectAsync(threadSafeServerIP, threadSafePort); stream = tcpClient.GetStream(); // Set socket options for reliable communication tcpClient.ReceiveTimeout = 2000; tcpClient.SendTimeout = 2000; ThreadSafeLogger.LogInfo("Network connection established", GetType().Name); } catch (Exception ex) { ThreadSafeLogger.LogError($"Failed to connect: {ex.Message}", GetType().Name); throw; // Re-throw to trigger reconnection logic } } protected override void CopyPropertiesToThreadSafe() { threadSafeServerIP = ServerIP; threadSafePort = Port; } ``` **Important:** * Use `ThreadSafeLogger` instead of `Debug.Log` in background threads * Throw exceptions on connection failure - FastInterface handles reconnection automatically * Copy Inspector properties to thread-safe fields using `CopyPropertiesToThreadSafe()` * Use `CancellationToken` for responsive shutdown during connection attempts ### Step 3: Build the Communication Loop [Section titled “Step 3: Build the Communication Loop”](#step-3-build-the-communication-loop) The `CommunicationLoop` method runs repeatedly on the background thread after connection is established: ```csharp protected override async Task CommunicationLoop(CancellationToken cancellationToken) { try { // Step 1: Read input signals from Unity (data to send to external system) var inputs = GetInputsForPLC(); // Step 2: Send data to external system if we have inputs if (inputs.Count > 0) { await SendDataToServer(inputs); } // Step 3: Request data from external system var receivedData = await RequestDataFromServer(); // Step 4: Update Unity output signals with received data if (receivedData.Count > 0) { SetOutputsFromPLC(receivedData); } } catch (Exception ex) { ThreadSafeLogger.LogError($"Communication error: {ex.Message}", GetType().Name); throw; // Re-throw to trigger reconnection } } private async Task SendDataToServer(Dictionary inputs) { // Convert Unity signals to your protocol format var pairs = new List(); foreach (var kv in inputs) { pairs.Add($"{kv.Key}={kv.Value}"); } var message = $"SET:{string.Join(",", pairs)}\r\n"; var messageBytes = Encoding.UTF8.GetBytes(message); await stream.WriteAsync(messageBytes, 0, messageBytes.Length); } private async Task> RequestDataFromServer() { // Send request var request = Encoding.UTF8.GetBytes("GET:ALL\r\n"); await stream.WriteAsync(request, 0, request.Length); // Read response var buffer = new byte[1024]; int bytesRead = await stream.ReadAsync(buffer, 0, buffer.Length); var response = Encoding.UTF8.GetString(buffer, 0, bytesRead); // Parse response into Unity signal format return ParseServerResponse(response); } ``` **Key concepts:** * **GetInputsForPLC()**: Returns all input signal values as `Dictionary` * **SetOutputsFromPLC()**: Updates output signals with received data * **Signal metadata**: Use `TryGetSignalMetadataSafe()` to access signal configuration safely from background thread * **Error handling**: Use try/catch and ThreadSafeLogger for robust error reporting ### Step 4: Handle Signal Exchange [Section titled “Step 4: Handle Signal Exchange”](#step-4-handle-signal-exchange) FastInterface provides two main methods for signal data exchange: ```csharp // In CommunicationLoop - read signals to send to external system var allInputs = GetInputsForPLC(); // Gets all input signals var changedOnly = GetChangedInputsForPLC(); // Performance optimization - only changed signals // Update output signals with data received from external system var outputData = new Dictionary { ["Motor1_Running"] = true, ["Motor1_Speed"] = 1500, ["Temperature"] = 23.5f, ["Status"] = "Running" }; SetOutputsFromPLC(outputData); ``` **Performance optimization:** * Use `OnlyTransmitChangedInputs = true` in Inspector to only send changed input signals * Access this setting thread-safely with `threadSafeOnlyTransmitChangedInputs` * Use appropriate data types - FastInterface handles conversion automatically ### Step 5: Implement Connection Cleanup [Section titled “Step 5: Implement Connection Cleanup”](#step-5-implement-connection-cleanup) The `CloseConnection` method runs on the background thread when stopping communication: ```csharp protected override void CloseConnection() { try { ThreadSafeLogger.LogInfo("Closing network connection", GetType().Name); stream?.Close(); stream?.Dispose(); tcpClient?.Close(); tcpClient?.Dispose(); stream = null; tcpClient = null; } catch (Exception ex) { ThreadSafeLogger.LogError($"Error during cleanup: {ex.Message}", GetType().Name); } } ``` ## Advanced Features [Section titled “Advanced Features”](#advanced-features) ### Using Signal Metadata for Protocol Mapping [Section titled “Using Signal Metadata for Protocol Mapping”](#using-signal-metadata-for-protocol-mapping) Signal metadata allows you to store protocol-specific configuration with each signal: ```csharp // Set metadata when importing signals (main thread only) protected virtual void OnInterfaceStarting() { // Find all signals and add Modbus metadata foreach (var signal in this.GetAllSignals()) { if (signal.name.Contains("Motor")) { signal.SetMetadata("RegisterAddress", 100); signal.SetMetadata("DataType", "INT16"); } else if (signal.name.Contains("Temperature")) { signal.SetMetadata("RegisterAddress", 200); signal.SetMetadata("DataType", "FLOAT32"); } } } // Access metadata safely from background thread protected override async Task CommunicationLoop(CancellationToken cancellationToken) { foreach (var input in GetInputsForPLC()) { // Thread-safe metadata access if (TryGetSignalMetadataSafe(input.Key, "RegisterAddress", out int address)) { var dataType = GetSignalMetadataSafe(input.Key, "DataType", "INT16"); await WriteRegister(address, ConvertValue(input.Value, dataType)); } } } ``` ### Dynamic Signal Import [Section titled “Dynamic Signal Import”](#dynamic-signal-import) You can create and update signals dynamically using the signal management API: ```csharp [Button("Import Modbus Signals")] private void ImportSignalsFromModbus() { // Example: Import from a Modbus configuration var signalConfigs = new[] { new { Name = "Motor1_Running", Type = SignalType.Bool, Direction = SignalDirection.Output, Address = 100 }, new { Name = "Motor1_Speed", Type = SignalType.Int, Direction = SignalDirection.Input, Address = 101 }, new { Name = "Temperature", Type = SignalType.Float, Direction = SignalDirection.Output, Address = 200 } }; foreach (var config in signalConfigs) { var metadata = new Dictionary { ["RegisterAddress"] = config.Address, ["DataType"] = config.Type.ToString() }; // Create or update signal with metadata var signal = this.CreateOrUpdateSignal(config.Name, config.Type, config.Direction, metadata); Debug.Log($"Created/Updated signal: {signal.name}"); } // Refresh signal manager to update internal caches this.RefreshSignalManager(); } ``` ### Thread-Safe Property Access [Section titled “Thread-Safe Property Access”](#thread-safe-property-access) For Inspector properties that need background thread access, copy them to thread-safe fields: ```csharp public class MyInterface : FastInterfaceBase { [Header("Settings")] public string ServerAddress = "192.168.1.100"; public int Timeout = 1000; public bool EnableExtendedLogging = false; // Thread-safe copies private string threadSafeServerAddress; private int threadSafeTimeout; private bool threadSafeLogging; // Called automatically before background thread starts protected override void CopyPropertiesToThreadSafe() { threadSafeServerAddress = ServerAddress; threadSafeTimeout = Timeout; threadSafeLogging = EnableExtendedLogging; } protected override async Task EstablishConnection(CancellationToken cancellationToken) { // Use thread-safe copies in background thread client.ConnectTimeout = threadSafeTimeout; await client.ConnectAsync(threadSafeServerAddress, 502); if (threadSafeLogging) { ThreadSafeLogger.LogInfo("Extended logging enabled", GetType().Name); } } } ``` Note **Real Interface Examples**: For complete production implementations, examine the FastInterface-based interfaces in `Assets/realvirtual/Interfaces/`: **FastInterface Standard (Recommended)**: * **KEBA Interface** - Modern industrial robot controller with comprehensive error handling * **KUKA Interface** - Advanced robotic integration with real-time communication * **MQTT Interface** - IoT protocol implementation with automatic topic management **Legacy Implementations** (being migrated): * S7, OPC-UA, and Modbus interfaces still use the older approach but demonstrate advanced features like bulk operations and protocol-specific optimizations. ## Best Practices [Section titled “Best Practices”](#best-practices) ### Performance Optimization [Section titled “Performance Optimization”](#performance-optimization) 1. **Use change detection** for input signals: ```csharp // Enable in Inspector or code OnlyTransmitChangedInputs = true; // Or manually check for changes var changedInputs = GetChangedInputsForPLC(); ``` 2. **Cache signal metadata** for better performance: ```csharp private Dictionary signalToRegisterMap = new Dictionary(); protected virtual void OnInterfaceStarting() { foreach (var signal in this.GetAllSignals()) { if (signal.GetMetadata("RegisterAddress", out int address)) { signalToRegisterMap[signal.GetSignalName()] = address; } } } ``` 3. **Batch operations** when possible: ```csharp // Instead of writing registers one by one foreach (var input in inputs) await WriteSingleRegister(address, value); // Write multiple registers at once await WriteMultipleRegisters(startAddress, allValues); ``` ### Thread Safety Guidelines [Section titled “Thread Safety Guidelines”](#thread-safety-guidelines) 1. **Never access Unity GameObjects** from background thread methods (`EstablishConnection`, `CommunicationLoop`, `CloseConnection`) 2. **Use ThreadSafeLogger** instead of Debug.Log in background threads: ```csharp // Background thread - CORRECT ThreadSafeLogger.LogInfo("Connection established", GetType().Name); ThreadSafeLogger.LogError("Failed to connect", GetType().Name); // Background thread - INCORRECT Debug.Log("This will cause errors!"); ``` 3. **Copy Inspector properties** to thread-safe fields: ```csharp // Inspector property (main thread only) public string ServerIP = "192.168.1.100"; // Thread-safe copy (background thread safe) private string threadSafeServerIP; protected override void CopyPropertiesToThreadSafe() { threadSafeServerIP = ServerIP; // Called automatically } ``` 4. **Use thread-safe signal metadata access**: ```csharp // Background thread safe if (TryGetSignalMetadataSafe(signalName, "Address", out int address)) { // Use address safely } // Main thread only signal.SetMetadata("Address", 100); ``` ### Error Handling and Debugging [Section titled “Error Handling and Debugging”](#error-handling-and-debugging) 1. **Comprehensive error handling**: ```csharp protected override async Task CommunicationLoop(CancellationToken cancellationToken) { try { await DoProtocolCommunication(); } catch (SocketException ex) { ThreadSafeLogger.LogError($"Network error: {ex.Message}", GetType().Name); throw; // Re-throw to trigger reconnection } catch (TimeoutException ex) { ThreadSafeLogger.LogWarning($"Communication timeout: {ex.Message}", GetType().Name); throw; } catch (Exception ex) { ThreadSafeLogger.LogError($"Unexpected error: {ex.Message}", GetType().Name); throw; } } ``` 2. **Enable debug mode** for detailed logging: ```csharp // Set in Inspector or code DebugMode = true; // Add conditional logging if (threadSafeDebugMode) { ThreadSafeLogger.LogInfo($"Sending {inputs.Count} signals", GetType().Name); } ``` 3. **Monitor connection state** in Inspector: * **State**: Shows current connection status with visual indicators * **CycleCount**: Number of communication cycles completed * **CommCycleMs**: Actual communication timing * **ErrorMessage**: Last error message if connection failed ### Testing Your Interface [Section titled “Testing Your Interface”](#testing-your-interface) 1. **Start with the blueprint** - copy `BlueprintFastInterface.cs` for a working foundation 2. **Test connection logic** first: ```csharp protected override async Task EstablishConnection(CancellationToken cancellationToken) { ThreadSafeLogger.LogInfo("Testing connection...", GetType().Name); await Task.Delay(100); // Simulate successful connection ThreadSafeLogger.LogInfo("Connection test successful", GetType().Name); } ``` 3. **Add simulation mode** for testing without external hardware: ```csharp [Header("Testing")] public bool SimulationMode = true; protected override async Task CommunicationLoop(CancellationToken cancellationToken) { if (threadSafeSimulationMode) { // Simulate received data for testing var testOutputs = new Dictionary { ["TestBool"] = UnityEngine.Random.value > 0.5f, ["TestInt"] = UnityEngine.Random.Range(0, 100) }; SetOutputsFromPLC(testOutputs); } else { // Real protocol implementation await DoRealCommunication(); } } ``` ## Troubleshooting [Section titled “Troubleshooting”](#troubleshooting) ### Common Issues [Section titled “Common Issues”](#common-issues) **Interface doesn’t connect:** * Check network connectivity and firewall settings * Verify IP address and port configuration * Look for error messages in Unity Console and Interface Inspector * Test with external tools (telnet, protocol-specific clients) **Signals not updating:** * Verify signals are child objects of the interface GameObject * Check signal directions (Input vs Output) * Enable Debug Mode for detailed signal logging * Ensure metadata mapping is correct **Performance issues:** * Enable `OnlyTransmitChangedInputs` to reduce network traffic * Increase `UpdateCycleMs` if communication is too frequent * Use batch operations instead of individual signal writes * Check for blocking operations in CommunicationLoop **Threading errors:** * Never access Unity GameObjects from background thread methods * Use ThreadSafeLogger instead of Debug.Log in background threads * Copy Inspector properties to thread-safe fields * Use thread-safe metadata access methods ### Debug Tools [Section titled “Debug Tools”](#debug-tools) 1. **Inspector debugging**: * Enable **Debug Mode** for detailed logging * Monitor **State** field for connection status * Check **ErrorMessage** for failure details * Watch **CycleCount** and **CommCycleMs** for performance 2. **Console logging**: ```csharp ThreadSafeLogger.LogInfo($"Processing {inputs.Count} inputs", GetType().Name); ThreadSafeLogger.LogInfoIf(threadSafeDebugMode, "Debug details here", GetType().Name); ``` 3. **Signal state monitoring**: ```csharp // Log all signal values periodically if (privateCycleCount % 100 == 0) { foreach (var input in GetInputsForPLC()) { ThreadSafeLogger.LogInfo($"Input {input.Key} = {input.Value}", GetType().Name); } } ``` ## FastInterface API Reference [Section titled “FastInterface API Reference”](#fastinterface-api-reference) FastInterface provides several high-performance helper methods for signal operations in your custom implementations. These methods are available through extension methods and provide thread-safe, optimized signal access. ### Signal Value Operations [Section titled “Signal Value Operations”](#signal-value-operations) ```csharp // Get signal value with type safety T GetSignalValue(string signalName) bool TryGetSignalValue(string signalName, out T value) // Set signal value with type safety void SetSignalValue(string signalName, T value) bool TrySetSignalValue(string signalName, T value) // Examples in your CommunicationLoop: var motorSpeed = this.GetSignalValue("Motor1_Speed"); var isRunning = this.GetSignalValue("Motor1_Running"); this.SetSignalValue("Temperature", 23.5f); this.SetSignalValue("Status", "Connected"); ``` ### Batch Signal Operations [Section titled “Batch Signal Operations”](#batch-signal-operations) ```csharp // High-performance batch operations for communication loops Dictionary GetInputsForPLC() // Unity → External System void SetOutputsFromPLC(Dictionary values) // External System → Unity // Get all signal values at once Dictionary GetAllSignalValues() // Set multiple signals efficiently void SetMultipleSignalValues(Dictionary values) // Example usage: protected override async Task CommunicationLoop(CancellationToken cancellationToken) { // Read Unity signals to send to external system var inputs = GetInputsForPLC(); await SendToExternalSystem(inputs); // Receive data and update Unity signals var receivedData = await ReceiveFromExternalSystem(); SetOutputsFromPLC(receivedData); } ``` ### Signal Discovery and Management [Section titled “Signal Discovery and Management”](#signal-discovery-and-management) ```csharp // Signal discovery and checking bool HasSignal(string signalName) int GetSignalCount() Signal GetSignalComponent(string signalName) // Get signals by direction IEnumerable GetInputSignals() IEnumerable GetOutputSignals() IEnumerable GetAllSignals() // Get signal names (thread-safe) List GetInputSignalNames() List GetOutputSignalNames() List GetAllSignalNames() // Example usage: protected virtual void OnInterfaceStarting() { var inputCount = this.GetInputSignals().Count(); var outputCount = this.GetOutputSignals().Count(); ThreadSafeLogger.LogInfo($"Found {inputCount} inputs, {outputCount} outputs", GetType().Name); } ``` ### Thread-Safe Metadata Access [Section titled “Thread-Safe Metadata Access”](#thread-safe-metadata-access) ```csharp // Get metadata safely from background thread T GetSignalMetadataSafe(string signalName, string key, T defaultValue = default(T)) bool HasSignalMetadataSafe(string signalName, string key) Dictionary GetAllSignalMetadataSafe(string signalName) // Set metadata (main thread only) void SetSignalMetadata(string signalName, string key, object value) // Example: Using metadata for register mapping protected override async Task CommunicationLoop(CancellationToken cancellationToken) { var inputs = GetInputsForPLC(); foreach (var input in inputs) { // Get register address from metadata if (TryGetSignalMetadataSafe(input.Key, "RegisterAddress", out int address)) { await WriteModbusRegister(address, input.Value); } } } ``` ### Dynamic Signal Creation [Section titled “Dynamic Signal Creation”](#dynamic-signal-creation) ```csharp // Create signals dynamically Signal CreateSignalSafe(string name, SignalType signalType, SignalDirection direction) Signal CreateSignalWithMetadata(string name, SignalType signalType, SignalDirection direction, Dictionary metadata = null) // Create or update existing signals Signal CreateOrUpdateSignal(string signalName, SignalType signalType, SignalDirection direction, Dictionary metadata = null) // Example: Import signals from external system configuration [Button("Import PLC Signals")] private void ImportPLCSignals() { var signalConfigs = GetPLCConfiguration(); // Your method to get PLC signal list foreach (var config in signalConfigs) { var metadata = new Dictionary { ["RegisterAddress"] = config.Address, ["DataType"] = config.Type }; var signal = this.CreateSignalWithMetadata( config.Name, config.SignalType, config.Direction, metadata); ThreadSafeLogger.LogInfo($"Created signal: {signal.name}", GetType().Name); } // Refresh manager after creating signals this.RefreshSignalManager(); } ``` ### Signal Manager Utilities [Section titled “Signal Manager Utilities”](#signal-manager-utilities) ```csharp // Refresh signal manager after creating/modifying signals void RefreshSignalManager() // Check if high-performance mode is active bool IsHighPerformanceModeActive() // Example usage after signal creation: private void SetupCustomSignals() { // Create your signals... CreateSignalSafe("CustomSignal1", SignalType.Bool, SignalDirection.Input); CreateSignalSafe("CustomSignal2", SignalType.Float, SignalDirection.Output); // Refresh manager to enable high-performance access this.RefreshSignalManager(); } ``` ### Common Usage Patterns [Section titled “Common Usage Patterns”](#common-usage-patterns) #### Pattern 1: Metadata-Based Protocol Mapping [Section titled “Pattern 1: Metadata-Based Protocol Mapping”](#pattern-1-metadata-based-protocol-mapping) ```csharp // Setup phase (main thread) protected virtual void OnInterfaceStarting() { foreach (var signal in this.GetAllSignals()) { if (signal.name.Contains("Motor")) { signal.SetMetadata("RegisterAddress", GetMotorRegisterAddress(signal.name)); signal.SetMetadata("DataType", "INT16"); } } this.RefreshSignalManager(); } // Communication phase (background thread) protected override async Task CommunicationLoop(CancellationToken cancellationToken) { var inputs = GetInputsForPLC(); foreach (var input in inputs) { if (TryGetSignalMetadataSafe(input.Key, "RegisterAddress", out int address)) { var dataType = GetSignalMetadataSafe(input.Key, "DataType", "INT16"); await WriteRegisterWithType(address, input.Value, dataType); } } } ``` #### Pattern 2: Dynamic Signal Import [Section titled “Pattern 2: Dynamic Signal Import”](#pattern-2-dynamic-signal-import) ```csharp [Button("Import from Configuration File")] private void ImportSignalsFromConfig() { var config = LoadConfigurationFile(); // Your config loading method foreach (var signalDef in config.Signals) { var metadata = new Dictionary { ["Address"] = signalDef.Address, ["ScaleFactor"] = signalDef.Scale, ["Unit"] = signalDef.Unit }; this.CreateOrUpdateSignal( signalDef.Name, signalDef.Type, signalDef.Direction, metadata); } this.RefreshSignalManager(); ThreadSafeLogger.LogInfo($"Imported {config.Signals.Count} signals", GetType().Name); } ``` #### Pattern 3: High-Performance Communication [Section titled “Pattern 3: High-Performance Communication”](#pattern-3-high-performance-communication) ```csharp protected override async Task CommunicationLoop(CancellationToken cancellationToken) { try { // Efficient batch read of all Unity input signals var inputs = GetInputsForPLC(); if (inputs.Count > 0) { // Send all inputs in one operation await SendBatchData(inputs); } // Receive all data in one operation var outputs = await ReceiveBatchData(); if (outputs.Count > 0) { // Update all Unity output signals in one batch SetOutputsFromPLC(outputs); } } catch (Exception ex) { ThreadSafeLogger.LogError($"Communication error: {ex.Message}", GetType().Name); throw; // Re-throw to trigger reconnection } } ``` Note **Performance Tips:** * Use batch operations (`GetInputsForPLC()`, `SetOutputsFromPLC()`) instead of individual signal access for better performance * Call `RefreshSignalManager()` after creating or modifying signals to enable high-performance lookups * Use metadata for protocol-specific configuration to avoid hardcoding addresses or parameters * Always use `ThreadSafeLogger` in background thread methods instead of `Debug.Log` # Denso Robotics (Pro) > Interface for Denso Wave robots Caution Please note that this interface is only included in realvirtual.io Professional ## Overview [Section titled “Overview”](#overview) The Denso Robot Interface in realvirtual.io facilitates the connection between real and virtual robot controllers, enabling both Hardware in the Loop (HIL) and Virtual Robot Controller (VRC) functionalities. This interface ensures synchronization between the robot controller and realvirtual.io for key parameters, including Axis Positions, boolean, integer, float, position (p), and string signals. [](/doc/unity/assets/denso-robot.mp4) Denso robot controlled by Wincaps III [](/doc/unity/assets/Wincaps3_Mwa2RyL67u.mp4) The robot programm inside Wincaps III ## Prerequisites [Section titled “Prerequisites”](#prerequisites) To use the Denso interface, ensure the following prerequisites are met: 1. **Wincaps III Software:** Install the Wincaps III software on your computer. 2. **License Keys:** Obtain valid license keys for Wincaps, VRC, and ORiN2 SDK. 3. **bCapConfig.exe:** Start bCapConfig.exe on your computer to enable communication between Wincaps III or a real robot and realvirtual.io. For detailed installation instructions, refer to the documentation here:\ ![](/doc/unity/assets/image%20\(2\)%20\(1\)%20\(1\)%20\(1\).png) bCapConfig.exe needs to be used to Start the service ## Interface setup [Section titled “Interface setup”](#interface-setup) ![](/doc/unity/assets/denso-interfaceproperties.png) Denso Interface 1. **Placement:** Position the interface on top of the robot. 2. **Hierarchy:** Under the interface, create a game object hierarchy containing the robot and its attached drives. A demonstration model, including the robot VS068, is available at `Assets/realvirtual/Interfaces/Denso/Denso.unity.` 3. **Axis Assignment:** Assign all axis at RobotAxis. Use the “Get Robot Drives” button for automatic assignment. 4. **Select Controller Type:** Choose the appropriate robot controller type by selecting either RC8 or RC9 in the “RobotController Type” setting. 5. **Set Robot Controller IP Address:** Specify the IP address of the robot controller. Use “localhost” or “127.0.0.1” when connecting to the virtual robot controller Wincaps III. 6. **Select Wincaps Project:** Enter the path or click the “Select Project” button to choose the Wincaps project associated with your Denso robot. 7. **Select the Robot Flange** by dragging and dropping the Flange to the property field “Robot Flange” ## Connecting the robot controller [Section titled “Connecting the robot controller”](#connecting-the-robot-controller) Before initiating the simulation, you have the option to connect to the robot controller, providing access to additional information regarding Safety Areas, Tool, and Work Coordinate Systems. Follow these steps: 1. **Connection Setup:** * Click the “Connect” button to establish a connection with the robot controller. 2. **Connection Confirmation:** * In the console log, a successful connection is indicated. Look for confirmation messages ensuring the successful establishment of the connection. 3. **Access to Additional Information:** * Once connected, the model can display supplementary information such as Safety Areas, Work Coordinates, and Tool configurations. Ensure that the connection process is successful by monitoring the console log for confirmation messages ![](/doc/unity/assets/image%20\(1\)%20\(1\)%20\(1\)%20\(1\)%20\(1\)%20\(1\)%20\(1\)%20\(1\)%20\(1\)%20\(1\)%20\(1\).png) Console log on sucessfull connection ![](/doc/unity/assets/image%20\(2\)%20\(1\)%20\(1\)%20\(1\)%20\(1\).png) Additional information about Safety Areas, Work Coordinates and Tool configurations ## Connecting Input and Output Signals [Section titled “Connecting Input and Output Signals”](#connecting-input-and-output-signals) To establish connections between input and output signals, follow these steps by creating signals manually as child objects under the Denso Interface: 1. **Access QuickEdit Overlay Menu:** * Open the QuickEdit Overlay Menu, which provides a streamlined interface for adding signals. ![](/doc/unity/assets/denso-signals.png) Quick Edit 2. **Create Signal Gameobject:** * Using the QuickEdit menu, add a new signal by creating a GameObject under the Denso Interface. 3. **Signal Naming Convention:** * While you can give the GameObject any name, it’s crucial to name the Signal itself with the corresponding number of the Input. This applies to all variable types, including E/A, Type P, Type I, Type F, and Type S. ![](/doc/unity/assets/image%20\(3\)%20\(1\)%20\(1\).png) Connecting user inputs with signals in realvirtual.io Now connect signals with various behavior models in your realvirtual.io simulation model, such as Sensors, Drives, Logic Steps, and more. ## Syncing P-Variables [Section titled “Syncing P-Variables”](#syncing-p-variables) P Variables, akin to I (Integer), F (Float), and S (String) variables, represent positions in the coordinate system of the robot, applicable within the robot program. In Wincaps, P values serve as both inputs and outputs simultaneously, while realvirtual.io strictly separates inputs and outputs. To bridge this gap, you can define a PLCOutputTransform for transferring P values from Wincaps to realvirtual.io during simulation. Similarly, a PLCInputTransform facilitates the transfer of P values from realvirtual.io to Wincaps. This proves particularly useful for displaying robot points in Unity. To add a P variable: 1. Manually add an empty GameObject. 2. Attach a PLCOutputTransform or PLCInputTransform to this GameObject. 3. In the Name field of the Signal, specify the number of the variable, similar to other signals. ![](/doc/unity/assets/image%20\(13\).png) Syncing P variables During edit mode, you can efficiently synchronize all P variables, regardless of their type (PLCOutputTransform or PLCInputTransform), between the robot and realvirtual.io. This synchronization can be initiated by clicking the corresponding buttons: * **Sync all Transforms from Robot:** * Utilize this button to sync all P variables from the robot to realvirtual.io during the editing phase. * **Sync all Transforms to Robot:** * Alternatively, use this button to sync all P variables from realvirtual.io to the robot during editing. ## Starting simulation [Section titled “Starting simulation”](#starting-simulation) To initiate the simulation in Wincaps III, click the designated “Start Simulation Mode” button. Additionally, launch the robot program by selecting the corresponding button. ![](/doc/unity/assets/image%20\(4\).png) Starting simulation mode and starting the robot programm After this you can start the Unity simulation. # EthernetIP > >- Caution EthernetIP interface is only included in realvirtual.io Professional ## Overview [Section titled “Overview”](#overview) The EtherNet/IP interface enables direct communication between realvirtual.io and industrial controllers using the Common Industrial Protocol (CIP) over standard Ethernet networks. EtherNet/IP (Industrial Protocol) is one of the leading industrial communication protocols in North America and is widely adopted across manufacturing, process control, and hybrid automation systems. This interface provides seamless integration with major PLC manufacturers including Allen-Bradley (Rockwell Automation), Omron, and Schneider Electric controllers, enabling true virtual commissioning workflows where your Unity simulation communicates directly with real industrial hardware. **Key Features:** * Direct tag-based communication with Allen-Bradley ControlLogix, CompactLogix, and MicroLogix systems * Support for Omron NJ/NX series and Schneider Electric Modicon controllers * Real-time bidirectional data exchange with sub-100ms cycle times * Bulk signal import from CSV files exported from programming software * Built-in connection diagnostics and error handling * Thread-safe communication architecture for production environments ## Properties [Section titled “Properties”](#properties) The EtherNet/IP interface requires configuration of network settings and communication parameters through the Unity Inspector: ![EthernetIP Interface Inspector showing all configuration properties and buttons](/doc/unity/assets/ethernetip-interface-inspector.png) EthernetIP Interface component in Unity Inspector with all configuration properties **IP-Address** (string) The IP address or hostname of the target PLC or EtherNet/IP gateway device. Include optional port number using colon notation (e.g., `192.168.1.100:44819`). Standard EtherNet/IP uses port 44818, but some configurations may require different ports. Must be accessible from the Unity application’s network segment. **Path** (string) CIP routing path specifying the physical location of the target controller within the chassis or backplane. For Allen-Bradley ControlLogix/CompactLogix systems, typical values are `1,0` (backplane position 1, slot 0) or `1,2` (backplane position 1, slot 2). For Logix systems communicating through DH+ bridges, this path defines the routing through multiple network segments. Leave empty for Micro800 series controllers which do not require routing paths. **PLCType** (enum) Controller family selection that optimizes communication protocol behavior for specific PLC architectures. Available options include: * **controllogix**: Allen-Bradley ControlLogix and CompactLogix systems (recommended for most Rockwell applications) * **micro800**: Allen-Bradley Micro800 series controllers * **slc500**: Allen-Bradley SLC 500 family PLCs * **plc5**: Legacy Allen-Bradley PLC-5 systems * **omron-njnx**: Omron NJ and NX series controllers **Protocol** (enum) Communication protocol selection determining the network-level protocol used for data exchange: * **ab\_eip**: Allen-Bradley EtherNet/IP protocol (recommended for Rockwell and compatible systems) * **modbus-tcp**: Modbus TCP protocol for broader industrial device compatibility **Debug Mode** (boolean) Enables additional logging of communication operations to the Unity Console. When enabled, outputs signal initialization status, connection errors, and signal operation details. Useful for troubleshooting connection issues and verifying signal setup. Disable in production environments to reduce console log volume. **Timeout** (integer) Communication timeout value in milliseconds for individual tag operations. Higher values provide more tolerance for network latency and PLC response delays but reduce overall system responsiveness. Typical range: 1000-10000ms depending on network conditions and controller performance. **PLCSignalTable** (string) File path to CSV-format signal definition table for bulk signal import. Use the “Select PLC Signal table” button in the Inspector to browse for CSV files exported from programming software like RSLogix 5000/Studio 5000. After selecting a file, click “Import PLC signal table” to automatically create Signal GameObjects. File must follow specific column format: Symbol, Direction (INPUT/OUTPUT), Type, Comment. **UpdateCycle** (read-only) Current communication cycle counter that increments with each successful read/write operation cycle. Provides real-time indication of communication activity and connection health. Value resets to 0 when the interface reconnects or is restarted. **Thread Status** (read-only) Displays the current status of the communication thread that handles PLC data exchange. Shows whether the background thread is running, stopped, or experiencing errors. This status indicates the health of the parallel communication system that ensures non-blocking Unity performance. **Test Connect** (button) Tests the current configuration by attempting to connect to the specified PLC. Displays connection results in Unity Console. **Select PLC Signal table** (button) Opens file browser to select CSV file containing signal definitions for bulk import. **Import PLC signal table** (button) Processes the selected CSV file and creates Signal child GameObjects automatically. ## PLC Configuration [Section titled “PLC Configuration”](#plc-configuration) ### Allen-Bradley ControlLogix/CompactLogix Setup [Section titled “Allen-Bradley ControlLogix/CompactLogix Setup”](#allen-bradley-controllogixcompactlogix-setup) For Allen-Bradley controllers, ensure the following configuration in RSLogix 5000/Studio 5000: 1. **Network Configuration**: Configure the Ethernet module with a static IP address accessible from your Unity application 2. **Tag Creation**: Create controller-scoped tags or program-scoped tags that will be accessed from realvirtual.io 3. **Data Types**: Use supported data types (REAL, BOOL, INT, SINT, DINT) for optimal compatibility 4. **Security**: Ensure the controller’s security settings allow external read/write access **Example Tag Naming Conventions:** * Controller tags: `ConveyorSpeed`, `SystemEnabled`, `ProductCount` * Program tags: `Program:MainSequence.StepNumber`, `Program:Safety.EmergencyStop` * Array elements: `ProductData[0]`, `AxisPosition[3]` ### Omron NJ/NX Series Setup [Section titled “Omron NJ/NX Series Setup”](#omron-njnx-series-setup) For Omron controllers using Sysmac Studio: 1. **EtherNet/IP Configuration**: Enable EtherNet/IP adapter functionality in the network configuration 2. **Tag Definition**: Create global variables with appropriate data types 3. **Network Settings**: Configure built-in EtherNet/IP port with static IP addressing ### Micro800 Configuration [Section titled “Micro800 Configuration”](#micro800-configuration) Micro800 series controllers require simplified configuration: 1. **Ethernet Configuration**: Set static IP address in Connected Components Workbench 2. **Path Setting**: Leave the Path field empty in realvirtual.io Inspector 3. **Tag Access**: Use simple tag names without program qualifiers ## Signal Configuration [Section titled “Signal Configuration”](#signal-configuration) ### Manual Signal Setup [Section titled “Manual Signal Setup”](#manual-signal-setup) Signals can be created manually for precise control over tag mapping and configuration. This is useful when you need to connect to specific PLC tags without importing an entire signal table. #### Creating Signals Manually [Section titled “Creating Signals Manually”](#creating-signals-manually) 1. **Create Child GameObject**: Right-click the EtherNet/IP interface GameObject and create an empty child GameObject 2. **Add Signal Component**: Add the appropriate PLCInput or PLCOutput component based on data flow: * **PLCInputBool/Int/Float**: Data flows FROM Unity TO PLC (Unity → PLC) - PLC Input from PLC perspective * **PLCOutputBool/Int/Float**: Data flows FROM PLC TO Unity (PLC → Unity) - PLC Output from PLC perspective 3. **Configure Signal Properties**: * **Name**: Enter the exact PLC tag name (e.g., `ConveyorSpeed`, `Program:MainSequence.StepNumber`) * **Comment**: Optional description for documentation * **OriginDataType**: Specify the exact PLC data type (critical for proper communication) #### OriginDataType Configuration [Section titled “OriginDataType Configuration”](#origindatatype-configuration) The **OriginDataType** field tells the interface how to interpret the data at the PLC level. This is crucial for correct data conversion between PLC and Unity. **When to Set OriginDataType:** * **Always required** when creating signals manually * **Automatically set** when importing from CSV or PLC discovery * Must match the exact data type defined in your PLC program **Common OriginDataType Values:** | OriginDataType | PLC Data Type | realvirtual Signal Type | Description | | -------------- | --------------------- | ---------------------------- | ------------------------------- | | BOOL | Boolean | PLCInputBool/PLCOutputBool | Single bit (true/false) | | SINT | 8-bit signed integer | PLCInputInt/PLCOutputInt | -128 to 127 | | INT | 16-bit signed integer | PLCInputInt/PLCOutputInt | -32,768 to 32,767 | | DINT | 32-bit signed integer | PLCInputInt/PLCOutputInt | -2,147,483,648 to 2,147,483,647 | | REAL | 32-bit floating point | PLCInputFloat/PLCOutputFloat | IEEE 754 single precision | #### Important Notes for Manual Configuration [Section titled “Important Notes for Manual Configuration”](#important-notes-for-manual-configuration) * **Tag Name Must Match Exactly**: The Name field must match the PLC tag name exactly, including case sensitivity * **Data Type Mapping**: Multiple PLC integer types (SINT, INT, DINT) all map to PLCInputInt/PLCOutputInt in realvirtual * **Boolean Outputs**: Due to EtherNet/IP protocol limitations, boolean outputs may use SINT in the PLC * **Array Access**: Include array indices directly in the Name field using standard Allen-Bradley syntax (e.g., `ProductData[0]`, `Matrix[2,5]`) * **Verification**: Use Debug Mode to verify successful tag connection after starting play mode ### Automatic Signal Import [Section titled “Automatic Signal Import”](#automatic-signal-import) #### CSV Signal Import [Section titled “CSV Signal Import”](#csv-signal-import) For bulk signal configuration, create a CSV file with the following format: **CSV File Format:** ```plaintext Symbol,Direction,Type,Comment ConveyorSpeed,INPUT,REAL,Main conveyor belt speed in m/min SystemStart,OUTPUT,BOOL,System start command from operator ProductCount,INPUT,DINT,Total products processed today EmergencyStop,INPUT,BOOL,Safety system emergency stop status ``` **CSV Import Process:** 1. Export tag list from your programming software (RSLogix, Sysmac Studio, etc.) 2. Format according to required column structure 3. Use “Select PLC Signal table” button in the Inspector to browse for the CSV file 4. Click “Import PLC signal table” to automatically create Signal GameObjects (existing signals with matching names are preserved) **CSV Requirements:** * No header row in the CSV file * Column order: Symbol, Direction (INPUT/OUTPUT), Type, Comment * Type must exactly match supported data types: REAL, BOOL, INT, SINT, DINT * Symbol must match exact tag names in PLC program including case sensitivity ## Data Types [Section titled “Data Types”](#data-types) The EtherNet/IP interface supports the following data type mappings between PLC tags and realvirtual.io signals: | PLC Data Type | realvirtual Signal Type | Description | Value Range | | ------------- | ------------------------------ | -------------------------- | ------------------------------- | | REAL | PLCInputFloat / PLCOutputFloat | 32-bit IEEE floating point | ±3.4 × 10^38 | | BOOL | PLCInputBool / PLCOutputBool | Single bit boolean | true/false | | INT | PLCInputInt / PLCOutputInt | 16-bit signed integer | -32,768 to 32,767 | | SINT | PLCInputInt / PLCOutputInt | 8-bit signed integer | -128 to 127 | | DINT | PLCInputInt / PLCOutputInt | 32-bit signed integer | -2,147,483,648 to 2,147,483,647 | **Array Access Support:** Array element access is fully supported using standard Allen-Bradley array notation. Simply specify the array element in the signal’s Name field, and the interface will automatically handle the array indexing: * **Single-dimensional arrays**: `TagName[0]`, `TagName[15]` * **Multi-dimensional arrays**: `Matrix[2,5]`, `Table[1,3,7]` * **Program-scoped arrays**: `Program:Main.DataArray[10]` * **UDT array members**: `Recipe[0].Temperature`, `Motors[5].Speed` **Important Notes:** * Boolean outputs use SINT data type in the PLC due to protocol limitations * Array elements are treated as individual signals - no special configuration required * String data types are not currently supported in this interface version ## Usage Examples [Section titled “Usage Examples”](#usage-examples) ### Basic Setup Workflow [Section titled “Basic Setup Workflow”](#basic-setup-workflow) 1. **Add Interface Component**: Create empty GameObject and add EthernetIPInterface component 2. **Configure Network Settings**: Set IP-Address to your PLC’s Ethernet address (e.g., `192.168.1.42`) 3. **Set PLC Parameters**: Configure Path (`1,0` for ControlLogix), PLCType (`controllogix`), Protocol (`ab_eip`) 4. **Test Connection**: Use “Test Connect” button in the Inspector to validate configuration and verify communication 5. **Import Signals**: Use CSV import or manually create Signal child objects 6. **Runtime Operation**: Interface automatically handles read/write cycles when scene starts ### Advanced Tag Naming [Section titled “Advanced Tag Naming”](#advanced-tag-naming) **Program-Scoped Tags (Allen-Bradley):** ```plaintext Program:MainSequence.ConveyorRunning Program:Safety.EmergencyStop Program:Recipe.MixingTime ``` **Array Access:** ```plaintext ProductionData[0] // First element AxisPosition[2] // Third axis position RecipeValues[10] // Eleventh recipe parameter ``` ## Troubleshooting [Section titled “Troubleshooting”](#troubleshooting) ### Connection Issues [Section titled “Connection Issues”](#connection-issues) **Cannot Connect to PLC:** * Verify IP address is correct and PLC is powered on * Check network connectivity using ping command * Ensure Windows Firewall allows EtherNet/IP communication (port 44818) * Verify PLC Ethernet module configuration and IP settings **Connection Timeouts:** * Increase Timeout value in interface properties (try 5000-10000ms) * Check network latency and bandwidth availability * Verify PLC is not overloaded with other communication tasks **Path Configuration Errors:** * For ControlLogix: Use format `1,0` where 1 is backplane, 0 is slot number * For CompactLogix: Typically `1,0` for integrated Ethernet port * For Micro800: Leave Path field empty * Check physical slot configuration matches software settings ### Communication Issues [Section titled “Communication Issues”](#communication-issues) **Tags Not Reading/Writing:** * Verify exact tag name spelling and case sensitivity * Ensure tag exists in PLC program and is properly scoped * Check data type compatibility between PLC tag and realvirtual signal * Use Debug Mode to view detailed communication logs **Manual Signal Configuration Issues:** * **Missing OriginDataType**: Always set OriginDataType when creating signals manually (e.g., “DINT”, “REAL”, “BOOL”) * **Wrong Signal Component**: Ensure PLCInputInt is used for all integer types (SINT, INT, DINT) * **Tag Name Mismatch**: The Name field must exactly match the PLC tag (case-sensitive) * **Direction Confusion**: Remember PLCInput = Unity→PLC, PLCOutput = PLC→Unity (from PLC viewpoint) * **Data Type Mismatch**: Verify OriginDataType matches the actual PLC tag data type in RSLogix/Studio 5000 **Slow Communication:** * Reduce number of signals or group related signals * Optimize PLC scan time and communication settings * Check network bandwidth and switch configuration * Consider increasing communication cycle time for large tag sets **Intermittent Connection Loss:** * Check network cable connections and switch settings * Verify PLC Ethernet module is properly seated * Monitor network traffic for congestion or errors * Implement connection retry logic in critical applications ### PLC-Specific Issues [Section titled “PLC-Specific Issues”](#plc-specific-issues) **Allen-Bradley Controllers:** * Verify controller security settings allow external connections * Check that EtherNet/IP services are enabled in controller properties * Ensure sufficient controller memory for tag operations * Validate Ethernet module firmware compatibility **Omron Controllers:** * Confirm EtherNet/IP adapter is properly configured * Verify global variable accessibility settings * Check CPU unit Ethernet port configuration **Debug Mode Output:** When enabled, Debug Mode provides the following information in Unity Console: * Signal initialization status with data types and connection results * Connection error messages with detailed exception information * PLC connection success confirmations with controller type and IP address ## See Also [Section titled “See Also”](#see-also) * [OPC-UA Interface](/doc/unity/components-and-scripts/interfaces/opcua/) - Alternative industrial communication protocol * [S7 TCP Interface](/doc/unity/components-and-scripts/interfaces/s7-tcp/) - Siemens-specific PLC communication * [Interfaces Overview](/doc/unity/components-and-scripts/overview/) - Comparison of available interface options * [Drive Component](/doc/unity/components-and-scripts/motion/drive/) - Integration with motion control * [Sensor Components](/doc/unity/components-and-scripts/sensors/overview/) - Integration with sensor simulation *** © 2024 realvirtual GmbH [https://realvirtual.io](https://realvirtual.io/) - All rights reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or by any means, including printing, saving, photocopying, recording, or other electronic or mechanical methods, without the prior written permission of the publisher. # Fanuc (Pro) > Connecting to Fanuc industrial robots Caution Please note that this interface is only included in realvirtual.io Professional The **Fanuc Interface** component allows direct communication between Unity and FANUC industrial robots using the **SNPX (Robot Interface / SRTP)** protocol. It enables real-time control of robot drives, digital and analog I/O, and access to internal robot variables — supporting use cases like digital twins, simulation, and live operation. Tip The FANUC connection is made possible thanks to [UnderAutomation](https://underautomation.com/customers/realvirtual-io-fanuc-integration-virtual-commissioning). Read their customer story on the realvirtual.io FANUC integration for virtual commissioning. ![](/doc/unity/assets/fanucdemo.png) ### Overview [Section titled “Overview”](#overview) This interface connects Unity to a FANUC controller over TCP/IP (default port `60008`), allowing you to: * Read/write digital and analog signals * Track drive and axis positions ### Requirements [Section titled “Requirements”](#requirements) To use the SNPX-based communication, your FANUC controller must support the Robot Interface protocol. This can be configured during workcell creation in ROBOGUIDE. #### Enabling SNPX [Section titled “Enabling SNPX”](#enabling-snpx) You must enable one of the following options when setting up your virtual or physical controller: * **R650 FRA Params**: * Select **“FANUC America Corp.”** in the *Advanced* tab of ROBOGUIDE’s Workcell Wizard (Step 7) * Add option **R553 – HMI Device SNPX** * **R651 FRL Params**: * Select **“FANUC Ltd.”** in the same Advanced tab * No additional options required Also ensure that: * TCP port `60008` (Robot IF Server) is open and accessible * The controller and Unity application are on the same network or subnet ### Inspector Fields [Section titled “Inspector Fields”](#inspector-fields) ![](/doc/unity/assets/fanucinterface.png) | Field | Description | | ------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | **Active** | Enables or disables the interface | | **Is Connected** | Shows live connection status with the controller | | **Address** | IP address of the FANUC robot (e.g., `192.168.0.179`). For a ROBOGUIDE virtual robot on the same PC use `127.0.0.1` | | **Port** | TCP port of the Robot IF (SNPX) server. Default `60008`. In a ROBOGUIDE multi-robot cell each virtual robot uses an incrementing port (robot 1 = `60008`, robot 2 = `60009`, …) | | **Drives** | Assign Unity `Drive` components to robot axes (supports J1–J9) | | **Num Inputs / Outputs** | Displays how many input/output signals are currently active | | **Thread Status** | Indicates the state of the background communication thread | | **Connect Button** | Triggers the connection process to the controller | ### Multiple Robots (ROBOGUIDE Multi-Robot Cell) [Section titled “Multiple Robots (ROBOGUIDE Multi-Robot Cell)”](#multiple-robots-roboguide-multi-robot-cell) A ROBOGUIDE workcell with several robots on one PC shares a single IP address — each virtual robot gets its own **incrementing Robot IF port** instead. To simulate such a cell, add **one Fanuc Interface per robot** and set the **Port** accordingly: | Robot | Address | Port | | ------- | ----------- | ------- | | Robot 1 | `127.0.0.1` | `60008` | | Robot 2 | `127.0.0.1` | `60009` | | Robot 3 | `127.0.0.1` | `60010` | The exact port of each robot is listed in the `services.txt` file inside the corresponding `robot_1`, `robot_2`, … subfolder of your ROBOGUIDE workcell. Assign each robot’s axis `Drive` components to the **Drives** list of its own interface, and make sure SNPX (R553 / R651) is enabled on every virtual controller. Because ROBOGUIDE and Unity run on the same PC, all communication goes over localhost — no network adapter, DHCP or subnet configuration is required. The `192.168.x.x` address shown on the teach pendant is ROBOGUIDE-internal and does not need to match a physical adapter. ### Signal Mapping [Section titled “Signal Mapping”](#signal-mapping) The **Fanuc Interface** uses string-based signal names to map FANUC robot I/O into Unity. These names follow a `PREFIX + NUMBER` format and are parsed automatically on startup. ![](/doc/unity/assets/fanuc-examplerobotoutput.png) Example of a configured digital output DO3 #### Supported Signal Prefixes [Section titled “Supported Signal Prefixes”](#supported-signal-prefixes) | Prefix | Direction | Description | | ------ | --------- | ----------------------------------------------- | | `DI` | Input | Device-level digital inputs | | `DO` | Output | Device-level digital outputs | | `UI` | Input | User-defined digital inputs | | `UO` | Output | User-defined digital outputs | | `RI` | Input | Remote robot digital inputs | | `RO` | Output | Remote robot digital outputs | | `SDI` | Input | Safety digital inputs | | `SDO` | Output | Safety digital outputs | | `WI` | Input | Welding-specific digital inputs | | `WO` | Output | Welding-specific digital outputs | | `AI` | Input | Analog integer inputs (e.g., sensor values) | | `AO` | Output | Analog integer outputs (e.g., analog actuators) | **Examples:** * `DO0` – Digital Output 0 * `UI5` – User Input 5 * `AO3` – Analog Output 3 * `WI2` – Welding Input 2 Signals are case-insensitive in Unity but are documented here in uppercase for clarity. ### See Also [Section titled “See Also”](#see-also) * [realvirtual.io Fanuc integration for virtual commissioning](https://underautomation.com/customers/realvirtual-io-fanuc-integration-virtual-commissioning) – customer story on connecting realvirtual.io to FANUC robots # Festo AX Controls (PLCnext) (Pro) > Festo AX Controls PLCnext interface using RSC data access (Pro, Beta) Note This feature was added in realvirtual **6.3.3** (Professional) — Beta ## Overview [Section titled “Overview”](#overview) The Festo AX Controls interface connects realvirtual directly to **Festo AX Controls** controllers running **PLCnext Technology** — the open IEC 61131-3 runtime platform developed by Phoenix Contact and adopted by Festo for their AX Controls series. Communication uses Festo’s **RSC (Remote Service Call)** library over TCP port **41100**, providing direct access to PLCnext Global Data Space (GDS) variables. The interface supports two data exchange modes: **subscription mode**, where the controller pushes variable updates at a configurable sample rate, and **polling mode**, where realvirtual reads all output variables each cycle. Both Boolean, integer, float, and string variable types are supported. An editor button connects to the controller at design time to import variables and create realvirtual signal objects automatically. ![](/doc/unity/assets/festo-plcnext-inspector.png) Festo AX Controls (PLCnext) interface Inspector showing connection, subscription, and variable import settings ## Prerequisites [Section titled “Prerequisites”](#prerequisites) 1. **realvirtual Professional** — The Festo interface and RSC DLLs are included in the Professional package. 2. **Network connectivity** — Your development PC must be able to reach TCP port **41100** on the Festo controller. 3. **PLCnext firmware** — The controller must be running PLCnext firmware with RSC services enabled (standard on all AX Controls firmware releases). ## Properties [Section titled “Properties”](#properties) ### Connection Settings [Section titled “Connection Settings”](#connection-settings) | Property | Description | | ------------------------------ | ----------------------------------------------------------------------------------------------------- | | **Host** | IP address or hostname of the Festo PLCnext controller (default: `192.168.1.10`) | | **Port** | RSC service TCP port (default: `41100`) | | **Use TLS** | Enable TLS encryption for the RSC connection. Recommended for production deployments | | **Validate Certificate** | Validate the server’s TLS certificate. Disable this for self-signed certificates in test environments | | **Username** | PLCnext authentication username (default: `admin`) | | **Password** | PLCnext authentication password (default: `plcnext`) | | **Connection Timeout Seconds** | Timeout in seconds for connection and read/write operations (default: `10`) | ### Subscription Settings [Section titled “Subscription Settings”](#subscription-settings) | Property | Description | | ------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | | **Use Subscription** | Use PLCnext real-time subscription mode for output signals. When disabled, polling is used instead | | **Subscription Cycle Ms** | Sample rate in milliseconds for subscription mode. Lower values give higher update rates. Minimum effective value is 10 ms (default: `100`) | ### Variable Import [Section titled “Variable Import”](#variable-import) | Property | Description | | ---------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | **Import Root Path** | Root component path on the PLCnext to browse for variables during signal import (default: `Arp.Plc.Eclr` for the IEC 61131-3 runtime). Leave empty to browse all components | | **Default Import Direction** | Default signal direction assigned to imported variables (`Input` or `Output`) | **Button:** * **Import Signals from PLC** — Connects to the controller from the Unity Editor, browses variables under the Import Root Path, and creates or updates realvirtual signal objects as children of the interface component. ## Quick Start [Section titled “Quick Start”](#quick-start) 1. Add the **Festo AX Controls (PLCnext)** component to a GameObject in your scene via **Add Component > realvirtual > Interfaces > Festo AX Controls (PLCnext)** 2. Add `REALVIRTUAL_FESTO` to **Edit > Project Settings > Player > Scripting Define Symbols** and recompile 3. Set **Host** to the IP address of your Festo controller 4. Enter your **Username** and **Password** 5. Configure **Import Root Path** to point to your PLC program (e.g. `Arp.Plc.Eclr`) 6. Click **Import Signals from PLC** — the interface connects, browses variables, and creates signal objects 7. Review the imported signals and set **Input** direction on any variables that Unity should write to the PLC 8. Press Play — the interface connects automatically and signal exchange starts ## Signal Address Format [Section titled “Signal Address Format”](#signal-address-format) Each signal stores its PLCnext variable path in the `Address` metadata field. The path format follows the PLCnext GDS convention: ```plaintext ComponentName/ProgramName.VariableName ``` **Examples:** | Signal | Address | | -------------------- | ----------------------------------------------------- | | Boolean motor status | `Arp.Plc.Eclr/MainInstance.Motor1_Running` | | Integer counter | `Arp.Plc.Eclr/MainInstance.PartCounter` | | Array element | `Arp.Plc.Eclr/MainInstance.ConveyorSpeeds[0]` | | Array slice | `Arp.Plc.Eclr/MainInstance.ConveyorSpeeds[0:9]` | | Struct field | `Arp.Plc.Eclr/MainInstance.DriveState.ActualPosition` | The component name for the standard IEC 61131-3 (Eclr) runtime is `Arp.Plc.Eclr`. Your program instance name is the name assigned to the program in the PLCnext Engineer project. ## Communication Modes [Section titled “Communication Modes”](#communication-modes) ### Subscription Mode (default) [Section titled “Subscription Mode (default)”](#subscription-mode-default) When **Use Subscription** is enabled, the interface registers all output signals with the PLCnext subscription service. The controller pushes updated values at the configured **Subscription Cycle Ms** rate. This is the recommended mode for real-time simulation as it minimizes latency and reduces network overhead. If the PLCnext firmware does not support the subscription service, the interface automatically falls back to polling mode and logs a warning. ### Polling Mode [Section titled “Polling Mode”](#polling-mode) When **Use Subscription** is disabled, the interface performs a batched read of all output signal addresses each communication cycle. This mode is compatible with all PLCnext firmware versions but has higher latency than subscription mode. Input signals (Unity writing to the PLC) always use batched write operations regardless of which mode is selected. On the first cycle after connection, all input values are sent to initialize the PLC state. ## Importing Signals from PLC [Section titled “Importing Signals from PLC”](#importing-signals-from-plc) The **Import Signals from PLC** editor button provides one-click signal discovery: 1. The interface connects to the controller using the configured credentials 2. Variables are browsed from **Import Root Path** using the PLCnext variable browse service 3. For each discovered variable, a realvirtual signal object is created as a child of the interface component 4. The `Address` metadata field is set to the full PLCnext instance path 5. All imported signals receive the **Default Import Direction** — change individual signals to `Input` for variables that Unity should write back to the PLC Supported PLCnext data types map to realvirtual signal types as follows: | PLCnext Types | realvirtual Signal Type | | --------------------------------------------------------------- | ----------------------- | | `BOOL` | Bool | | `INT`, `UINT`, `SINT`, `DINT`, `UDINT`, `BYTE`, `WORD`, `DWORD` | Int | | `REAL`, `LREAL` | Float | | `STRING`, `WSTRING` | Text | Variables with unsupported types are skipped and a warning is logged to the Unity console. ## See Also [Section titled “See Also”](#see-also) * [Interfaces Overview](/doc/unity/components-and-scripts/interfaces/) — All available interfaces * [Signal Manager](/doc/unity/components-and-scripts/interfaces/signal-manager/) — Managing PLC signals * [Custom Interfaces](/doc/unity/components-and-scripts/interfaces/custom-interfaces/) — How to build your own interface * [Compiler Defines](/doc/unity/advanced-topics/compiler-defines/) — Adding scripting define symbols * [Keba Interface (Pro)](/doc/unity/components-and-scripts/interfaces/keba-interface/) — Similar RSC-based controller interface * [TwinCAT (Pro)](/doc/unity/components-and-scripts/interfaces/twincat/) — Another IEC 61131-3 based interface *** © 2025 realvirtual GmbH [https://realvirtual.io](https://realvirtual.io/) - All rights reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or by any means, including printing, saving, photocopying, recording, or other electronic or mechanical methods, without the prior written permission of the publisher. # FMI / FMU (Pro) Note This interface was completely rebuilt in realvirtual **6.3.5** (Professional) on top of a new high-performance native co-simulation core. It replaces the previous, deprecated FMI integration. ## Overview [Section titled “Overview”](#overview) The FMI interface connects **FMUs (Functional Mock-up Units)** to your realvirtual simulation. FMI (Functional Mock-up Interface) is the open industry standard for exchanging simulation models, supported by more than 150 tools such as Modelica, Dymola, Simulink, Amesim and OpenModelica (see [fmi-standard.org](https://fmi-standard.org)). With the **FMU Interface** you can bring validated physics and controls models — hydraulic cylinders, electrical drives, thermal models, controllers — directly into your virtual commissioning scene. The FMU calculates its dynamics in perfect sync with the Unity physics timestep, and all FMU variables appear as ordinary realvirtual PLC signals that you connect to Drives, Behaviors and other components like signals from any other interface. The interface supports **FMI 2.0 Co-Simulation** FMUs with a Windows 64-bit binary. ![FMU Interface with imported BouncingBall signals](/doc/unity/assets/fmu-interface-inspector.png) FMU Interface running the BouncingBall reference FMU — the imported signals appear as children of the interface ## Quick Start [Section titled “Quick Start”](#quick-start) 1. Copy your `.fmu` file into `Assets/StreamingAssets/FMU/` (create the folder if it does not exist). StreamingAssets is required so the FMU is available as a real file in built applications. 2. Add the component **realvirtual > Interfaces > FMU (FMI 2.0)** to an empty GameObject. 3. Enter the file name (e.g. `BouncingBall.fmu`) into **Fmu File**. 4. Click **⬇️ Import Signals**. All FMU inputs, outputs and tunable parameters are created as signal GameObjects under the interface — in Edit Mode, so you can wire them to your components before pressing Play. 5. Connect the signals to your scene (Drives, Behaviors, custom scripts) and press Play. The interface loads the FMU, shows 🟢 Connected, and steps the model in sync with the physics. ## Key Properties [Section titled “Key Properties”](#key-properties) **Fmu File** (string) The `.fmu` package to load. Relative names are resolved against *Assets/StreamingAssets/FMU/*; absolute paths are used as-is. **Step Mode** (enum) How the co-simulation is advanced. **Physics Synced** (default) performs exactly one macro step per FixedUpdate with the Unity physics timestep — FMU time stays identical to the simulation time, and pause or `Time.timeScale` changes are honored automatically. **Free Running** steps the FMU on a background cycle independent of physics, e.g. for faster-than-realtime co-simulation. **Step Size** (float, seconds) In Physics Synced mode this is the internal *sub-step* resolution: the physics timestep is divided into equal sub-steps of approximately this size (values equal to or larger than the physics timestep result in exactly one step per FixedUpdate). In Free Running mode it is the fixed macro step per communication cycle. The step size is never derived from frame time — co-simulation stays deterministic. **Tolerance** (float) Solver tolerance passed to the FMU at initialization. **Allow Viewer To Fmu** (bool) If enabled, values written to the PLC input signals (from Unity, the WebViewer or MCP) are sent into the FMU before each step. If disabled, input signals are ignored. **Import Signals** (button) Creates or updates the FMU’s signals in Edit Mode by reading the FMU’s own `modelDescription.xml` — no manual signal mapping needed. Re-importing is safe: existing signals keep their user-set values. ## Signals [Section titled “Signals”](#signals) Signals are named **`.`** (e.g. `BouncingBall.h`) and follow the standard realvirtual convention: | FMU variable | realvirtual signal | Direction | | ----------------------------- | ------------------------------------------ | ----------- | | Output / calculated parameter | `PLCOutputFloat` / `Int` / `Bool` / `Text` | FMU → scene | | Input / tunable parameter | `PLCInputFloat` / `Int` / `Bool` / `Text` | Scene → FMU | | Fixed parameter, local, time | *(no signal)* | internal | Input signals are initialized with the FMU’s declared start values, so the model behaves exactly as designed until you change an input. Fixed (non-tunable) parameters cannot be changed after FMU initialization — this is defined by the FMI standard — and therefore get no signal. Each FMU Interface hosts exactly one FMU. To use several FMUs in one scene, add one interface per FMU. ## Common Use Cases [Section titled “Common Use Cases”](#common-use-cases) * **Detailed component physics** – Simulate a pneumatic cylinder, hydraulic axis or electrical drive with a validated FMU model instead of approximating it in Unity. * **Controls-in-the-loop** – Run a controller model exported from Simulink or Modelica against your virtual machine. * **Plant models for virtual commissioning** – Couple domain-specific simulation models (thermal, fluid, mechanical) developed by simulation specialists into the commissioning scene. * **Live model tuning** – Tunable FMU parameters are ordinary input signals; adjust them at runtime from the Inspector, the WebViewer or MCP. ## Error Behavior [Section titled “Error Behavior”](#error-behavior) The interface degrades cleanly: if the native core or the FMU file is missing, the interface simply stays **Disconnected** and logs a warning — the scene never crashes. FMU step rejections (`fmi2Discard`) and errors are reported in the Console with the FMU’s own log messages. ## See Also [Section titled “See Also”](#see-also) * [Simulink Interface](/doc/unity/components-and-scripts/interfaces/simulink/) — direct MathWorks Simulink co-simulation * [Custom Interfaces](/doc/unity/components-and-scripts/interfaces/custom-interfaces/) — building your own interface # igus iRC Interface > Interface to igus iRC Robot Controllers The **igus iRC Interface** connects and controls igus robots via the igus Robot Control (iRC) software. It supports all igus robot kinematics controllable through iRC, including the ReBeL 6DOF, SCARA 4DOF, delta robots, and linear robots with variable axis counts. Note This feature was updated in realvirtual **6.0.10** with support for variable axis counts, speed control, position-based motion commands, and inverse kinematics via CRI. ![](/doc/unity/assets/igus-properties.png) igus iRC Interface properties ## Adding the Interface [Section titled “Adding the Interface”](#adding-the-interface) Add the interface via the realvirtual menu: **Tools > realvirtual > Add Interface > igus iRC**. ![](/doc/unity/assets/igus-addinterface.png) Adding the igus iRC Interface from the menu ## Prerequisites [Section titled “Prerequisites”](#prerequisites) The igus Robot Control Software (iRC) is freely available at . igus Robot Control Software enables simple and intuitive robot programming and control systems. Thanks to the modular structure, various robot kinematics including delta robots, linear robots and multi-axis robots can be controlled. The software can simulate individual movements on a 3D surface without a physical robot connected. We deliver one example robot, the igus ReBeL, but after importing step data and defining the kinematic and drives, all other igus robots controllable by iRC can be used. ## Properties [Section titled “Properties”](#properties) **Active** (enum) Determines when the interface is active. Options include: * **Always**: The interface is active at all times. * **Connected**: Only active when realvirtual.io is in “Connected Mode”. * **Disconnected**: Only active in “Disconnected Mode”. * **Never**: The interface is deactivated. See more about connection states: [Runtime UI - Connection Status](/doc/unity/basics/runtime-ui/#connection-status) **Is Connected** (boolean, read-only) Displays the current connection status to the igus robot controller. **Address** (string) IP address of the igus iRC controller. Use `127.0.0.1` for local connections. **Port** (integer) Port number for the CRI connection. Default is `3921`. **Drives** (list) The robot axis drives. Each drive corresponds to one robot joint. The interface supports variable axis counts from 1 to 9 axes, making it compatible with all igus robot types (6DOF, 4DOF SCARA, delta, etc.). **Num Outputs** (integer, read-only) Number of digital output signals from the robot to realvirtual. **Num Inputs** (integer, read-only) Number of digital input signals from realvirtual to the robot. **Speed** (float, slider 0–100) Controls the robot movement speed as a percentage. Changing this value sends an updated override speed to the iRC controller in real time. **Is Moving To Target** (boolean, read-only) Indicates whether the robot is currently executing a position-based move command. **Target** (RebelTarget, read-only) The current target the robot is moving towards during a position-based move. **Kinematic Error** (boolean, read-only) Indicates whether the last inverse kinematics calculation returned an error from the iRC controller. **Active Command On Start** (boolean) When enabled, sends the initial command activation sequence to the iRC controller on connection start. **Debug Mode** (boolean) Enables detailed logging of all CRI protocol messages sent to and received from the robot controller. Useful for troubleshooting communication issues. **On Move Finished** (UnityEvent) Event invoked when a position-based move command completes. Use this to chain movements or trigger actions after the robot reaches its target. ## Robot Commands [Section titled “Robot Commands”](#robot-commands) The interface provides methods for controlling robot motion programmatically or via RebelTarget components. **MoveToPosition** moves the robot to a RebelTarget with configurable offset, speed, and motion type (PTP or linear). **MoveToPositionAsync** provides the same functionality as an awaitable async method for use in coroutines or async workflows. **SetSpeed** updates the robot speed override (0–100%) in real time. **SetRobotOutput** controls digital outputs on the robot controller. **SetActive** enables or disables the robot controller. ### RebelTarget [Section titled “RebelTarget”](#rebeltarget) The **RebelTarget** component defines a target position and rotation for the robot. Attach it to a GameObject whose transform represents the desired robot end-effector pose. Assign it to the interface’s motion commands to move the robot to that position. ### Inverse Kinematics [Section titled “Inverse Kinematics”](#inverse-kinematics) The interface supports inverse kinematics calculations via the CRI protocol. Use **GetJointAngles** to retrieve current joint positions and **CalculateAngles** to compute joint angles for a given Cartesian pose. The **Kinematic Error** property indicates if the last IK calculation failed (e.g., target out of reach). ## Inputs and Outputs [Section titled “Inputs and Outputs”](#inputs-and-outputs) The igus iRC Interface communicates with the robot controller using **Global Signals** and **Digital Outputs**. Note **Note**: Digital Inputs on the igus robot cannot be controlled directly from the simulation. These inputs are controlled by the robot controller. Use Global Signals instead. **Global Signals**: Serve as inputs to the robot controller and must be configured within the iRC software’s **Project Configuration**. **Digital Outputs**: Robot controller outputs that send digital signals back to the simulation in realvirtual. ![](/doc/unity/assets/igusrebel-ios.png) Connected IOs between realvirtual and iRC To use **Global Signals** as inputs, set them up in the **Project Configuration** within the iRC software. Once configured, these inputs can be controlled from realvirtual through the assigned `PLCInputBool` signals. ![](/doc/unity/assets/igusrebel-global.png) Project configuration of iRC for defining Global Signals ### Setting Up Digital I/O Signals [Section titled “Setting Up Digital I/O Signals”](#setting-up-digital-io-signals) To use digital I/O with the igus iRC Interface, create child GameObjects under the interface GameObject and add the appropriate signal components: 1. **Digital Outputs (DOut)**: Add a `PLCOutputBool` component to a child GameObject for each digital output you want to receive from the robot controller. These correspond to `DOut21`, `DOut22`, etc. in the iRC software. 2. **Global Signals (GSig)**: Add a `PLCInputBool` component to a child GameObject for each global signal you want to send to the robot controller. These correspond to `GSig1`, `GSig2`, etc. in the iRC software. Set the **Num Outputs** and **Num Inputs** properties on the interface to match the number of digital output and input signals you have configured. **Signal Assignment Logic** There are two ways to assign signals to the iRC controller: **Option 1: Sequential Assignment (Default)** If no SymbolName is set on the signal, signals are assigned sequentially based on their hierarchy order: * **Digital Outputs (DOut)**: The first `PLCOutputBool` maps to `DOut21`, the second to `DOut22`, and so on. * **Global Signals (GSig)**: The first `PLCInputBool` maps to `GSig1`, the second to `GSig2`, and so on. **Option 2: Explicit Assignment via SymbolName** You can set the **SymbolName** property on a signal to explicitly assign it to a specific DOut or GSig number. For example, setting SymbolName to `25` on a `PLCOutputBool` maps it directly to `DOut25`, regardless of its position in the hierarchy. This is useful when you need non-sequential signal mapping or when the hierarchy order does not match the iRC signal numbering. Caution When using sequential assignment, make sure the order of your `PLCOutputBool` and `PLCInputBool` signals in the hierarchy matches the order of the corresponding DOut/GSig signals in the iRC software configuration. ## See Also [Section titled “See Also”](#see-also) * [Drives](/doc/unity/components-and-scripts/motion/drive/) * [Interfaces Overview](/doc/unity/components-and-scripts/interfaces/) # Interface Tools **Interface Tools** in **realvirtual.io** are specialized utilities designed to **handle interfaces and signals** efficiently. # OnValueChangedReconnect The **OnValueChangedReconnectInterface** component is designed to work in combination with [Runtime Persistence](/doc/unity/basics/runtime-ui/runtime-persistence/). It ensures that when a connection-related property is modified, the associated interface is properly reinitialized by disconnecting and reconnecting automatically. ![](/doc/unity/assets/reconnectonvaluechanged.png) ### **How It Works** [Section titled “How It Works”](#how-it-works) 1. **Triggered on Value Change** * This script provides a **public method** that can be invoked when a **property changes** (e.g., an IP address in Runtime Persistence). 2. **Automatic Interface Reconnection** * After the method is called, the script **disconnects** the interface. * It then **waits for the specified delay** before **reconnecting** to ensure reinitialization. 3. **Ensures Proper Communication** * Necessary when **network properties or connection settings** change dynamically. * Prevents the need for a **manual restart** when modifying connection parameters. # Signal Catcher The Signal Catcher is a tool designed to automatically collect and organize signals within a loaded scene. This is particularly useful when signals are included in imported prefabs or when using multiple interfaces of the same type across different additive scenes. By using the **Signal Catcher**, all signals in the scene(s) are gathered and assigned under a single interface, ensuring seamless integration and signal management. ![](/doc/unity/assets/signalcatcher.png) ### **How It Works** [Section titled “How It Works”](#how-it-works) 1. **Placement**: The **Signal Catcher** must be **placed under an interface** GameObject. 2. **Automatic Collection**: When used, it **automatically detects all signals** in the scene(s). 3. **Signal Reassignment**: It reassigns these signals as **children** of the interface. 4. **Interface Reconnection**: After importing all signals, it **reconnects the interface**, ensuring it is properly linked to the correct signals. ### **Properties** [Section titled “Properties”](#properties) | **Property** | **Description** | | -------------------------- | ----------------------------------------------------------------------------------------------------------- | | **Ignore This** | Allows specifying objects whose child signals should be ignored during the signal collection process. | | **List is Empty** | If no objects are listed, all signals in the scene(s) will be collected. | | **Only Interface Signals** | *(Checkbox)* If enabled, only signals related to **interfaces** will be collected, excluding other signals. | # Signal Importer Exporter > Standard Signal Import and Export Interface The Signal Importer Exporter is a tool that enables the import and export of signals in a standardized neutral format to facilitate seamless integration between different systems requiring signal interfaces. It stores the data in a JSON file, making it easy to exchange information between applications, controllers, and automation environments. The Signal Importer Exporter can be attached to any GameObject that represents an interface in realvirtual.io. It automatically detects and imports/exports all signals located underneath that GameObject in the hierarchy. 📎 [signalimporterexporter.png](/doc/unity/assets/signalimporterexporter.png) ### **Properties** [Section titled “Properties”](#properties) #### **Signal Paths** [Section titled “Signal Paths”](#signal-paths) * **Signal Import List File Path**: Specifies the location of the import file. * **Signal Export File Path**: Defines the folder where exported signals will be saved. * **Signal Export Filename**: Name of the JSON file for exported signals (e.g., `SignalExport.json`). #### **Action Buttons** [Section titled “Action Buttons”](#action-buttons) * **Import Signals**: Loads signals from the defined **import file**. * **Export Signals**: Saves the current signals to the **specified export file**. * **Select Signal Import File**: Allows the user to choose an import file. * **Select Signal Export Folder**: Enables selection of an export folder. ### **Example Signal Export File** [Section titled “Example Signal Export File ”](#example-signal-export-file) Here’s a sample exported JSON structure showing how signals are organized: ```json { "Signals": [ { "Name": "IO.Input.Robot.bStatusLoading", "Symbolname": "", "Comment": "", "Type": "BOOL", "Direction": "INPUT", "Folder": "--- Robot Overall Status ----" }, { "Name": "IO.Input.Robot.bStatusUnloading", "Symbolname": "", "Comment": "", "Type": "BOOL", "Direction": "INPUT", "Folder": "--- Robot Overall Status ----" }, { "Name": "IO.Output.Robot.bStartLoading", "Symbolname": "", "Comment": "", "Type": "BOOL", "Direction": "OUTPUT", "Folder": "--- Start Robot Programms ---" }, ``` #### **Key Properties in the JSON File** [Section titled “Key Properties in the JSON File”](#key-properties-in-the-json-file) | **Property** | **Description** | | -------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | **Name** | *(Optional - Name or Symbolname must be filled)* The readable name of the signal. If no `Symbolname` is provided, this value is also used as the **unique ID (symbol name)** of the signal. If a `Symbolname` is defined, this name is used only for display in **realvirtual.io**. | | **Symbolname** | *(Optional - Name or Symbolname must be filled)* The actual **symbol name (ID)** of the signal. If left empty, the `Name` field is used as the symbol name. | | **Comment** | *(Optional)* A description or note about the signal, useful for documentation. Can be empty. | | **Type** | The **data type** of the signal. Possible values: `"INT"`, `"BOOL"`, `"FLOAT"`, `"TEXT"`. | | **Direction** | The **signal direction**, indicating whether it is an **input or output**. Possible values: `“INPUT”` or `“OUTPUT”`. - **INPUT**: The signal is **received** from an external source (e.g., a PLC or hardware system). - **OUTPUT**: The signal is **sent** to an external system. | | **Folder** | *(Optional)* Defines a **grouping folder** for organizing signals in **realvirtual.io**. This allows signals to be structured under **empty GameObjects** in Unity for better organization. | # Signal Manager > for automatically connecting signals with the model Caution This is a function for professional users who want to manage big simulations with a big number of signals. The Signal Manager is used to automatically link imported signals to specific PLC Signals within your realvirtual.io project. Additionally, Signals that are not linked can be deleted or deactivated. Depending on your rules for automatic connection, an appropriate script must be added. The Signal Manager also offers the possibility to automatically create signals in your realvirtual.io project if no suitable signals are found in the already existing and previously imported signals. Note If you have thousands of unused and unconnected Signals in your project after importing the signals, you can significantly improve the startup time of your simulation if you disable or delete unconnected Signals. ![](/doc/unity/assets/signalmanager.png) ### How to use the signal manager[](#how-to-use-the-signal-manager) [Section titled “How to use the signal manager ”](#how-to-use-the-signal-manager) To use the Signal Manager, it must be added as a component to the game object that contains the imported signals as subcomponents (and usually the interface itself). To get an overview of the number of connected and unconnected signals, you can select “Check Signals”. This will update the information displayed in the Signal Manager. ### Component elements [Section titled “Component elements”](#component-elements) **AutoConnectLevels**\ In the “AutoConnectLevels” list you specify for which game objects (and child objects) the signal connection should be performed. This way you avoid checking and connecting parts of the simulation model where you don’t want to perform an automatic signal creation or connection. **Check signals**.\ Updates the signal information. **Disable unconnected signals**\ Disables all unconnected Signals. **Enable Unconnected Signals**\ Enables all unconnected Signals. **Delete Unconnected Signals**\ Deletes all unconnected Signals. **Delete automatically created signals**.\ Deletes all automatically created Signals, connected or disconnected. **Start and connect signal creation**\ Starts the automatic connection of Signals. Signals that are not found are created automatically. To use automatic signal connection and creation, you need to define your own custom user scripts that implement your connection and naming rule (see below). ### User scripts [Section titled “User scripts”](#user-scripts) The signal manager uses the custom script to assign the Signals. This script must be of type “AutoConnectBase”. Within the script you define how the matching should be done. One possibility is to use the definition of kinematic groups to assign the signals to a drive or a gripper, for example. The use of EditorUtility.SetDirty is necessary to update the editor. Below you will find a corresponding code example: ```csharp namespace realvirtual.io { public partial class AutoConnectExample : AutoConnectBase { public override bool AutoConnect(BehaviorInterface component) { var connected = false; var signalname = ""; Debug.Log($" Checking AutoConnect for " +component.name); /// Here you can define your connection rules, create signals and assign them to the behavior models Kinematic kin = component.GetComponent(); if (component.GetType() == typeof(Gripper)) { signalname = kin.GroupName + "_Oeffnen"; // define Signal name based on custom rule var signal = GetOrCreateSignal(signalname); // create the signal if not already there ((Gripper)component).OpenGripper = signal; // connect the signal to the behavior model EditorUtility.SetDirty(component); connected = true; signalname= kin.GroupName + "_Schliessen"; // define Signal name based on custom rule signal = GetOrCreateSignal(signalname); // create the signal if not already there ((Gripper)component).CloseGripper = signal; // connect the signal to the behavior model EditorUtility.SetDirty(component); connected = true; } if (component.GetType() == typeof(Drive_FollowPosition)) { signalname = kin.GroupName + "_Position"; var drivesignal = GetOrCreateSignal(signalname); ((Drive_FollowPosition)component).Position = drivesignal; // connect the signal to the behavior model EditorUtility.SetDirty(component); connected = true; } return connected; } } } ``` After import and matching you can check the matching it by using “Check for unconnected Signals”. According to that it is possible to delete automatically created or unconnected signals. © 2025 realvirtual GmbH [https://realvirtual.io](https://realvirtual.io/) - All rights reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or by any means, including printing, saving, photocopying, recording, or other electronic or mechanical methods, without the prior written permission of the publisher. # Keba Interface (Pro) The **Keba Interface** provides high-performance communication with Keba automation controllers. ## Overview [Section titled “Overview”](#overview) The Keba Interface enables real-time bidirectional data exchange between Unity simulations and Keba automation controllers. This Professional-only interface supports automatic variable import, pattern-based signal direction detection, and efficient variable subscription for optimal performance. The interface connects to Keba controllers using standard network communication protocols. Variables can be automatically imported from the controller or manually configured as needed. Note This interface requires **realvirtual Professional** and communicates with Keba automation controllers that support variable services. ## Installation [Section titled “Installation”](#installation) The Keba Interface is included in realvirtual Professional and can be added to your scene through: 1. **Menu Method**: Select **Tools > realvirtual > Add Interface > Keba** 2. **Manual Method**: Add the `KebaInterface` script to an empty GameObject The interface files are located at: `Assets/realvirtual/Interfaces/Keba/` ## Properties [Section titled “Properties”](#properties) ![Keba Interface Inspector](/doc/unity/assets/keba-interface-inspector.png) ### Connection Settings [Section titled “Connection Settings”](#connection-settings) * **Base URL** (string): IP address or hostname of the Keba automation controller. Default: “192.168.1.100” * **Username** (string): Username for authentication with the Keba controller. Default: “Administrator” * **Password** (string): Password for authentication with the Keba controller. Default: “tobechanged” * **HTTP Port** (int): HTTP port number for controller communication. Default: 80 * **WebSocket Port** (int): Port number for variable service communication. Default: 80 * **Connection Timeout** (float): Connection timeout in seconds. Default: 5.0 ### Variable Import & Topics [Section titled “Variable Import & Topics”](#variable-import--topics) * **Import Root Paths** (list): Root paths to import variables from (e.g., “SYS”, “PLC”, “SYS.HW”). Default: \[“SYS”] * **Import Recursive** (boolean): Import variables recursively from subdirectories. Default: true * **Default Signal Direction** (enum): Default signal direction for imported variables (Input = Unity→Keba, Output = Keba→Unity). Default: Output * **Use Pattern Matching** (boolean): Use pattern matching on variable names to automatically determine signal direction. Default: true * **Input Patterns** (list): Name patterns to identify input signals (Unity→Keba). Default: \[“input”, “INPUT”] * **Output Patterns** (list): Name patterns to identify output signals (Keba→Unity). Default: \[“output”, “OUTPUT”] * **Output Topic Name** (string): Topic name for subscribing to output variables from Keba controller. Default: “realvirtual\_outputs” * **Input Topic Name** (string): Topic name for sending input variables to Keba controller. Default: “realvirtual\_inputs” * **Subscription Cycle Time Ms** (int): Update cycle time in milliseconds for variable subscriptions. Default: 20 * **Use OnChange Subscription** (boolean): Subscribe to variable changes only when they occur for better performance. Default: true ### Diagnostics [Section titled “Diagnostics”](#diagnostics) * **WebSocket Queue Size** (int): Current number of messages waiting in the communication queue (read-only) ## Controller Configuration [Section titled “Controller Configuration”](#controller-configuration) ### Enabling Variable Service [Section titled “Enabling Variable Service”](#enabling-variable-service) Configure your Keba automation controller to accept connections: 1. **Controller Settings**: * Enable variable service in controller configuration * Configure HTTP port (typically 80) for communication * Configure communication port (typically 80) for variable access * Ensure user account has appropriate permissions for variable access 2. **Network Settings**: * Ensure controller and Unity PC are on the same network * Configure static IP address for reliable connectivity * Test connectivity with ping command 3. **Security Settings**: * Use strong passwords instead of default “tobechanged” * Configure user permissions for variable read/write access * Ensure firewall allows communication on configured ports ### Variable Organization [Section titled “Variable Organization”](#variable-organization) For optimal performance and organization: 1. **Structure Variables**: Organize variables in logical paths (e.g., SYS for system variables, PLC for program logic) 2. **Use Naming Conventions**: Include “input” or “output” in variable names for automatic direction detection 3. **Group Related Variables**: Place related variables in same path for efficient batch operations ## Manual Signal Creation [Section titled “Manual Signal Creation”](#manual-signal-creation) For precise control over signal configuration, you can manually create individual signals. The interface automatically maps signals to Keba variables through metadata. ### Basic Setup Process [Section titled “Basic Setup Process”](#basic-setup-process) 1. **Add Interface to Scene**: * Create an empty GameObject and name it “KebaController” * Add the **KebaInterface** component * Configure the connection settings (IP address, username, password) 2. **Create Signal GameObject**: * Right-click the interface GameObject in the hierarchy * Select **Create Empty** to add a child GameObject * **Name it descriptively** (e.g., “ConveyorMotorStart”, “SystemStatus”, “TemperatureReading”) 3. **Add Signal Component**: * Select the signal GameObject * Add the appropriate signal component: * **PLCInputBool** - Send boolean values to Keba controller * **PLCOutputBool** - Read boolean values from Keba controller * **PLCInputFloat** - Send numeric values to Keba controller * **PLCOutputFloat** - Read numeric values from Keba controller 4. **Configure Signal Properties**: * **Name**: Set to match the Keba variable name exactly * **Comment**: Add documentation describing the signal purpose 5. **Set Keba Variable Metadata**: * The interface requires “KebaVariable” metadata to map signals to controller variables * This is typically set automatically through variable import * For manual setup, use the Signal Inspector metadata section Note **Automatic Mapping**: The interface automatically maps signal names to Keba variable names through metadata. Use the [Variable Import](/doc/unity/components-and-scripts/interfaces/keba-interface/#variable-import) feature for automatic setup, or manually configure metadata for custom mappings. ## Variable Import [Section titled “Variable Import”](#variable-import) The Variable Import feature allows automatic signal creation from Keba controller variables, dramatically reducing setup time for large systems. ### Import Process in Unity [Section titled “Import Process in Unity”](#import-process-in-unity) 1. **Configure Connection Settings**: * Set the **Base URL** to your Keba controller IP * Enter valid **Username** and **Password** * Verify **HTTP Port** matches controller configuration 2. **Configure Import Settings**: * **Import Root Paths**: Specify variable paths to import (e.g., “SYS”, “PLC”) * **Import Recursive**: Enable to import from subdirectories * **Pattern Matching**: Configure patterns to automatically detect signal directions * **Default Signal Direction**: Set fallback direction for variables that don’t match patterns 3. **Test Connection**: * Click **🔌 Test Connection** button to verify controller access * Verify authentication and variable access work correctly * Address any connection issues before importing 4. **Execute Import**: * Click **⬇️ Import Variables** button to start the import process * Monitor Unity Console for import progress and any warnings * Review created signals in the hierarchy ### Variable Path Examples [Section titled “Variable Path Examples”](#variable-path-examples) | Path | Description | Typical Contents | | ------- | --------------------- | --------------------------------------- | | SYS | System variables | Controller status, diagnostics | | PLC | PLC program variables | User program inputs/outputs | | SYS.HW | Hardware variables | I/O module status, hardware diagnostics | | SYS.CPU | CPU variables | CPU load, memory usage | ### Pattern Matching [Section titled “Pattern Matching”](#pattern-matching) The interface can automatically determine signal direction based on variable names: * **Input Patterns** (Unity→Keba): Variables containing “input” or “INPUT” become input signals * **Output Patterns** (Keba→Unity): Variables containing “output” or “OUTPUT” become output signals * **No Pattern Match**: Uses the Default Signal Direction setting ### Post-Import Organization [Section titled “Post-Import Organization”](#post-import-organization) After successful import, you’ll have: * **Organized signals**: Each variable becomes a properly configured signal GameObject * **Correct direction**: Automatically determined from patterns or default setting * **Metadata mapping**: “KebaVariable” metadata links signals to controller variables * **Ready-to-use signals**: Immediately available for connection to simulation components ## Supported Data Types [Section titled “Supported Data Types”](#supported-data-types) The interface supports standard Keba automation data types: | Keba Type | realvirtual Signal | Description | Usage | | ------------ | ------------------ | ------------------------ | ------------------------------------ | | BOOL | Bool | Boolean values | Digital inputs/outputs, status flags | | STRING | Text | Text strings | Messages, status text | | DWORD, UDINT | Int | 32-bit unsigned integers | Counters, large values | | DINT, INT | Int | Signed integers | Position values, temperatures | | UINT, WORD | Int | 16-bit unsigned integers | Small counters, status codes | | BYTE | Int | 8-bit unsigned integers | Small values, flags | | REAL | Float | 32-bit floating point | Speed values, measurements | | LREAL | Float | 64-bit floating point | High-precision values | ## Troubleshooting [Section titled “Troubleshooting”](#troubleshooting) ### Connection Issues [Section titled “Connection Issues”](#connection-issues) **Cannot connect to controller**: 1. Verify controller IP address is correct 2. Check HTTP and WebSocket ports match controller configuration 3. Test with ping command: `ping 192.168.1.100` 4. Verify firewall settings allow communication on configured ports 5. Check controller is powered on and network accessible **Authentication failures**: * Verify username and password are correct * Check user account has appropriate permissions * Ensure account is not locked or expired * Try using default credentials if changed recently ### Import Issues [Section titled “Import Issues”](#import-issues) **Variable import fails**: * Use **Test Connection** button to verify controller access first * Check Import Root Paths exist in controller * Verify user permissions allow variable enumeration * Review Unity Console for specific error messages **No variables found**: * Verify specified paths contain variables * Check Import Recursive setting if variables are in subdirectories * Ensure controller has variables configured in specified paths ### Communication Issues [Section titled “Communication Issues”](#communication-issues) **Slow update rates**: * Reduce Subscription Cycle Time Ms for faster updates * Enable Use OnChange Subscription for event-driven updates * Check network latency between Unity and controller * Monitor communication queue size for bottlenecks **Communication disconnections**: * Check network stability and bandwidth * Increase Connection Timeout if network is slow * Monitor controller CPU load during high-frequency updates * Review Unity Console for specific communication errors ### Performance Issues [Section titled “Performance Issues”](#performance-issues) **High communication queue size**: * Indicates messages are arriving faster than Unity can process * Reduce variable subscription rate in controller * Increase Unity’s Update Cycle Ms setting * Consider subscribing to fewer variables simultaneously **Memory usage increases**: * Check for message queue buildup in diagnostics * Verify proper connection cleanup on interface shutdown * Monitor Unity Profiler for memory allocation patterns ## See Also [Section titled “See Also”](#see-also) * [Signal Manager](/doc/unity/components-and-scripts/interfaces/signal-manager/) - Managing and organizing signals * [Signal Importer Exporter](/doc/unity/components-and-scripts/interfaces/signal-importer-exporter/) - Import and export signal configurations * [Custom Interfaces](/doc/unity/components-and-scripts/interfaces/custom-interfaces/) - Creating custom interfaces * [MQTT Interface](/doc/unity/components-and-scripts/interfaces/mqtt/) - Similar network-based communication interface ## External Resources [Section titled “External Resources”](#external-resources) * [Keba Automation](https://www.keba.com/) - Official Keba automation products and documentation © 2025 realvirtual GmbH [https://realvirtual.io](https://realvirtual.io/) - All rights reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or by any means, including printing, saving, photocopying, recording, or other electronic or mechanical methods, without the prior written permission of the publisher. # KUKA (Pro) > >- The **KUKA Interface** component provides TCP/IP communication with KUKA OfficeLite virtual controllers using the Y200 protocol through the OpenCommissioning OC\_Assistant\_OfficeLite server. This integration enables real-time exchange of robot axis values and digital I/O signals between Unity and KUKA virtual controllers for digital twin applications and virtual commissioning. > **Big thanks to OpenCommissioning** for making the OC\_Assistant\_OfficeLite code available at , enabling seamless KUKA robot integration with realvirtual. **Important**: This interface is designed specifically for KUKA OfficeLite virtual controllers and requires the OC\_Assistant\_OfficeLite server to function. > **Beta Notice**: This KUKA interface is currently in beta. If you experience any problems or need assistance, please feel free to get in direct contact with us for support. ## Overview [Section titled “Overview”](#overview) The KUKA interface implements the Y200 communication protocol specifically for KUKA OfficeLite virtual controllers, providing bidirectional data exchange over TCP/IP through the OC\_Assistant\_OfficeLite server. This interface enables creating digital twins of KUKA robot systems using virtual controllers, allowing for cost-effective simulation and virtual commissioning without requiring physical robot hardware. Key capabilities include: * Real-time robot axis position monitoring (6 axes) * Digital I/O signal exchange (up to 8192 inputs/outputs) * Automatic connection management with reconnection support * Thread-safe communication for reliable data exchange * Signal creation utilities for quick setup The interface communicates using the KUKA Y200 Server protocol on port 54600 (default), exchanging 1144 bytes from the controller (outputs and axis data) and 1024 bytes to the controller (inputs). For virtual commissioning scenarios, the interface can connect to KUKA OfficeLite controllers running the OC\_Assistant\_OfficeLite Y200 server. ![KUKA Interface Inspector](/doc/unity/assets/kuka-interface-inspector.png) The KUKA interface provides comprehensive configuration options through the Unity Inspector, including connection settings, signal configuration, real-time axis monitoring, and status information. ## Properties [Section titled “Properties”](#properties) ### Connection Settings [Section titled “Connection Settings”](#connection-settings) **Server IP** (string) specifies the IP address of the KUKA Y200 server. Default value is 127.0.0.1 for local connections with KUKA OfficeLite virtual controllers. For real robot controllers or external simulations, enter the controller’s IP address on your network. When using OfficeLite with the OC\_Assistant\_OfficeLite server, this typically remains 127.0.0.1 for local development. **Server Port** (integer) defines the TCP port for Y200 communication. The standard KUKA Y200 port is 54600. This rarely needs to be changed unless your controller is configured for a different port. **Connection Timeout Ms** (integer) sets the maximum time in milliseconds to wait for a connection before failing. Default is 5000ms (5 seconds). Increase this value for connections over slower networks or when connecting to busy controllers. ### Signal Configuration [Section titled “Signal Configuration”](#signal-configuration) **Max Digital Signals** (integer) determines how many digital I/O signals to create and manage. The value can range from 1 to 8192 to match KUKA’s $IN and $OUT arrays. Default is 100 for performance optimization. Only create the number of signals you actually need, as processing thousands of unused signals impacts performance. ### Status (Read-Only) [Section titled “Status (Read-Only)”](#status-read-only) **Current Axis Values** (float array) displays real-time robot axis positions in degrees for axes 1-6. These values are continuously updated from the KUKA controller and can be used to drive robot visualization or monitor robot state. **Active Inputs** (integer) shows the count of active input signals (InBool) currently configured and being monitored. This helps verify that signals are properly created and recognized. **Active Outputs** (integer) indicates the number of active output signals (OutBool) currently configured and being monitored. Use this to confirm output signal configuration. ### State [Section titled “State”](#state) **State** displays the current connection status (Disconnected, Connecting, Connected, or Error). Monitor this to ensure proper communication with the KUKA controller. **Input Signals** shows the total number of input signals detected in the interface hierarchy. **Output Signals** displays the total number of output signals found in the interface hierarchy. **Comm Cycle Ms** indicates the communication cycle time in milliseconds, showing how frequently data is exchanged with the controller. **Cycle Count** tracks the total number of successful communication cycles since connection was established. ### Configuration [Section titled “Configuration”](#configuration) **Update Cycle Ms** (integer) sets the communication update interval in milliseconds. Default is 10ms for smooth real-time updates. Increase this value to reduce network traffic or CPU usage. **Only Transmit Changed Inputs** (boolean) when enabled, optimizes communication by only sending input values that have changed since the last cycle. This reduces processing overhead for systems with many signals. **Auto Reconnect** (boolean) enables automatic reconnection attempts when the connection is lost. Recommended for production systems to maintain connectivity. **Reconnect Interval Seconds** (integer) defines how long to wait between reconnection attempts. Default is 10 seconds to avoid overwhelming the controller with connection requests. **Max Reconnect Attempts** (integer) limits the number of reconnection attempts before giving up. Set to -1 for unlimited attempts. **Debug Mode** (boolean) enables detailed logging of communication activities for troubleshooting connection issues or protocol problems. ## Signal Naming Convention [Section titled “Signal Naming Convention”](#signal-naming-convention) The KUKA interface uses specific signal naming patterns that map to KUKA system variables: ### Robot Axes [Section titled “Robot Axes”](#robot-axes) * **Axis1** to **Axis6**: PLCOutputFloat signals representing robot joint positions in degrees * These map directly to the robot’s current axis positions ### Digital Inputs [Section titled “Digital Inputs”](#digital-inputs) * **InBool0** to **InBool8191**: PLCInputBool signals * InBool0 maps to KUKA $IN\[1] * InBool8191 maps to KUKA $IN\[8192] * Note the offset: Unity uses 0-based indexing while KUKA uses 1-based ### Digital Outputs [Section titled “Digital Outputs”](#digital-outputs) * **OutBool0** to **OutBool8191**: PLCOutputBool signals * OutBool0 maps to KUKA $OUT\[1] * OutBool8191 maps to KUKA $OUT\[8192] * Same offset applies as with inputs ## Usage [Section titled “Usage”](#usage) ### Basic Setup [Section titled “Basic Setup”](#basic-setup) 1. **Add the KUKA Interface component** to an empty GameObject in your scene 2. **Configure the connection** by setting the Server IP to your KUKA controller’s address: * For OfficeLite virtual controllers: Use 127.0.0.1 (localhost) * For real controllers: Use the controller’s network IP address 3. **Click “Create Standard Signals”** button to automatically generate the signal structure 4. **Enable the interface** by checking the Active checkbox 5. **Monitor the State** property to confirm successful connection ### Signal Structure [Section titled “Signal Structure”](#signal-structure) When you click “Create Standard Signals”, the interface automatically creates a organized hierarchy: ```plaintext KukaInterface ├── Axes │ ├── Axis1 (PLCOutputFloat) │ ├── Axis2 (PLCOutputFloat) │ ├── Axis3 (PLCOutputFloat) │ ├── Axis4 (PLCOutputFloat) │ ├── Axis5 (PLCOutputFloat) │ └── Axis6 (PLCOutputFloat) ├── Inputs │ ├── InBool0 (PLCInputBool) │ ├── InBool1 (PLCInputBool) │ └── ... (up to MaxDigitalSignals) └── Outputs ├── OutBool0 (PLCOutputBool) ├── OutBool1 (PLCOutputBool) └── ... (up to MaxDigitalSignals) ``` ### Connecting to Robot Drives [Section titled “Connecting to Robot Drives”](#connecting-to-robot-drives) To visualize robot movement in Unity: 1. Create or import your KUKA robot model in Unity 2. Add Drive components to each robot joint 3. **Enable Follow Position**: Set the Drive’s **Follow Position** property to true so the drive follows external position commands 4. Connect the axis signals to your drives: * Select each Drive component * In the PLC Output Float field, drag the corresponding Axis signal (e.g., Axis1 for joint 1) * The drive will now follow the real robot’s position in real-time ### Working with Digital I/O [Section titled “Working with Digital I/O”](#working-with-digital-io) Digital signals can be used for: * **Safety interlocks**: Monitor safety gates, emergency stops * **Process control**: Trigger grippers, tools, or other equipment * **Status indication**: Show robot state, program status, error conditions Example: Controlling a gripper through KUKA I/O: 1. In your KRL program, set $OUT\[10] to control the gripper 2. In Unity, OutBool9 (remember the offset) will reflect this state 3. Connect OutBool9 to your gripper component’s activation signal ### Performance Optimization [Section titled “Performance Optimization”](#performance-optimization) For systems with many signals: 1. **Set Max Digital Signals** to only what you need (not the maximum 8192) 2. **Enable “Only Transmit Changed Inputs”** to reduce network traffic 3. **Increase Update Cycle Ms** if real-time response isn’t critical 4. **Use the signal cache** by avoiding dynamic signal creation during runtime ### Network Configuration [Section titled “Network Configuration”](#network-configuration) Ensure proper network setup: 1. **Firewall rules**: Allow TCP port 54600 (or your configured port) 2. **Network isolation**: Keep robot networks separate from general IT networks 3. **Latency**: For best performance, keep Unity and KUKA controller on the same subnet 4. **Y200 Server**: Ensure the Y200 server is running: * For real controllers: Y200 server must be installed and running * For OfficeLite: Install and run the OC\_Assistant\_OfficeLite server ### KUKA OfficeLite Integration [Section titled “KUKA OfficeLite Integration”](#kuka-officelite-integration) For virtual commissioning without real hardware, you can use KUKA OfficeLite with the OpenCommissioning OC\_Assistant\_OfficeLite server: #### Installing OfficeLite Server [Section titled “Installing OfficeLite Server”](#installing-officelite-server) 1. **Download KUKA OfficeLite** from the KUKA website (requires KUKA account) 2. **Install OfficeLite** following KUKA’s installation guide 3. **Get OC\_Assistant\_OfficeLite**: * Clone from GitHub: `git clone https://github.com/OpenCommissioning/OC_Assistant_OfficeLite.git` * Or download the latest release from the repository 4. **Install the Y200 server component**: * Navigate to the OC\_Assistant\_OfficeLite project folder * Follow the installation instructions in the project README * The server provides the Y200 protocol interface for OfficeLite #### Configuring OfficeLite with realvirtual [Section titled “Configuring OfficeLite with realvirtual”](#configuring-officelite-with-realvirtual) 1. **Start KUKA OfficeLite** with your robot project 2. **Launch OC\_Assistant\_OfficeLite**: * Run the server application * Verify it connects to your OfficeLite instance * Confirm the Y200 server is listening on port 54600 3. **Configure realvirtual KUKA interface**: * Set Server IP to 127.0.0.1 (localhost) * Keep default port 54600 * Enable the interface 4. **Verify connection** by checking the State property shows “Connected” #### Benefits of OfficeLite Integration [Section titled “Benefits of OfficeLite Integration”](#benefits-of-officelite-integration) * **No hardware required**: Test and develop without physical robot controllers * **Full KRL support**: Run actual robot programs in virtual environment * **Safe testing**: Validate programs and sequences without safety risks * **Cost-effective**: Develop and commission virtually before hardware arrives * **Multi-robot support**: Run multiple virtual controllers simultaneously * **Debugging capabilities**: Enhanced debugging compared to real controllers ### Troubleshooting [Section titled “Troubleshooting”](#troubleshooting) Common issues and solutions: **Connection fails immediately** * Verify the KUKA controller IP address is correct (127.0.0.1 for OfficeLite) * Check that Y200 server is running: * For real controllers: Verify Y200 server installation * For OfficeLite: Ensure OC\_Assistant\_OfficeLite is running * Ensure port 54600 is not blocked by firewalls * Test network connectivity with ping command * For OfficeLite: Verify the virtual controller is started and in RUN mode **No axis values updating** * Confirm the robot program is running on the controller * Check that the Y200 server is configured to send axis data * Verify signal names match exactly (Axis1, not Axis\_1) **Digital I/O not working** * Remember the indexing offset (InBool0 = $IN\[1]) * Ensure signals are created with correct names * Check that I/O is not being overridden by KRL program * Verify MaxDigitalSignals covers the I/O range you need **Connection drops frequently** * Check network stability and cable connections * Increase Connection Timeout Ms for unreliable networks * Enable Auto Reconnect for automatic recovery * Review controller logs for Y200 server errors ## Protocol Details [Section titled “Protocol Details”](#protocol-details) The Y200 protocol exchanges fixed-size data packets: **From KUKA Controller (1144 bytes)**: * Bytes 0-1023: Digital outputs ($OUT array) * Bytes 1024-1071: Robot axes (6 × 8-byte doubles) * Bytes 1072-1143: Position/tool/base data (not currently used) **To KUKA Controller (1024 bytes)**: * Bytes 0-1023: Digital inputs ($IN array) This fixed structure ensures predictable, real-time communication suitable for industrial applications. ## Integration with realvirtual Components [Section titled “Integration with realvirtual Components”](#integration-with-realvirtual-components) The KUKA interface works seamlessly with other realvirtual components: ### Robot Components [Section titled “Robot Components”](#robot-components) * **Drive**: Connect axis signals to drive components for robot visualization * **Robot**: Use with the Robot component for complete kinematic simulation * **IK (Inverse Kinematics)**: Combine with IK for path planning and validation ### Signal Processing [Section titled “Signal Processing”](#signal-processing) * **SignalManager**: Centrally manage all KUKA signals * **PLCInputFloat/PLCOutputFloat**: Extend for analog value exchange * **ValueMapping**: Transform signal values for different scaling needs ### Automation Logic [Section titled “Automation Logic”](#automation-logic) * **BehaviorGraph**: Create visual logic using KUKA I/O signals * **Scripts**: Access signals programmatically for custom behaviors * **Sequences**: Build complex automation sequences with robot coordination ## Best Practices [Section titled “Best Practices”](#best-practices) 1. **Signal Organization**: Keep the auto-generated folder structure for clarity 2. **Naming Convention**: Follow the standard naming (Axis1-6, InBool, OutBool) for compatibility 3. **Performance**: Only create signals you actually use to minimize overhead 4. **Error Handling**: Implement proper error handling in automation logic for connection failures 5. **Documentation**: Document signal mappings between Unity and KRL programs 6. **Testing**: Test with simulated controllers before connecting to real robots: * Use KUKA OfficeLite with OC\_Assistant\_OfficeLite for comprehensive testing * Validate with KUKA WorkVisual simulation * Verify all signals and axes before deploying to real hardware 7. **Safety**: Never rely solely on simulation for safety-critical decisions ## External Resources [Section titled “External Resources”](#external-resources) * [OpenCommissioning OC\_Assistant\_OfficeLite](https://github.com/OpenCommissioning/OC_Assistant_OfficeLite) - Y200 server for KUKA OfficeLite integration * [KUKA OfficeLite Documentation](https://www.kuka.com) - Official KUKA virtual controller documentation * [OpenCommissioning Initiative](https://opencommissioning.com) - Open-source virtual commissioning tools ## See Also [Section titled “See Also”](#see-also) * [KUKA iiQKA.OS2 VRC (Pro)](/doc/unity/components-and-scripts/interfaces/kuka-iiqka-vrc/) - For the newer iiQKA.OS2 controller generation via RSI * [Drive](/doc/unity/components-and-scripts/motion/drive/) - For connecting axis signals to robot joints * [Signal Manager](/doc/unity/components-and-scripts/interfaces/signal-manager/) - Managing interface signals * [Signal Importer Exporter](/doc/unity/components-and-scripts/interfaces/signal-importer-exporter/) - Import and export signal configurations * [Custom Interfaces](/doc/unity/components-and-scripts/interfaces/custom-interfaces/) - Creating custom interfaces # KUKA iiQKA.OS2 VRC (Pro) > >- The **KUKA iiQKA.OS2 VRC Interface** couples realvirtual live to a KUKA **iiQKA.OS2 Virtual Robot Controller (VRC)** over the **Robot Sensor Interface (RSI)**. The VRC runs the real robot code (real axis interpolation, real cycle times); realvirtual visualizes the robot axes, checks collisions and exchanges digital/analog I/O with the controller. This enables robot-in-the-loop virtual commissioning without physical hardware. > **Beta Notice**: This interface is in **beta**. It is validated against a software loopback and built strictly to the documented RSI specification, but has not yet been field-validated against every iiQKA.OS2 configuration. Test on the real controller first with a reduced speed override, and please get in direct contact with us for support or feedback. > **Not the same as the** [**KUKA (Y200)**](/doc/unity/components-and-scripts/interfaces/kuka/) **interface.** That one targets KUKA OfficeLite via the Y200/OC\_Assistant protocol. This interface targets the newer **iiQKA.OS2** generation via **RSI**. ## Overview [Section titled “Overview”](#overview) iiQKA.OS2 ships with a full Virtual Robot Controller that runs standalone on a PC. This interface connects to that VRC over RSI Ethernet (XML over UDP) and: * Receives robot axis positions (A1–A6 and beyond) each RSI cycle and drives the linked robot joints * Exchanges digital and analog I/O in both directions, so realvirtual can **set inputs on the controller** (simulated sensor states as robot inputs) The interface is built on the realvirtual **FastInterface** standard and drives the robot exactly like every other robot interface in realvirtual: it writes each axis value to the linked **Drive**’s current position. ![KUKA iiQKA.OS2 VRC Interface Inspector](/doc/unity/assets/kuka-iiqka-vrc-inspector.png) ### Scope: what this interface does and does not do [Section titled “Scope: what this interface does and does not do”](#scope-what-this-interface-does-and-does-not-do) Virtual commissioning with a robot involves three layers. This interface covers two of them; the third stays with your PLC. | Layer | Content | Handled by | | ----------------- | -------------------------------------------------------- | -------------------------------------------- | | **1. Axes** | Joint positions for visualization | **This interface** (RSI) | | **2. Robot I/O** | Digital/analog signals both ways (e.g. set robot inputs) | **This interface** (RSI) | | **3. Sequencing** | Program select/start, drives on, mode, program number | **Your PLC** (Automatic External / fieldbus) | > **Important limitation (RSI):** RSI I/O is bound to an active RSI context, so it only works **while an RSI motion is running**. For reliable I/O the KRL carrier program must keep a **continuous RSI context** (the robot effectively always runs with RSI active). If the robot must wait at standstill for a realvirtual signal *before* it starts moving, RSI cannot set that signal — that case is covered by a future EthernetKRL (EKI) channel and is not part of this beta. ## Properties [Section titled “Properties”](#properties) ### Axis Configuration [Section titled “Axis Configuration”](#axis-configuration) **Axis** (list of Drive) holds the robot joint drives in order (Axis 1 first). Each RSI axis value received from the controller is written to the corresponding Drive’s current position. Drag your robot’s joint drives here in the correct order. The number of axes is taken from the list, so 6-axis robots, 7-axis robots and external axes are all supported. ### I/O Configuration [Section titled “I/O Configuration”](#io-configuration) **Digital Channels** (integer) sets how many digital I/O bits are exchanged with the controller (`ST_DIGIN` / `ST_DIGOUT`). Click **Create IO Signals** after changing this to (re)generate the signal objects. **Analog Channels** (integer) sets how many analog values are exchanged in each direction. ### Connection [Section titled “Connection”](#connection) **Listen IP** (string) is the local IP address the RSI UDP socket binds to. Use `0.0.0.0` to listen on all network interfaces, or a specific adapter IP to bind to one network. **Rsi Port** (integer) is the UDP port the controller sends its RSI packets to. Default is `49152`. This must match the port configured in the controller’s RSI Ethernet configuration. ### RSI Configuration [Section titled “RSI Configuration”](#rsi-configuration) **Cycle Ms** (integer) is the expected RSI cycle time in milliseconds (default `4`, i.e. 250 Hz). It must be smaller than the controller’s RSI send cycle so the reply is always ready in time. **Axis Pos Tag** (string) is the XML tag name carrying the actual axis positions in your RSI configuration (default `AIPos`). It must match the tag defined in your `.rsix` / RSI Ethernet config. **Receive Timeout Ms** (integer) is the per-cycle receive timeout. A missed packet counts as a timeout toward the reconnect logic. ### Reconnect [Section titled “Reconnect”](#reconnect) **Max Consecutive Timeouts** (integer) is how many consecutive missed RSI cycles are tolerated before the connection is considered lost and reconnection is triggered. ### Configuration (FastInterface) [Section titled “Configuration (FastInterface)”](#configuration-fastinterface) **Update Cycle Ms** (integer) is the communication loop interval. **Only Transmit Changed Inputs** (boolean) reduces traffic by sending only changed values. **Auto Reconnect** (boolean) re-establishes the connection automatically after a drop. **Reconnect Interval Seconds** (integer) is the wait between attempts. **Max Reconnect Attempts** (integer, `-1` = unlimited) caps the attempts. **Debug Mode** (boolean) logs detailed communication activity for troubleshooting. ### Status (Read-Only) [Section titled “Status (Read-Only)”](#status-read-only) **State** shows the connection status (Disconnected, Connecting, Connected, Error). **Current Axis Deg** lists the live axis values in degrees. **VRC Cycle Count** and **Last Cycle Ms** report throughput and the duration of the last cycle. **Reconnect Attempt Count**, **Input/Output Signals**, **Comm Cycle Ms** and **Cycle Count** provide further diagnostics. ## Signal Structure [Section titled “Signal Structure”](#signal-structure) Click **Create IO Signals** to generate the I/O signal objects as children of the interface. With 8 digital and 2 analog channels the hierarchy looks like this: ![Generated I/O signal hierarchy](/doc/unity/assets/kuka-iiqka-vrc-hierarchy.png) | Signal | Type | Direction | RSI mapping | | --------------------- | -------------- | ------------------------ | ---------------------------------- | | `DigOut0` … `DigOutN` | PLCOutputBool | controller → realvirtual | `ST_DIGOUT` bits | | `DigIn0` … `DigInN` | PLCInputBool | realvirtual → controller | `ST_DIGIN` bits (set robot inputs) | | `AnaOut0` … `AnaOutN` | PLCOutputFloat | controller → realvirtual | analog out | | `AnaIn0` … `AnaInN` | PLCInputFloat | realvirtual → controller | analog in | The robot axes are **not** signals here — they are written directly to the Drives referenced in the **Axis** list. ## Quick Start [Section titled “Quick Start”](#quick-start) 1. **Add the component** to an empty GameObject (`realvirtual/Interfaces/KUKA iiQKA.OS2 (VRC, RSI)`). 2. **Link the axes**: drag your robot’s joint Drives into the **Axis** list in order (Axis 1 first). 3. **Set the channels** (Digital/Analog) and click **Create IO Signals**. 4. **Configure the connection**: set **Listen IP** and **Rsi Port** to match your controller’s RSI Ethernet config; set **Cycle Ms** and **Axis Pos Tag** to match the `.rsix`. 5. **On the controller**: install the RSI option package, deploy the RSI configuration (`.rsix` + Ethernet config), and run a KRL carrier program that keeps a continuous RSI context. 6. **Enable the interface** (Active) and check that **State** turns to *Connected* and **Current Axis Deg** updates. 7. **Wire the I/O** to your plant simulation (link `DigIn*`/`AnaIn*` to simulated sensors so realvirtual sets the robot inputs; read `DigOut*`/`AnaOut*` to react to robot outputs). ## Requirements [Section titled “Requirements”](#requirements) * A **KUKA iiQKA.OS2** Virtual Robot Controller (runs standalone on a PC). * The **iiQKA.RobotSensorInterface (RSI)** option package on the controller (separate KUKA option, not part of the free base). * **iiQWorks.Sim Basic** (free) for configuring and deploying the RSI configuration. * Sequencing (program start, drives on, program number) is driven by your PLC via Automatic External — not by this interface. ## See Also [Section titled “See Also”](#see-also) * [KUKA (Y200)](/doc/unity/components-and-scripts/interfaces/kuka/) – KUKA OfficeLite interface via Y200 (different generation) * [Drive](/doc/unity/components-and-scripts/motion/drive/) – the joint drives linked in the Axis list * [Signal Manager](/doc/unity/components-and-scripts/interfaces/signal-manager/) – managing interface signals * [Custom Interfaces](/doc/unity/components-and-scripts/interfaces/custom-interfaces/) – building interfaces on the FastInterface standard # Legacy Interfaces (Deprecated) Caution **Deprecated**: This documentation covers the legacy interface system using `InterfaceBaseClass` and `InterfaceThreadedBaseClass`. These approaches are deprecated and should not be used for new projects. Use [FastInterface](/doc/unity/components-and-scripts/interfaces/custom-interfaces/) for all new interface development. This guide provides reference documentation for the legacy interface system that was used in realvirtual before FastInterface was introduced. If you have existing interfaces built with these deprecated base classes, consider migrating to FastInterface for better performance, reliability, and maintainability. ## Legacy Interface Base Classes [Section titled “Legacy Interface Base Classes”](#legacy-interface-base-classes) The legacy system provided two base classes for custom interface development: ### InterfaceBaseClass (Single-threaded) [Section titled “InterfaceBaseClass (Single-threaded)”](#interfacebaseclass-single-threaded) The simplest approach for basic protocol communication that runs on Unity’s main thread: ```csharp using UnityEngine; namespace realvirtual { public class MyLegacyInterface : InterfaceBaseClass { [Header("Connection Settings")] public string ServerIP = "192.168.1.100"; public int Port = 502; private bool isConnected = false; public override void OpenInterface() { try { // Connect to external system ConnectToServer(ServerIP, Port); isConnected = true; Debug.Log("Interface connected"); } catch (System.Exception ex) { Debug.LogError($"Connection failed: {ex.Message}"); isConnected = false; } } public override void CloseInterface() { try { DisconnectFromServer(); isConnected = false; Debug.Log("Interface disconnected"); } catch (System.Exception ex) { Debug.LogError($"Disconnect error: {ex.Message}"); } } public override void CommunicationUpdate() { if (!isConnected) return; try { // Read Unity signals and send to external system var inputValues = ReadInputSignals(); SendToExternalSystem(inputValues); // Read from external system and update Unity signals var receivedValues = ReceiveFromExternalSystem(); WriteOutputSignals(receivedValues); } catch (System.Exception ex) { Debug.LogError($"Communication error: {ex.Message}"); isConnected = false; } } public override bool GetCommunicationState() { return isConnected; } } } ``` **Key characteristics:** * Runs on Unity’s main thread * Simple synchronous operation * Can cause Unity frame drops with slow communication * Suitable only for very fast protocols or testing ### InterfaceThreadedBaseClass (Multi-threaded) [Section titled “InterfaceThreadedBaseClass (Multi-threaded)”](#interfacethreadedbaseclass-multi-threaded) A more advanced approach that runs communication on a background thread: ```csharp using UnityEngine; using System.Threading; namespace realvirtual { public class MyThreadedInterface : InterfaceThreadedBaseClass { [Header("Connection Settings")] public string ServerIP = "192.168.1.100"; public int Port = 502; private bool isConnected = false; private object connectionLock = new object(); protected override void ThreadMethod() { while (!shouldStop) { try { if (!isConnected) { AttemptConnection(); } else { PerformCommunication(); } Thread.Sleep(UpdateCycleMs); } catch (System.Exception ex) { Debug.LogError($"Thread error: {ex.Message}"); lock (connectionLock) { isConnected = false; } Thread.Sleep(1000); // Wait before retry } } } private void AttemptConnection() { try { ConnectToServer(ServerIP, Port); lock (connectionLock) { isConnected = true; } Debug.Log("Interface connected"); } catch (System.Exception ex) { Debug.LogError($"Connection failed: {ex.Message}"); } } private void PerformCommunication() { // Read Unity signals (thread-safe) var inputValues = GetInputValuesThreadSafe(); SendToExternalSystem(inputValues); // Read from external system and update Unity signals var receivedValues = ReceiveFromExternalSystem(); SetOutputValuesThreadSafe(receivedValues); } public override bool GetCommunicationState() { lock (connectionLock) { return isConnected; } } protected override void OnDestroy() { CloseInterface(); base.OnDestroy(); } } } ``` **Key characteristics:** * Runs on background thread * Better performance than single-threaded approach * Manual thread management required * Complex error handling and synchronization * Prone to threading issues and race conditions ## Legacy Signal Management [Section titled “Legacy Signal Management”](#legacy-signal-management) The legacy system used different methods for signal access: ### Reading Input Signals (Legacy) [Section titled “Reading Input Signals (Legacy)”](#reading-input-signals-legacy) ```csharp // InterfaceBaseClass approach private Dictionary ReadInputSignals() { var values = new Dictionary(); // Manual signal discovery and reading var signals = GetComponentsInChildren(); foreach (var signal in signals) { if (signal.Direction == SIGNALDIRECTION.INPUT) { values[signal.name] = signal.GetValue(); } } return values; } // InterfaceThreadedBaseClass approach private Dictionary GetInputValuesThreadSafe() { var values = new Dictionary(); lock (signalLock) { foreach (var signal in inputSignals) { values[signal.Name] = signal.ThreadSafeValue; } } return values; } ``` ### Writing Output Signals (Legacy) [Section titled “Writing Output Signals (Legacy)”](#writing-output-signals-legacy) ```csharp // InterfaceBaseClass approach private void WriteOutputSignals(Dictionary values) { var signals = GetComponentsInChildren(); foreach (var signal in signals) { if (signal.Direction == SIGNALDIRECTION.OUTPUT && values.ContainsKey(signal.name)) { signal.SetValue(values[signal.name]); } } } // InterfaceThreadedBaseClass approach private void SetOutputValuesThreadSafe(Dictionary values) { lock (signalLock) { foreach (var kvp in values) { if (outputSignals.ContainsKey(kvp.Key)) { outputSignals[kvp.Key].ThreadSafeValue = kvp.Value; } } } } ``` ## Common Issues with Legacy System [Section titled “Common Issues with Legacy System”](#common-issues-with-legacy-system) ### Threading Problems [Section titled “Threading Problems”](#threading-problems) The legacy threaded approach was prone to various threading issues: ```csharp // PROBLEMATIC: Direct Unity API access from background thread protected override void ThreadMethod() { while (!shouldStop) { // This causes errors - Unity APIs not thread-safe Debug.Log("This will crash!"); transform.position = Vector3.zero; // This will crash! Thread.Sleep(UpdateCycleMs); } } ``` ### Manual Signal Management [Section titled “Manual Signal Management”](#manual-signal-management) Legacy interfaces required manual signal discovery and management: ```csharp private List inputSignals = new List(); private List outputSignals = new List(); private void DiscoverSignals() { // Manual signal discovery - error prone var allSignals = GetComponentsInChildren(); foreach (var signal in allSignals) { if (signal.Direction == SIGNALDIRECTION.INPUT) inputSignals.Add(signal); else if (signal.Direction == SIGNALDIRECTION.OUTPUT) outputSignals.Add(signal); } } ``` ### No Automatic Reconnection [Section titled “No Automatic Reconnection”](#no-automatic-reconnection) Legacy interfaces required manual reconnection logic: ```csharp protected override void ThreadMethod() { while (!shouldStop) { try { if (!isConnected) { // Manual reconnection attempts reconnectAttempts++; if (reconnectAttempts > maxReconnectAttempts) { Thread.Sleep(5000); // Wait longer before retry reconnectAttempts = 0; } AttemptConnection(); } else { PerformCommunication(); reconnectAttempts = 0; // Reset on successful communication } } catch (Exception ex) { Debug.LogError($"Communication error: {ex.Message}"); isConnected = false; } Thread.Sleep(UpdateCycleMs); } } ``` ## Migration Guide to FastInterface [Section titled “Migration Guide to FastInterface”](#migration-guide-to-fastinterface) To migrate from legacy interfaces to FastInterface, follow these key steps: ### 1. Change Base Class [Section titled “1. Change Base Class”](#1-change-base-class) ```csharp // OLD: Legacy approach public class MyInterface : InterfaceThreadedBaseClass { // Legacy implementation } // NEW: FastInterface approach public class MyInterface : FastInterfaceBase { // FastInterface implementation } ``` ### 2. Replace Thread Management [Section titled “2. Replace Thread Management”](#2-replace-thread-management) ```csharp // OLD: Manual thread management protected override void ThreadMethod() { while (!shouldStop) { try { if (!isConnected) AttemptConnection(); else PerformCommunication(); Thread.Sleep(UpdateCycleMs); } catch (Exception ex) { // Manual error handling } } } // NEW: FastInterface methods protected override async Task EstablishConnection(CancellationToken cancellationToken) { // Connection logic here } protected override async Task CommunicationLoop(CancellationToken cancellationToken) { // Communication logic here } protected override void CloseConnection() { // Cleanup logic here } ``` ### 3. Use Built-in Signal Management [Section titled “3. Use Built-in Signal Management”](#3-use-built-in-signal-management) ```csharp // OLD: Manual signal handling private void ReadInputSignals() { var signals = GetComponentsInChildren(); foreach (var signal in signals) { if (signal.Direction == SIGNALDIRECTION.INPUT) { var value = signal.GetValue(); // Send to external system } } } // NEW: FastInterface signal management protected override async Task CommunicationLoop(CancellationToken cancellationToken) { // Automatic signal discovery and management var inputs = GetInputsForPLC(); await SendToExternalSystem(inputs); var receivedData = await ReceiveFromExternalSystem(); SetOutputsFromPLC(receivedData); } ``` ### 4. Update Logging [Section titled “4. Update Logging”](#4-update-logging) ```csharp // OLD: Unity Debug.Log (causes threading issues) Debug.Log("Connection established"); Debug.LogError($"Error: {ex.Message}"); // NEW: Thread-safe logging ThreadSafeLogger.LogInfo("Connection established", GetType().Name); ThreadSafeLogger.LogError($"Error: {ex.Message}", GetType().Name); ``` ### 5. Handle Properties Thread-Safely [Section titled “5. Handle Properties Thread-Safely”](#5-handle-properties-thread-safely) ```csharp // OLD: Direct property access (threading issues) protected override void ThreadMethod() { // Direct access to Inspector properties - not thread safe ConnectToServer(ServerIP, Port); } // NEW: Thread-safe property copying public string ServerIP = "192.168.1.100"; private string threadSafeServerIP; protected override void CopyPropertiesToThreadSafe() { threadSafeServerIP = ServerIP; } protected override async Task EstablishConnection(CancellationToken cancellationToken) { // Use thread-safe copy await ConnectToServer(threadSafeServerIP, threadSafePort); } ``` ## Legacy Interface Examples [Section titled “Legacy Interface Examples”](#legacy-interface-examples) Here’s a complete legacy interface example for reference: ```csharp using UnityEngine; using System; using System.Collections.Generic; using System.Net.Sockets; using System.Threading; using NaughtyAttributes; namespace realvirtual { public class LegacyTCPInterface : InterfaceThreadedBaseClass { [Header("TCP Settings")] public string ServerIP = "192.168.1.100"; public int Port = 8080; public int TimeoutMs = 2000; private TcpClient tcpClient; private NetworkStream stream; private bool isConnected = false; private object connectionLock = new object(); private List inputSignals = new List(); private List outputSignals = new List(); protected override void Start() { base.Start(); DiscoverSignals(); } private void DiscoverSignals() { var allSignals = GetComponentsInChildren(); foreach (var signal in allSignals) { if (signal.Direction == SIGNALDIRECTION.INPUT) inputSignals.Add(signal); else if (signal.Direction == SIGNALDIRECTION.OUTPUT) outputSignals.Add(signal); } Debug.Log($"Discovered {inputSignals.Count} inputs, {outputSignals.Count} outputs"); } protected override void ThreadMethod() { int reconnectAttempts = 0; const int maxReconnectAttempts = 5; while (!shouldStop) { try { lock (connectionLock) { if (!isConnected) { AttemptConnection(); if (!isConnected) { reconnectAttempts++; if (reconnectAttempts >= maxReconnectAttempts) { Thread.Sleep(5000); reconnectAttempts = 0; } continue; } } } PerformCommunication(); reconnectAttempts = 0; } catch (Exception ex) { Debug.LogError($"Communication error: {ex.Message}"); lock (connectionLock) { isConnected = false; CleanupConnection(); } } Thread.Sleep(UpdateCycleMs); } } private void AttemptConnection() { try { tcpClient = new TcpClient(); tcpClient.ConnectTimeout = TimeoutMs; tcpClient.Connect(ServerIP, Port); stream = tcpClient.GetStream(); isConnected = true; Debug.Log("TCP connection established"); } catch (Exception ex) { Debug.LogError($"Connection failed: {ex.Message}"); CleanupConnection(); } } private void PerformCommunication() { // Read Unity input signals var inputData = new Dictionary(); foreach (var signal in inputSignals) { inputData[signal.name] = signal.GetValue(); } // Send to external system if (inputData.Count > 0) { SendDataToServer(inputData); } // Request data from external system var receivedData = RequestDataFromServer(); // Update Unity output signals foreach (var kvp in receivedData) { var signal = outputSignals.Find(s => s.name == kvp.Key); if (signal != null) { signal.SetValue(kvp.Value); } } } private void SendDataToServer(Dictionary data) { // Implementation depends on your protocol } private Dictionary RequestDataFromServer() { // Implementation depends on your protocol return new Dictionary(); } private void CleanupConnection() { try { stream?.Close(); tcpClient?.Close(); } catch (Exception ex) { Debug.LogError($"Cleanup error: {ex.Message}"); } finally { stream = null; tcpClient = null; isConnected = false; } } public override bool GetCommunicationState() { lock (connectionLock) { return isConnected; } } protected override void OnDestroy() { shouldStop = true; lock (connectionLock) { CleanupConnection(); } base.OnDestroy(); } } } ``` ## Why FastInterface is Better [Section titled “Why FastInterface is Better”](#why-fastinterface-is-better) FastInterface addresses all the major problems of the legacy system: | Legacy System Issues | FastInterface Solutions | | ---------------------------------- | ----------------------------------------------- | | Manual thread management | Automatic thread lifecycle management | | Complex error handling | Built-in reconnection and error recovery | | Threading bugs and race conditions | Thread-safe design patterns | | Manual signal discovery | Automatic signal detection and management | | No performance optimization | Built-in change detection and batching | | Inconsistent implementations | Standardized architecture across all interfaces | | Limited debugging tools | Comprehensive logging and state monitoring | | Property synchronization issues | Automatic thread-safe property copying | ## See Also [Section titled “See Also”](#see-also) * [Building Custom Interfaces](/doc/unity/components-and-scripts/interfaces/custom-interfaces/) - Modern FastInterface development guide * [Interface Overview](/doc/unity/components-and-scripts/interfaces/) - Overview of all available interfaces * [Signal Management](/doc/unity/signals/signal-overview/) - Understanding realvirtual signals * [S7 Interface](/doc/unity/components-and-scripts/interfaces/s7/) - Example of FastInterface implementation # Mitsubishi McpX (Pro) Caution **Beta Interface**: This interface is currently in beta. If you encounter any issues or need assistance, please contact realvirtual support or through our community forum. The **Mitsubishi McpX** interface provides high-performance communication with Mitsubishi PLCs using the MC Protocol 3E/4E frames through the McpX library. ## Overview [Section titled “Overview”](#overview) The Mitsubishi McpX interface enables real-time bidirectional data exchange between Unity simulations and Mitsubishi Q, L, R, iQ-R, and iQ-F series PLCs. This Professional-only interface utilizes the MC Protocol (MELSEC Communication Protocol) with 3E/4E frame formats for robust industrial communication. A key feature is its intelligent batch read optimization that automatically groups signals into efficient read operations, reducing network traffic and improving throughput by up to 30x compared to individual signal reads. The interface supports all major Mitsubishi device types including physical inputs/outputs (X/Y), internal relays (M), data registers (D), timers (T), counters (C), state relays (S), and special devices (SM/SD). Communication runs in a background thread using the FastInterface architecture, ensuring smooth Unity performance while maintaining reliable PLC connectivity. Note This interface requires **realvirtual Professional** and uses the McpX library () for MC Protocol implementation. ## Installation [Section titled “Installation”](#installation) The Mitsubishi McpX interface is included in realvirtual Professional and can be added to your scene through: 1. **Menu Method**: Select **Tools > realvirtual > Add Interface > Mitsubishi McpX (Pro)** 2. **Manual Method**: Add the `MitsubishiMcpXInterface` script to an empty GameObject The interface files are located at: `Assets/realvirtual/Interfaces/Mitsubishi/` ## Properties [Section titled “Properties”](#properties) ![](/doc/unity/assets/mitsubishi-mcpx-inspector.png) Mitsubishi McpX Interface Inspector ### Connection Settings [Section titled “Connection Settings”](#connection-settings) * **IP Address** (string): IP address of the Mitsubishi PLC. Default: “192.168.3.39” * **Port** (int): MC Protocol communication port. Default: 5001 (standard port for MC Protocol 3E/4E frames) * **Connection Timeout** (int): Maximum connection establishment time in milliseconds. Default: 5000 Note The interface uses MC Protocol **3E binary frame format** and **TCP** transport by default. These are optimized settings for Mitsubishi Q, L, R, iQ-R, and iQ-F series PLCs and cannot be changed. ### Batch Optimization [Section titled “Batch Optimization”](#batch-optimization) Dramatically improves communication efficiency by grouping multiple signal reads into single network operations, providing up to 30x performance improvement. * **Optimize Batch Reads** (boolean): Enables automatic signal grouping for efficient reading. Default: true * **Max Gap Size** (int): Maximum address gap between signals in the same batch. Default: 5 * **Min Batch Size** (int): Minimum signals required to justify batch reading. Default: 3 * **Max Batch Size Bits** (int): Maximum batch size for bit devices (X, Y, M, etc.). Default: 960 (MC Protocol limit) * **Max Batch Size Words** (int): Maximum batch size for word devices (D, W, R, etc.). Default: 120 (MC Protocol limit) ### GX Works3 Import [Section titled “GX Works3 Import”](#gx-works3-import) Provides seamless integration with GX Works3 device comment exports for rapid signal configuration. * **GX Works3 CSV File** (string): Path to device comment CSV export file. Use **Select CSV File** button to browse * **Use Standard GX Format** (boolean): Uses standard GX Works3 CSV format (Device,Comment,Data Type,Initial Value). Default: true * **Create Device Hierarchy** (boolean): Organizes imported signals by device type (Physical Inputs (X), Physical Outputs (Y), etc.). Default: true * **Import Comments** (boolean): Uses device comments as signal names for meaningful identification. Default: true * **Max Import Devices** (int): Safety limit for imported devices to prevent memory issues. Default: 1000 * **Validate Device Addresses** (boolean): Checks device addresses for validity before import. Default: true ### Device Type Filtering [Section titled “Device Type Filtering”](#device-type-filtering) Controls which device types are imported from CSV files. * **Import Physical Inputs** (boolean): Import X devices (sensors, buttons, switches). Default: true * **Import Physical Outputs** (boolean): Import Y devices (actuators, lights, valves). Default: true * **Import Internal Relays** (boolean): Import M devices (internal memory bits). Default: true * **Import Data Registers** (boolean): Import D devices (16-bit data storage). Default: true * **Import Timers** (boolean): Import T devices (timer current values and contacts). Default: true * **Import Counters** (boolean): Import C devices (counter current values and contacts). Default: true * **Import State Relays** (boolean): Import S devices (state/step relays). Default: true * **Import Special Devices** (boolean): Import SM/SD devices (system special relays and registers). Default: false ## PLC Configuration [Section titled “PLC Configuration”](#plc-configuration) ### Enabling MC Protocol [Section titled “Enabling MC Protocol”](#enabling-mc-protocol) Configure your Mitsubishi PLC to accept MC Protocol connections: 1. **GX Works3 Configuration**: * Open your project in GX Works3 * Navigate to **Project > Parameter > Ethernet Configuration** * Enable MC Protocol on port 5001 (standard port for 3E frames) * Set communication data code to **Binary** (required for 3E frame format) * Configure allowed operations (Read/Write) 2. **Network Settings**: * Ensure PLC and Unity PC are on the same network * Configure IP address and subnet mask appropriately * Test connectivity with ping command 3. **Security Settings**: * MC Protocol typically doesn’t require authentication * Ensure firewall allows communication on configured port * Some PLCs may require enabling external communication ### Device Comment Export [Section titled “Device Comment Export”](#device-comment-export) To export device comments from GX Works3 for import: 1. **Export Process**: * Open your GX Works3 project * Navigate to **Project > Export > Device Comment** * Select CSV format * Choose devices to export * Save with meaningful filename 2. **CSV Format**: ```csv Device,Comment,Data Type,Initial Value X0,Start Button,Bit,0 Y0,Motor Output,Bit,0 D100,Speed Setpoint,Word[Signed],0 M100,System Ready,Bit,0 ``` ### Optional InputOutput Column [Section titled “Optional InputOutput Column”](#optional-inputoutput-column) Note This feature is available since realvirtual **6.3**. The CSV import supports an optional **InputOutput** column that allows you to override the default signal direction for each device. This is useful when the standard device-type-based direction doesn’t match your application requirements. **Supported column headers**: `InputOutput`, `Input/Output`, or `IO` (case-insensitive) **CSV Format with InputOutput column**: ```csv Device,Comment,Data Type,Initial Value,InputOutput D0,Rx000,Word[Signed],0,Input D1,Rx001,Word[Signed],0,Output D2,Rx002,Word[Signed],0, M0,System Flag,Bit,0,Output ``` **Behavior**: * **Column present with value**: The specified direction (“Input” or “Output”) overrides the default * **Column present but empty**: Uses the default direction based on device type * **Column not present**: Uses the default direction based on device type **Default directions by device type** (from PLC perspective): | Device Type | Default Direction | Description | | ------------- | ----------------- | ------------------------------------------------------------ | | X | Input | PLC inputs (sensors) - Unity simulates sensors, sends to PLC | | Y | Output | PLC outputs (actuators) - PLC sends commands to Unity | | M, D, T, C, S | Output | Most devices default to reading from PLC | | SM, SD | Output | Special devices are read-only from PLC | Caution **Use with caution**: Setting the wrong direction for device types with strongly defined behavior may lead to unexpected results. For example, Y devices (PLC outputs) should not be set to “Input” as they represent actuator commands from the PLC. Similarly, SM/SD (special devices) are system read-only registers. Only override directions when you fully understand the implications for your specific application. ## Manual Signal Creation [Section titled “Manual Signal Creation”](#manual-signal-creation) For precise control over signal configuration, you can manually create individual PLC signals. The interface automatically parses device type and address from the signal name. ### Basic Setup Process [Section titled “Basic Setup Process”](#basic-setup-process) 1. **Add Interface to Scene**: * Create an empty GameObject and name it “MitsubishiPLC” * Add the **MitsubishiMcpXInterface** component * Configure the connection settings (IP address and port) 2. **Create Signal GameObject**: * Right-click the interface GameObject in the hierarchy * Select **Create Empty** to add a child GameObject * **Name it descriptively** (e.g., “ConveyorStartButton”, “MotorSpeedSetpoint”, “SystemReady”) 3. **Add Signal Component**: * Select the signal GameObject * Add the appropriate PLC signal component based on device type: * **PLCInputBool** - Send boolean values to PLC (for X devices - sensors) * **PLCOutputBool** - Read boolean values from PLC (for Y, M devices - actuators, flags) * **PLCInputFloat** - Send numeric values to PLC (for D devices used as setpoints) * **PLCOutputFloat** - Read numeric values from PLC (for D devices - status values) 4. **Configure Signal Properties**: * **Name**: Set to the Mitsubishi device format (e.g., “X100”, “D200”, “M5”) * **Comment**: Add documentation describing the signal purpose Note **Device Parsing**: The interface automatically extracts the device type and address from the **Signal Name** property (not the GameObject name). For example: * Signal Name “X100” → DeviceType: “X”, Address: “100” * Signal Name “D200” → DeviceType: “D”, Address: “200” * Signal Name “M5” → DeviceType: “M”, Address: “5” ### Signal Configuration Examples [Section titled “Signal Configuration Examples”](#signal-configuration-examples) | GameObject Name | Signal Name | Signal Component | Direction | Comment | | ------------------- | ----------- | ---------------- | --------- | --------------------- | | ConveyorStartButton | X0 | PLCInputBool | Input | Sensor → PLC | | MotorContactor | Y0 | PLCOutputBool | Output | PLC → Actuator | | SystemReady | M100 | PLCOutputBool | Output | Read flag from PLC | | SpeedSetpoint | D200 | PLCInputFloat | Input | Send setpoint to PLC | | ActualSpeed | D201 | PLCOutputFloat | Output | Read value from PLC | | DelayTimer | T0 | PLCOutputBool | Output | Timer status from PLC | ### Configuration Summary [Section titled “Configuration Summary”](#configuration-summary) * **GameObject Name**: Descriptive name for easy identification in Unity hierarchy * **Signal Name**: Mitsubishi device format (X100, D200, etc.) - used for PLC communication * **Comment**: Additional documentation about the signal’s purpose and usage ## CSV Import [Section titled “CSV Import”](#csv-import) The CSV import feature allows rapid signal creation from GX Works3 device comment exports, dramatically reducing setup time for large systems. ### Preparing CSV File in GX Works3 [Section titled “Preparing CSV File in GX Works3”](#preparing-csv-file-in-gx-works3) 1. **Export Device Comments**: * Open your GX Works3 project * Navigate to **Project > Export > Device Comment** * Select **CSV format** from the export options * Choose the device ranges to export * Save to a location accessible from Unity 2. **Verify CSV Format**: The exported CSV should follow this structure: ```csv Device,Comment,Data Type,Initial Value X0,Start Button,Bit,0 X1,Stop Button,Bit,0 Y0,Motor Contactor,Bit,0 Y1,Status Light,Bit,0 D100,Speed Setpoint,Word[Signed],1500 D101,Temperature Reading,Word[Signed],0 M0,System Ready,Bit,0 M1,Auto Mode Active,Bit,0 ``` ### Import Process in Unity [Section titled “Import Process in Unity”](#import-process-in-unity) 1. **Select CSV File**: * In the Mitsubishi McpX Interface Inspector * Click the **Select CSV File** button * Navigate to your exported CSV file * Click **Open** to load the file path 2. **Configure Import Settings**: * **Use Standard GX Format**: Keep enabled for GX Works3 exports * **Create Device Hierarchy**: Enable to organize signals by device type * **Import Comments**: Enable to use device comments as signal names * **Max Import Devices**: Set safety limit (default 1000) * **Validate Device Addresses**: Keep enabled to catch errors 3. **Filter Device Types**: Enable only the device types you need: * **Physical Inputs (X)**: Sensors, buttons, switches * **Physical Outputs (Y)**: Actuators, lights, valves * **Internal Relays (M)**: Logic flags and status bits * **Data Registers (D)**: Numeric values and parameters * **Timers (T)**: Timer current values and contacts * **Counters (C)**: Counter values and contacts * **State Relays (S)**: Step sequence control * **Special Devices (SM/SD)**: Usually disabled 4. **Execute Import**: * Click the **Import from CSV** button * Monitor the Unity Console for import progress and any warnings * Review created signals in the hierarchy ### Post-Import Organization [Section titled “Post-Import Organization”](#post-import-organization) After successful import, you’ll have: * **Organized hierarchy**: Signals grouped by device type (if enabled) * **Named signals**: Using device comments for meaningful names * **Configured addresses**: All device types and addresses set correctly * **Ready-to-use signals**: Immediately available for connection to simulation components ### Import Validation and Troubleshooting [Section titled “Import Validation and Troubleshooting”](#import-validation-and-troubleshooting) **Common CSV Issues**: * **Encoding problems**: Ensure CSV is saved as UTF-8 * **Format mismatches**: Verify column order matches GX Works3 standard * **Invalid addresses**: Check for typos in device addresses * **Large imports**: Consider splitting very large files into smaller segments **Post-Import Verification**: * Check Unity Console for any import warnings or errors * Verify signal names match your expectations * Test connectivity with a few sample signals before connecting all components * Review batch optimization settings for optimal performance with your signal layout ## Troubleshooting [Section titled “Troubleshooting”](#troubleshooting) ### Connection Issues [Section titled “Connection Issues”](#connection-issues) **Cannot connect to PLC**: 1. Verify PLC IP address is correct 2. Check MC Protocol is enabled on PLC 3. Test with ping command: `ping 192.168.3.39` 4. Verify firewall settings allow port 5001 5. Check network cable and switches **Connection timeouts**: * Increase Connection Timeout value * Reduce batch sizes if using optimization * Check network latency * Verify PLC scan time isn’t too long ### Import Issues [Section titled “Import Issues”](#import-issues) **CSV import fails**: * Verify CSV format matches GX Works3 standard * Check file encoding (UTF-8 recommended) * Ensure device addresses are valid * Review console log for specific errors **Signals not updating**: * Verify PLC is in RUN mode * Check signal direction: X devices should be Input (Unity → PLC), Y devices should be Output (PLC → Unity) * Ensure device addresses match PLC program * Review batch optimization settings ### Performance Issues [Section titled “Performance Issues”](#performance-issues) **Slow update rates**: * Enable batch optimization * Adjust Max Gap Size for better grouping * Increase Min Batch Size to reduce operations * Check network bandwidth and latency **Unity freezes during communication**: * Interface runs in background thread * Check for exceptions in console * Verify reasonable number of signals (<5000) * Consider splitting into multiple interfaces ## Supported Device Types [Section titled “Supported Device Types”](#supported-device-types) The interface supports all standard Mitsubishi device types: | Device | Description | Data Type | Address Range | | ------ | ------------------------ | --------- | -------------- | | X | Physical Inputs | Bit | X0-X7FF (hex) | | Y | Physical Outputs | Bit | Y0-Y7FF (hex) | | M | Internal Relays | Bit | M0-M8191 | | L | Latch Relays | Bit | L0-L8191 | | F | Annunciator | Bit | F0-F2047 | | V | Edge Relays | Bit | V0-V2047 | | B | Link Relays | Bit | B0-B1FFF (hex) | | D | Data Registers | Word | D0-D12287 | | W | Link Registers | Word | W0-W1FFF (hex) | | T | Timer Contacts/Current | Bit/Word | T0-T511 | | C | Counter Contacts/Current | Bit/Word | C0-C255 | | S | State Relays | Bit | S0-S4095 | | SM | Special Relays | Bit | SM0-SM2047 | | SD | Special Registers | Word | SD0-SD2047 | | R | File Registers | Word | R0-R32767 | | ZR | File Registers | Word | ZR0-ZR65535 | ## See Also [Section titled “See Also”](#see-also) * [Signal Manager](/doc/unity/components-and-scripts/interfaces/signal-manager/) - Managing and organizing signals * [Signal Importer Exporter](/doc/unity/components-and-scripts/interfaces/signal-importer-exporter/) - Import and export signal configurations * [Custom Interfaces](/doc/unity/components-and-scripts/interfaces/custom-interfaces/) - Creating custom interfaces * [S7 TCP](/doc/unity/components-and-scripts/interfaces/s7-tcp/) - Similar interface for Siemens PLCs ## External Resources [Section titled “External Resources”](#external-resources) * [McpX Library GitHub](https://github.com/YudaiKitamura/McpX) - MC Protocol implementation * [Mitsubishi MC Protocol Manual](https://www.mitsubishielectric.com/fa/) - Official protocol documentation * [GX Works3 Documentation](https://www.mitsubishielectric.com/fa/products/cnt/plceng/smerit/gx_works3/) - PLC programming software © 2025 realvirtual GmbH [https://realvirtual.io](https://realvirtual.io/) - All rights reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or by any means, including printing, saving, photocopying, recording, or other electronic or mechanical methods, without the prior written permission of the publisher. # Modbus Caution Please note, that this Interface is only available in realvirtual.io Professional ### Introduction[](#introduction) [Section titled “Introduction ”](#introduction) Modbus is a data communications protocol originally published by Modicon (now Schneider Electric) in 1979 for use with its programmable logic controllers (PLCs). Modbus has become a de facto standard communication protocol and is now a commonly available means of connecting industrial electronic devices (Source ). Modbus is a very simple standard which is transfering discrete inputs and outputs or registers (double word). realvirtual.io offers two Modbus components: * **Modbus TCP** (*ModbusTCPInterface*) - the recommended interface with **Client** and **Server** mode. Addresses and data types are defined as signal metadata and are identical to realvirtual WEB / CONNECT. * **Modbus TCPRTU (Legacy)** (*ModbusInterface*) - the previous server-only interface with a *ModbusData* component per signal. Existing scenes keep working unchanged; use the new interface for new projects. ## Modbus TCP (Client & Server) [Section titled “Modbus TCP (Client & Server)”](#modbus-tcp-client--server) Note This feature was added in realvirtual **6.3** (Professional) ### Overview [Section titled “Overview”](#overview) The Modbus TCP interface connects Unity signals with Modbus TCP devices. In **Client** mode Unity connects to a Modbus device (for example an Inovance H5U / AM600, Wago or Schneider PLC) and reads and writes its coils and registers. In **Server** mode Unity simulates a Modbus device: external Modbus masters (PLC, HMI, SCADA) connect to Unity, read the PLCInput values and write the PLCOutput values. Add it with *Add Component > realvirtual > Interfaces > Modbus TCP*. Signals are child objects of the interface, like with every other realvirtual interface. ### Properties [Section titled “Properties”](#properties) **Mode** (Client / Server) Selects whether Unity connects to a Modbus device (Client) or lets Modbus masters connect to Unity (Server). **Host** (string, Client only) IP address of the Modbus device. **Port** (integer) TCP port. In Client mode the port of the device, in Server mode the port Unity listens on. The Modbus default is 502. **Unit Id** (byte) Modbus unit identifier (slave ID) of the device. **Word Order** (ABCD / CDAB / BADC / DCBA) Register order of 32-bit values (INT, UINT, FLOAT). ABCD is the Modbus standard, many Inovance PLCs use **CDAB**. A wrong word order produces wrong 32-bit values while 16-bit values are still correct - the most common Modbus integration error. **Connection Timeout Ms** (integer, Client only) Connection and response timeout in milliseconds. **Connected Clients** (read-only, Server only) Number of Modbus masters currently connected. **Configured Signals / Skipped Signals** (read-only) Number of signals with a valid Modbus configuration and number of signals skipped because of an invalid configuration. The Console shows the reason for every skipped signal. The general settings **Update Cycle Ms**, **Auto Reconnect** and **Reconnect Interval Seconds** work like for every realvirtual FastInterface. PLCInput signals are written to the device when their value changes and completely after every (re)connect. In Client mode a connection without any traffic (only unchanged PLCInputs) is checked every second with a single read, so a restarted device is detected and receives all values again. ### Signal addresses [Section titled “Signal addresses”](#signal-addresses) Every signal needs the metadata key **ModbusAddress**. The optional key **ModbusDataType** defines the data type; without it Bool signals use BOOL, Int signals SHORT and Float signals FLOAT. | Address | Table | Offset | | ----------------- | ------------------------------------ | ------ | | `C00001` / `C0` | Coil (read/write bit) | 0 | | `DI10001` / `DI0` | Discrete Input (read-only bit) | 0 | | `IR30001` / `IR0` | Input Register (read-only 16 bit) | 0 | | `HR40001` / `HR0` | Holding Register (read/write 16 bit) | 0 | | `HR40010.3` | Bit 3 of Holding Register offset 9 | 9 | * **Exactly five digits** are the classic 1-based notation: `HR40001` is holding register offset 0, `C00013` is coil offset 12. * **Every other digit count** is the 0-based offset directly: `HR0`, `HR9`, `C12`. * **Offsets from 10000** must be written in six-digit form (`HR012345`) or short form - `HR12345` has five digits and is read as classic notation (offset 2344). * A `.bit` suffix (0-15) addresses a single bit of a holding or input register. Writing such a bit only changes this bit, all other bits of the register are preserved. * The usable offset range is 0 to 65533, including the width of the data type (an INT at `HR065533` is rejected). Data types: **BOOL, BYTE, SBYTE, SHORT, USHORT, INT, UINT, FLOAT**. INT, UINT and FLOAT use two registers and the configured word order. UINT values are kept as 32-bit bit pattern in Int signals, so `0xFFFFFFFF` appears as `-1`. Direction rules: | Mode | PLCOutput (Unity reads) | PLCInput (Unity writes) | | ------ | ----------------------------- | ----------------------- | | Client | C, DI, IR, HR | C, HR | | Server | C, HR (written by the master) | C, DI, IR, HR | A signal that breaks a rule (for example a PLCInput on an input register in Client mode) is logged in the Console and skipped. ### Quick Start [Section titled “Quick Start”](#quick-start) 1. Add an empty GameObject and the component **Modbus TCP**. 2. Select the **Mode**, enter **Host** (Client) and **Port** and set the **Word Order** of your device. 3. Create PLCInput / PLCOutput signals as children of the interface and add the metadata **ModbusAddress** (and optionally **ModbusDataType**) - or use **Import Signals from CSV**. 4. Press **Validate Addresses** to check all signals. 5. Start the simulation - the interface connects (Client) or starts listening (Server). ### CSV import [Section titled “CSV import”](#csv-import) **Import Signals from CSV** reads a semicolon separated file with one signal per row: ```plaintext Name;Direction;Type;Address;DataType Start;Input;Bool;C00001; Speed;Output;Float;HR40010;FLOAT Count;Output;Int;IR30001;UINT ``` Direction is `Input` or `Output`, Type is `Bool`, `Int` or `Float`, DataType is optional. Missing signals are created, existing signals with the same name get the new metadata (no duplicates). Invalid rows are logged and skipped. The import supports Undo. ### Inovance PLCs [Section titled “Inovance PLCs”](#inovance-plcs) Inovance H5U / Easy and AM400 / AM600 / AC800 controllers support Modbus TCP. Their 32-bit values usually use the word order **CDAB**. Check the Modbus address mapping of your controller (for example D registers to holding registers) in the Inovance documentation and use the six-digit form for offsets from 10000. ### Troubleshooting [Section titled “Troubleshooting”](#troubleshooting) * **“Port … is in use or blocked by firewall”** (Server mode): another program or another Modbus server already uses the port, or the firewall blocks it. Choose a different port or stop the other program. With **Auto Reconnect** the server starts automatically as soon as the port is free. In the rare case that another program takes the port exactly while the server starts, an additional red error of the EasyModbus listener appears in the Console and **Connected Clients** stays 0. * **Wrong 32-bit values**: check the **Word Order** (ABCD vs. CDAB). * **Skipped Signals > 0**: the Console lists every skipped signal with the reason; **Validate Addresses** repeats the check in edit mode. ### Common Use Cases [Section titled “Common Use Cases”](#common-use-cases) * **Virtual commissioning** – test a Modbus TCP PLC program against the Unity simulation (Client mode). * **Device simulation** – let an HMI or SCADA system connect to a simulated Modbus device (Server mode). * **Loopback test** – connect two Unity interfaces (Client and Server) to test a signal table without hardware. ## Modbus TCPRTU (Legacy) [Section titled “Modbus TCPRTU (Legacy)”](#modbus-tcprtu-legacy) Caution This is the previous Modbus interface. It stays available for existing scenes; for new projects use **Modbus TCP** (see above). ### Modbus master [Section titled “Modbus master”](#modbus-master) If realvirtual.io is acting as a Modbus master the clients need to poll and write their values to realvirtual.io. The modbus master is not acting actively on his own. The Modbus server is always on the computers IP adress woth the standard port 502. ### Interface configuration [Section titled “Interface configuration”](#interface-configuration) The legacy Modbus interface is added to the Scene with *Add Component > realvirtual > Interfaces > Modbus TCPRTU (Legacy)* or by adding the script *ModbusInterface* to an empty GameObject. Because Modbus is only transferring discrete inputs or outputs or words and because there is no standard data structure for describing the content inside these data you need to define how to interpret the Modbus data inside realvirtual.io. Each PLCInput or PLCOuput signal needs to hava an attached ModbusData component. This component is defining with its properties how the bits and bytes should be interpreted by realvirtual.io. ![](/doc/unity/assets/modbus.png) ## See Also [Section titled “See Also”](#see-also) * [Custom Interfaces](/doc/unity/components-and-scripts/interfaces/custom-interfaces/) * [Signal Importer / Exporter](/doc/unity/components-and-scripts/interfaces/signal-importer-exporter/) © 2025 realvirtual GmbH [https://realvirtual.io](https://realvirtual.io/) - All rights reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or by any means, including printing, saving, photocopying, recording, or other electronic or mechanical methods, without the prior written permission of the publisher.\\ # MQTT (Pro) > Connecting IoT and IIoT systems with realvirtual ## Overview [Section titled “Overview”](#overview) MQTT (Message Queuing Telemetry Transport) is a lightweight, publish-subscribe messaging protocol designed for IoT and IIoT communication. It serves as one of the most important communication standards in Industry 4.0, enabling real-time data exchange between shop floor equipment, cloud platforms, and enterprise systems. The MQTT interface in realvirtual provides seamless integration with MQTT brokers for cloud connectivity and distributed automation systems. It supports both MQTT 3.1.1 and MQTT 5.0 protocols, with options for WebSocket transport, TLS encryption, and automatic reconnection handling. ### Key Features [Section titled “Key Features”](#key-features) * Support for MQTT 3.1.1 and MQTT 5.0 protocols * TCP and WebSocket transport options * TLS/SSL encryption for secure communication * Username/password authentication * Automatic signal discovery and import * Hierarchical topic organization * Batched message publishing for performance optimization * Background thread communication for optimal Unity performance * Topic filtering with MQTT wildcards * Real-time bidirectional communication ### Compatible MQTT Brokers [Section titled “Compatible MQTT Brokers”](#compatible-mqtt-brokers) The interface works with all standard MQTT brokers including: * **Mosquitto** - Popular open-source broker ([mosquitto.org](https://mosquitto.org/)) * **HiveMQ** - Enterprise-grade cloud broker ([hivemq.com](https://www.hivemq.com/)) * **AWS IoT Core** - Amazon’s managed IoT service * **Azure IoT Hub** - Microsoft’s cloud IoT platform * **Local brokers** - For on-premise installations ## Adding MQTT Interface [Section titled “Adding MQTT Interface”](#adding-mqtt-interface) The MQTT interface can be added to a realvirtual scene by selecting **Tools > realvirtual > Add Object > Interface > MQTT**. ![MQTT Interface Inspector](/doc/unity/assets/mqtt-interface-inspector.png) The MQTT interface provides comprehensive configuration options through the Unity Inspector, including connection settings, security options, signal management, and real-time monitoring. ## Properties [Section titled “Properties”](#properties) ### Connection Settings [Section titled “Connection Settings”](#connection-settings) **Broker** (string) - Address of the MQTT broker. This can be a hostname (e.g., test.mosquitto.org), IP address (e.g., 192.168.1.100), or localhost for local brokers. **Port** (int) - MQTT communication port. Default is 1883 for unencrypted TCP connections. Common port configurations: * 1883: Standard MQTT over TCP * 8883: MQTT over TLS/SSL * 8080/8083: MQTT over WebSocket (varies by broker) **Websocket** (boolean) - When enabled, uses WebSocket transport instead of TCP. This is required for web builds and useful for bypassing firewall restrictions that block standard MQTT ports. **MQTT5** (boolean) - Enables MQTT version 5.0 protocol features. When disabled, uses MQTT 3.1.1 which has broader compatibility with older brokers. **Send Cycle Ms** (int) - Batch duration in milliseconds for signal updates. When set to 0, changes are sent immediately. Values above 0 batch multiple signal updates together for improved performance, reducing network overhead when many signals change rapidly. ### Security Settings [Section titled “Security Settings”](#security-settings) **Security** (boolean) - Master switch for security features. When enabled, allows configuration of authentication credentials and TLS encryption. **UserName** (string) - Username for MQTT broker authentication. Leave empty for anonymous connections. Only visible when Security is enabled. **Password** (string) - Password for authenticated connections. Only visible when Security is enabled. **TLS** (boolean) - Enables TLS/SSL encryption for secure communication. The interface accepts self-signed certificates for development environments. Only visible when Security is enabled. **Delete Last Session Packets** (boolean) - Controls clean session behavior. When enabled, starts with a fresh session discarding any queued messages from previous connections. When disabled, retains and delivers unacknowledged messages from the last session. ### Signal Import Settings [Section titled “Signal Import Settings”](#signal-import-settings) **Use Topic Filters** (boolean) - Enables selective topic import using MQTT wildcard patterns. When disabled, imports all available topics from the broker. **Import Topic Filters** (list) - MQTT wildcard patterns for selective signal import. Supports standard MQTT wildcards: * `+` matches a single level (e.g., `sensor/+/temperature`) * `#` matches multiple levels (e.g., `factory/line1/#`) Only visible when Use Topic Filters is enabled. **Import As Hierarchy** (boolean) - When enabled, creates a GameObject hierarchy matching the MQTT topic structure. Topics like `factory/line1/sensor/temp` create nested GameObjects. When disabled, creates flat structure with underscores replacing slashes. **Max Import Topics** (int) - Limits the number of topics imported to prevent overwhelming the interface with large broker deployments. Set to 0 for unlimited import. ### Runtime State [Section titled “Runtime State”](#runtime-state) **State** (readonly) - Current connection status displayed as “Connected” (green) or “Disconnected” (red). **Input Signals** (readonly) - Number of PLCInput signals (publishing to MQTT). **Output Signals** (readonly) - Number of PLCOutput signals (subscribing from MQTT). **Comm Cycle Ms** (readonly) - Current communication cycle time in milliseconds. **Cycle Count** (readonly) - Number of completed communication cycles since connection. ### Configuration Actions [Section titled “Configuration Actions”](#configuration-actions) **Update Cycle Ms** (int) - Target communication cycle time for the background thread. **Only Transmit Changed Inputs** (boolean) - When enabled, only publishes signals that have changed since the last cycle, reducing network traffic. **Auto Reconnect** (boolean) - Automatically attempts to reconnect when the connection is lost. **Reconnect Interval Seconds** (int) - Time to wait between reconnection attempts. **Max Reconnect Attempts** (int) - Maximum number of reconnection attempts before giving up (0 = unlimited). **Debug Mode** (boolean) - Enables detailed logging for troubleshooting connection and communication issues. ## Signal Management [Section titled “Signal Management”](#signal-management) ### Automatic Signal Import [Section titled “Automatic Signal Import”](#automatic-signal-import) The MQTT interface provides powerful signal discovery and import capabilities: 1. Click the **Import Signals** button in the Inspector 2. The interface connects to the broker and subscribes to topics based on your filter configuration 3. Signals are automatically created for discovered topics with appropriate data types (Bool, Int, Float, or Text) 4. Topics are mapped to GameObject names with special characters sanitized ### Topic Filtering [Section titled “Topic Filtering”](#topic-filtering) Use MQTT wildcard patterns in the Import Topic Filters to selectively import signals: ```plaintext sensor/+/temperature # All temperature sensors machine/press/# # Everything under machine/press +/+/status # All status topics at third level production/line*/+ # Not valid - wildcards must be + or # ``` ### Manual Signal Configuration [Section titled “Manual Signal Configuration”](#manual-signal-configuration) Signals can also be created manually: 1. Add child GameObjects under the MQTT interface 2. Add PLCInput (publish) or PLCOutput (subscribe) components 3. Set the signal’s Name property to the MQTT topic 4. If Name is empty, the GameObject name is used as the topic ### Hierarchical Organization [Section titled “Hierarchical Organization”](#hierarchical-organization) When **Import As Hierarchy** is enabled, the topic structure `factory/line1/plc/status` creates: ```plaintext MQTT Interface └── factory └── line1 └── plc └── status (with Signal component) ``` This organization helps manage large numbers of signals in complex automation systems. ## Usage Examples [Section titled “Usage Examples”](#usage-examples) ### Basic Connection [Section titled “Basic Connection”](#basic-connection) ```csharp // Configure MQTT interface programmatically var mqtt = GetComponent(); mqtt.Broker = "test.mosquitto.org"; mqtt.Port = 1883; mqtt.OpenInterface(); ``` ### Secure Cloud Connection [Section titled “Secure Cloud Connection”](#secure-cloud-connection) For cloud brokers requiring authentication: 1. Enable **Security** 2. Enter broker credentials in **UserName** and **Password** 3. Enable **TLS** for encrypted communication 4. Set appropriate port (typically 8883 for TLS) ### WebSocket for Web Builds [Section titled “WebSocket for Web Builds”](#websocket-for-web-builds) For Unity WebGL builds or firewall-restricted environments: 1. Enable **Websocket** 2. Use WebSocket port (typically 8080 or 8083) 3. Ensure broker supports WebSocket connections ### Performance Optimization [Section titled “Performance Optimization”](#performance-optimization) For high-frequency signal updates: 1. Set **Send Cycle Ms** to batch updates (e.g., 100ms) 2. Enable **Only Transmit Changed Inputs** 3. Use topic filters to limit subscriptions ## See Also [Section titled “See Also”](#see-also) * [Signal Manager](/doc/unity/components-and-scripts/interfaces/signal-manager/) - Managing and organizing signals * [Signal Importer Exporter](/doc/unity/components-and-scripts/interfaces/signal-importer-exporter/) - Import and export signal configurations * [OPC UA Interface](/doc/unity/components-and-scripts/interfaces/opcua/) - Similar protocol for industrial communication * [Interfaces Overview](/doc/unity/components-and-scripts/interfaces/) - Overview of all communication interfaces # OPCUA ### Introduction[](#introduction) [Section titled “ Introduction ”](#-introduction) OPCUA is a standard, maintained by the OPC foundation, for industrial communication. Most of the providers of automation devices´, like PLC and Robot manufacturers, are providing OPCUA servers. Sometimes the OPCUA server is directly integrated into the automation device and sometimes a special software neeeds to be installed on a PC. OPCUA is one important upcoming standard for Industry4.0. For more information please check:\ Caution OPCUA4Unity is available as a standalone asset as well as part of realvirtual.io Professional. The connection to the behavior models (PLCInputs and PLCOutputs) as well as the display of the Signals in the Hierarchy view is part of the realvirtual.io Framework and not available in the OPCUA4Unity standalone asset. ### Installation [Section titled “Installation”](#installation) Both assets, realvirtual.io Professional as well as OPCUA4Unity are installed by using the Unity Asset Store. If you are using the realvirtual.io Framework you are finding the OPCUA Interface after the installation under the path *game4automation/private/interfaces/OPCUA4Unity* If you are using the Standalone version you will find it under the path *OPCUA4Unity* in the Asset folder. ![](/doc/unity/assets/opcua-path.png) if you are using the realvirtual.io Professional version you can use OPCUA4Unity also independent from realvirtual.io. You just need to move the full OPCUA4Unity folder to a new project. ### Demo model [Section titled “Demo model”](#demo-model) In the sub-folder, DemoModel we provide a small demo which is showing you how to use the OPCUA interface independent from the realvirtual.io Framework. The demo model is working with a demo OPCUA Demo server (OPC UA C++ Demo Server V1.6.3 (Windows)) from Unified Automation (). You can download the OPCUA server for free, if you register before at Unified Automation. ![](/doc/unity/assets/opcua-demomodel.png) ### Interface Configuration[](#interface-configuration) [Section titled “Interface Configuration ”](#interface-configuration) If you are using realvirtual.io you can use the tool-bar to add an OPCUA interface to your scene: ![](/doc/unity/assets/rvInsertOPCUA.png) Otherwise you will need to create an empty Gameobject and add the Script OPCUA\_Interface to your Gameobject. For the interface you will need to define at least | Property | Description | | ------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Server IP | The IP address of the server, whether on your machine like the demo server or on an external device | | Server Port | The port of the OPCUA server | | Security Policy | Dropdown for selecting the security policy - standard is NONE | | Path | Defines a subpath of the server (e.g. like 127.0.0.1/opcuaserver/). Should be emtpy if not needed | | Session Timeout Ms | The timeout of the session in Ms if the OPCUA server does not sends an answer | | Top Node Id | The ID of the topnode under which all nodes should be imported. Please note, that you don’t need to import nodes if you would like to use them in your own script code. You can access in script any node the OPCUA server is importing. | | Debug Mode | If set to true the console log will display additional messages for debugging | | Application Name | The OPCUA application name | | Appication URN | The OPCUA Application URN | | Product URI | The OPCUA Product URI | | Client Private Certificate | The path to the client private certificate inside the Streaming Assets Folder (please only use the subpath or the filename directly if certificate is directly inside StreamingAssets). Keep this value emtpy if you are not using certificates for security. | | Client Public Certificate | The path to the client public certificate inside the Streaming Assets Folder. Keep empty if no certificates are used. | | Username | The OPCUA username if username and password are used for security. Otherwise keep it emtpy. | | Password | The password for the user | | Password Signature Algorithm | Password signature algorythm - if password is used. | | Reconnect Time | The time in ms a reconnection attempt is made if connection is broken. | | Max Number of Nodes per Subscription | OPCUA allows multiple nodes in one subscription. Dependend on the OPCUA server the number of subscriptions or the number of nodes in one subscription might be limited. | | Regex Write Nodes | Regex defined here will be used to define WriteNodes and in case of realvirtual.io for all nodes matching this Regex a PLCInput is generated. | | Automatically Input On Write Signals | if true, if a node has a User Access Level of CurrentWrite, automatically WriteValue is set to true and in case of realvirtual.io a PLCInput is generated | | Create Signals (only realvirtual.io) | true if you want to create the G4A signals automatically during importing nodes. | | Automatically Subscribe On Import | if true all Nodes treated as an Input (CurrentRead Nodes) are automatically subscribed for receiving data changes | ![](/doc/unity/assets/rvOPCUAInterface.png) OPCUA Interface inspector ### Unity Events[](#unity-events) [Section titled “Unity Events ”](#unity-events) You can assign Methods to the Events OnConnected, OnDisconnected, OnReconnecting and OnReconnected to get informed in your components about the status of the OPCUA interface. ![](/doc/unity/assets/opcua-events.png) ### Connection troubleshouting[](#connection-troubleshouting) [Section titled “Connection troubleshouting ”](#connection-troubleshouting) If you have problems in connecting to your OPCUA server please follow these steps. 1. Make your own test model. Copy the demo scene and use the configuration without security certificates. Please set server to the IP address of your OPC Server (e.g. 127.0.0.1 if the server is running on the same machine): 2. Use OpcWatch to check if you can reach the server from your machine. Download OpcWatch at this location:\ \ Start OpcWatch on the computer you are running Unity and put in the adress of your OPCUA server:\ ![](/doc/unity/assets/opcua-opcwatchip.png) 3. Check with OpcWatch if it can connect to your OPC Server. Status of server should be shown as connected and you should be able to browse the sub nodes:\ ![](/doc/unity/assets/opcua-watchconnection.png) 4. If you are not able to browse the server check you server configuration. Your server should run with no security settings. No security certificates and passwords should be used for first tests. 5. If you are still unable to browse the server, try to ping the server in a command line (e.g. ping 192.168.0.32). If there is no response from the ping you should check your firewall settings. Please turn the firewall on the server and your computer off. 6. If you are able to browse the server get back to Unity. Check again, that in Unity the Server address in your model is the same as in your test with OpcWatch. Open the demo model and delete all sub nodes. 7. Select node id you where able to browse with OpcWatch and put it into the field *Top Node Id* of the OPCUA\_Interface configuration. Then press import nodes. 8. You should now see the subnodes of your OPC UA server. In the Console you should see the message OPCUA Interface - connected to OPCUA server \[127.0.0.1] on port \[48010]” 9. Compile the application on your target device (Windows, Android, IOs) and test it. 10. If you are still not able to connect on your target device please use a tool to see the log file on your target device like for example 11. Check the debug log on your mobile device. The log message should give you a hint about the problems on your mobile device. #### Generating your own Application certificate [Section titled “Generating your own Application certificate”](#generating-your-own-application-certificate) Danger **Important** Currently certificate based authentification and communication is not supported. We are working on the problem and try to find as soon as possible a solution. ### Importing OPCUA Nodes [Section titled “Importing OPCUA Nodes”](#importing-opcua-nodes) If the interface is configured and the server is accessible you can import the Nodes from the OPCUA server. Push on *Import Nodes* and all nodes (under the Top Node ID) are imported and generated as Gameobjects with attached OPCUA\_Node Scripts: ![](/doc/unity/assets/opcua-importnodes.png) The OPCUA\_Node Script is showing the Node information imported from the OPCUA server: ![](/doc/unity/assets/opcua-node%20\(1\).png) OIPCUA Node With the Button *Read Node* the data can be updated from the server. If the realvirtual.io framework is installed, additionally all corresponding PLCSignals are created. These signals can be dragged and dropped with sensors or drives of the realvirtual.io framework. When you now start the Simulation the OPCUA signals will be exchanged between Unity and the OPCUA Server. ### OPCUA Nodes with realvirtual.io PLCInputs and PLCOutputs [Section titled “OPCUA Nodes with realvirtual.io PLCInputs and PLCOutputs”](#opcua-nodes-with-realvirtualio-plcinputs-and-plcoutputs) Note This section is only valid for customers who are using realvirtual.io together with OPCUA4Unity. OPCUA4Unity is included in realvirtual.io Professional. The OPCUA interface uses in the source code several compile switches based on the Define *realvirtual.io* to define a special behavior for realvirtual.io. During signal import to all imported OPCUA nodes the corresponding PLCInputs and PLCOutput signals are added. PLCOutputs are automatically subscribed on the OPCUA server. PLCInputs should not be subscribed, because they are sent to the OPCUA server by Unity. ![](/doc/unity/assets/opcua-nodeandint.png) OPCUA node with realvirtual.io signal Because in most cases it is not possible to determine, if the OPCUA node should be a PLC input or a PLC output, the booleans *Write Value*, what means that the value is written to the OPCUA server and *Read Value*, what means that the value is read from the OPCUA server. Based on this and on the data type the corresponding PLCInput or PLCOutput script is added to the OPCUA node. Note It is not possible to define an OPCUA node at the same time as PLCInput and PLCOutput. If you try to do that a warning message will be displayed in the log and no PLCInput or PLCOutput script will be added. If you want to use one node as input and output you need to code the interaction yourself (see below). It is possible to define a RegEx in the OPCUA interface configuration to determine automatically which OPCUA symbols should be treated as Input or Output during signal import. One ore multiple Regex can be defined symbol names or parts of symbol names which should be treated as Write Signals - that means PLCInputs or outputs from Unity. If you change anything on the above described realvirtual.io related settings you can update all imported nodes by pushing on the button *Update nodes.* ### Polling OPCU nodes [Section titled “Polling OPCU nodes”](#polling-opcu-nodes) Subscribing to values is generally the recommended approach. However, in certain situations, it may be more practical to poll the value instead. When polling, you can choose the specific cycle in which you want to retrieve the data for each node. To enable polling, you should disable the subscription. Set the poll value to true and specify the polling update rate in milliseconds using PollCycleMs. If you enter 0, the polling will be performed in each FixedUpdate, which could potentially slow down the application. ![](/doc/unity/assets/opcua-nodepolling.png) ### Using OPCUA Nodes with scripting [Section titled “Using OPCUA Nodes with scripting”](#using-opcua-nodes-with-scripting) You find a \](https://realvirtual.io.com/documentation/current/apidoc/html/classrealvirtual.io_1_1_o_p_c_u_a___interface.html%22%3E) full API class documentation online. This section give you just an overview how to use OPCUA nodes based on the demo model. #### Reading Values [Section titled “Reading Values”](#reading-values) For reading values you can use two methods. **Direct reading** First one (not recommended one) is to read directly from the OPCUA server with the commands ```csharp var myvar = Interface.ReadNodeValue ("ns=2;s=Demo.Dynamic.Scalar.UInt64") ``` You can find this methods on the OPCUA\_Node Script as well as on the interface itself. If you have a direct reference to the Interface in your method you can do like this: ```csharp using UnityEditor; using UnityEngine; using realvirtual.io; public class DemoReadNodeNotRecommended : MonoBehaviour { public OPCUA_Interface Interface; public string NodeId; // Update is called once per frame void Update() { float myvar = (float)Interface.ReadNodeValue(NodeId); } } ``` Note This method is not recommended because the read is not done multithreaded and this might block or slow your application. **Subscribing to node value changes** This is the recommended method. You should register to the EventOnConnected Event and when the Interface gets connected you can subscribe to the node changes. Here is an example: ```csharp public class DemoMoveCubeWithDelegate : MonoBehaviour { public OPCUA_Interface Interface; public string NodeId; public float PositionY; private OPCUA_Node node; private OPCUANodeSubscription subscription; // Start is called before the first frame update void Start() { if (Interface != null) Interface.EventOnConnected.AddListener(OnConnected); } public void OnConnected() { subscription = Interface.Subscribe(NodeId, NodeChanged); } public void NodeChanged(OPCUANodeSubscription sub, object obj) // Is called when Node Value of Node nodeid is changed { PositionY = (float) obj; // sets the new position based on the new value } // Update is called once per frame void Update() { transform.rotation = Quaternion.Euler(new Vector3(0, PositionY, 0)); } } ``` #### Writing Values[](#writing-values) [Section titled “Writing Values ”](#writing-values) You can write values like this: ```csharp bool success = Interface.WriteNodeValue ("ns=2;s=Demo.Dynamic.Scalar.Float",100) ``` © 2025 realvirtual GmbH [https://realvirtual.io](https://realvirtual.io/) - All rights reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or by any means, including printing, saving, photocopying, recording, or other electronic or mechanical methods, without the prior written permission of the publisher. # OpenCommissioning Interface Tip **Special Thanks** We would like to extend our sincere gratitude to the [OpenCommissioning](https://github.com/OpenCommissioning) team for developing and maintaining this exceptional open-source framework for industrial automation simulation. OpenCommissioning’s commitment to open standards and collaborative development enables seamless integration across different simulation platforms and tools, advancing the entire virtual commissioning ecosystem. Note This feature was added in realvirtual **6.0.8-8217** (Professional & Starter) ## Overview [Section titled “Overview”](#overview) The OpenCommissioning interface integration bridges realvirtual components with the [OpenCommissioning](https://github.com/OpenCommissioning) open-source framework. OpenCommissioning provides a standardized shared memory communication system for industrial automation simulation, enabling real-time data exchange between simulation components and external control systems. OpenCommissioning uses **TwinCAT** as its realtime environment, providing deterministic execution for virtual commissioning applications. Through OpenCommissioning and Beckhoff hardware, **real fieldbus simulation** becomes possible, allowing direct connection to actual industrial fieldbus networks. realvirtual’s OpenCommissioning integration provides 7 specialized link components that automatically connect realvirtual simulation components (drives, sensors, grippers, lamps) to OpenCommissioning’s communication infrastructure. This integration enables seamless interoperability with other OpenCommissioning-compatible tools and systems. **Learn More:** * [OpenCommissioning GitHub](https://github.com/OpenCommissioning) - Main repository and documentation * [OC Unity Core Package](https://github.com/OpenCommissioning/OC_Unity_Core) - Unity integration package **Key Benefits:** * Standardized industrial communication using open-source protocols * Zero-configuration integration with automatic activation * Real-time bidirectional data exchange with external systems * Compatible with existing realvirtual simulation models ![](/doc/unity/assets/opencommissioning-unity-inspector.png) OpenCommissioning demo scene showing realvirtual components integrated with OC Link components ## Installation [Section titled “Installation”](#installation) **Step 1: Install OpenCommissioning Package** Install the OpenCommissioning Unity package from GitHub using Unity Package Manager: 1. Open Unity Package Manager (Window > Package Manager) 2. Click the **+** button and select **Add package from git URL** 3. Enter: `https://github.com/OpenCommissioning/OC_Unity_Core.git` 4. Click **Add** **Step 2: Automatic Activation** Once the OpenCommissioning package is installed, realvirtual automatically activates the integration: * The `REALVIRTUAL_OPENCOMMISSIONING` compiler directive is enabled * OC Link components become available in the Component menu * No additional configuration required **Step 3: Add TcAdsClient Component** Add the **TcAdsClient** component to your top-level scene GameObject: 1. Select your main scene root GameObject (e.g., “DemoCell” in the demo scene) 2. Click **Add Component** and search for “TcAdsClient” 3. Configure the TwinCAT ADS connection settings as needed This component manages the TwinCAT ADS communication between Unity and the OpenCommissioning realtime environment. **Step 4: Verify Installation** Confirm successful installation by checking that **Component > realvirtual > OpenCommissioning** appears in the Unity menu with all 7 link components available. ## Available Components [Section titled “Available Components”](#available-components) realvirtual provides 7 specialized link components that connect realvirtual simulation components to OpenCommissioning’s shared memory system: ![](/doc/unity/assets/opencommissioning-component-menu.png) OpenCommissioning category in the realvirtual Component menu ![](/doc/unity/assets/opencommissioning-add-component.png) All seven OC Link components available when OpenCommissioning package is installed **OC Link Cylinder** Links realvirtual Drive\_Cylinder components to OpenCommissioning. Provides position control and status feedback for pneumatic cylinder simulation with extend/retract commands. **OC Link Drive Position** Connects position-based drives to OpenCommissioning. Enables precise position control with target position commands and current position feedback. **OC Link Drive Simple** Links drives with forward/backward control to OpenCommissioning. Provides simple directional control with status feedback for basic conveyor and transport applications. **OC Link Drive Speed** Connects speed-controlled drives to OpenCommissioning. Enables variable speed control with real-time speed commands and feedback. **OC Link Grip** Links realvirtual Grip components to OpenCommissioning. Provides grip/release commands and status feedback for automated part handling and gripping operations. **OC Link Lamp** Connects realvirtual Lamp components to OpenCommissioning. Enables remote control of indicator lamps and visual status signals. **OC Link Sensor** Links realvirtual Sensor components to OpenCommissioning. Provides sensor state output to external systems for proximity detection and part presence monitoring. ## Quick Start [Section titled “Quick Start”](#quick-start) This example demonstrates setting up an OpenCommissioning-linked conveyor with sensor control: 1. **Create or open a scene** with a realvirtual Drive component (e.g., a conveyor belt with Drive\_Simple) 2. **Add OC Link Drive Simple component:** * Select the GameObject with the Drive\_Simple component * Click **Component > realvirtual > OpenCommissioning > OC Link Drive Simple** 3. **Configure the link:** * The link automatically detects the Drive\_Simple component on the same GameObject * Set **Communication Name** to identify this drive in OpenCommissioning (e.g., “Conveyor\_Main”) * Enable **Auto Connect** to establish connection on scene start 4. **Add sensor integration:** * Create a realvirtual Sensor component at the conveyor endpoint * Add **OC Link Sensor** component to the sensor GameObject * Set **Communication Name** to “Sensor\_Endpoint” 5. **Test the integration:** * Enter Play mode * Verify connection status in the **Status** section of OC Link inspectors * Control the conveyor through OpenCommissioning shared memory * Monitor sensor state changes in real-time ![](/doc/unity/assets/opencommissioning-drive-simple.jpg) OC Link Drive Simple inspector showing Control, Status, References, Settings, Communication, and Events sections ## Component Properties [Section titled “Component Properties”](#component-properties) All OC Link components share common properties organized into collapsible sections: **Control Section** * **Forward** (button) - Manually trigger forward motion for testing * **Backward** (button) - Manually trigger backward motion for testing * Component-specific controls vary by link type **Status Section** * **Connection Status** (indicator) - Shows OpenCommissioning connection state (green = connected, red = disconnected) * **Current State** (text) - Displays current operational state * Component-specific status fields **References Section** * **Linked Component** (reference) - Automatically detected realvirtual component on same GameObject * Can be manually assigned if component is on different GameObject **Settings Section** * **Communication Name** (string) - Unique identifier for OpenCommissioning shared memory mapping * **Auto Connect** (boolean) - Automatically establish connection when scene starts * **Update Rate** (float) - Communication update frequency in milliseconds **Communication Section** * **Shared Memory Address** (text) - Current shared memory location (read-only) * **Last Update Time** (text) - Timestamp of most recent communication (read-only) * **Error Count** (number) - Number of communication errors since connection (read-only) **Events Section** * **On Connected** (UnityEvent) - Triggered when OpenCommissioning connection established * **On Disconnected** (UnityEvent) - Triggered when connection lost * Component-specific events for state changes ## See Also [Section titled “See Also”](#see-also) * [S7 Interface](/doc/unity/components-and-scripts/interfaces/s7-tcp/) - Siemens S7 PLC communication * [OPC UA Interface](/doc/unity/components-and-scripts/interfaces/opcua/) - OPC UA industrial protocol * [Drive Components](/doc/unity/components-and-scripts/motion/drive/) - realvirtual drive system * [Sensor Component](/doc/unity/components-and-scripts/sensors/sensor/) - Proximity and detection sensors * [Grip Component](/doc/unity/components-and-scripts/picking-and-placing-mus/grip/) - Automated gripping system # PLCInputTransform PLCInputTransform is a signal component that receives position and rotation data from external systems as a Unity Pose structure. This signal type is particularly useful for tracking positions from external controllers, robots, or motion systems. ## Overview [Section titled “Overview”](#overview) PLCInputTransform automatically reads the transform data (position and rotation) from the GameObject it’s attached to and provides this information to external systems through various interfaces. The component continuously updates its value based on the GameObject’s local transform in `FixedUpdate()`. ## Properties [Section titled “Properties”](#properties) ### Value [Section titled “Value”](#value) The current transform data as a Unity Pose structure. * **Type**: Pose (Vector3 position + Quaternion rotation) * **Default**: Transform position and rotation at initialization * **Use case**: Contains both position (x, y, z coordinates) and rotation (quaternion) data for complete 6DOF information ### Status [Section titled “Status”](#status) Internal status information for the signal. * **Type**: StatusTransform * **Use case**: Tracks connection status and value changes for interface management ## Usage Examples [Section titled “Usage Examples”](#usage-examples) ### Basic Setup [Section titled “Basic Setup”](#basic-setup) 1. Add PLCInputTransform component to a GameObject whose position you want to monitor 2. The component automatically reads the GameObject’s local position and rotation 3. Connect the signal to your interface (S7, OPC-UA, MQTT, etc.) 4. External systems can now read the 6DOF transform data ### Robot Position Feedback [Section titled “Robot Position Feedback”](#robot-position-feedback) ```csharp // Example of accessing transform data in a custom script public class RobotController : MonoBehaviour { public PLCInputTransform robotPositionSignal; void Update() { if (robotPositionSignal != null) { Pose currentPose = robotPositionSignal.Value; Vector3 position = currentPose.position; Quaternion rotation = currentPose.rotation; // Use position and rotation data as needed Debug.Log($"Robot at: {position}, rotation: {rotation.eulerAngles}"); } } } ``` ### Interface Integration [Section titled “Interface Integration”](#interface-integration) PLCInputTransform works with all realvirtual interfaces that support transform data: * **S7 TCP**: Sends 28 bytes (7 floats: x,y,z position + x,y,z,w quaternion) * **OPC-UA**: Provides structured data with position and rotation components * **MQTT**: Publishes transform data as binary or JSON format * **Modbus**: Transmits as float register arrays ## Data Format [Section titled “Data Format”](#data-format) The transform data is internally stored as: * **Position**: Vector3 (x, y, z coordinates in millimeters) * **Rotation**: Quaternion (x, y, z, w components for orientation) * **Byte Size**: 28 bytes total (7 × 4-byte floats) ## Methods [Section titled “Methods”](#methods) ### Public Methods [Section titled “Public Methods”](#public-methods) #### SetValue(Pose value) [Section titled “SetValue(Pose value)”](#setvaluepose-value) Manually sets the transform value. * **Parameters**: value - Unity Pose containing position and rotation * **Use case**: Override automatic transform reading for specific scenarios #### SetValueToTransform() [Section titled “SetValueToTransform()”](#setvaluetotransform) Updates the signal value from the GameObject’s current transform. * **Use case**: Force immediate update of transform data #### SetTransformFromValue() [Section titled “SetTransformFromValue()”](#settransformfromvalue) Applies the signal value to the GameObject’s transform. * **Use case**: Apply received transform data to the GameObject ## Automatic Updates [Section titled “Automatic Updates”](#automatic-updates) PLCInputTransform automatically updates its value every `FixedUpdate()` cycle by reading the GameObject’s local transform. This ensures real-time tracking of object movement without manual intervention. ## See Also [Section titled “See Also”](#see-also) * [PLCOutputTransform](/doc/unity/components-and-scripts/interfaces/plc-output-transform/) - For receiving transform data from external systems * [Interfaces](/doc/unity/components-and-scripts/interfaces/) - Overview of all signal types and interface concepts * [S7 TCP](/doc/unity/components-and-scripts/interfaces/s7-tcp/) - Siemens S7 interface supporting transform data * [OPC-UA](/doc/unity/components-and-scripts/interfaces/opcua/) - Industrial communication protocol with structured data support *** © 2025 realvirtual GmbH [https://realvirtual.io](https://realvirtual.io/) - All rights reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or by any means, including printing, saving, photocopying, recording, or other electronic or mechanical methods, without the prior written permission of the publisher. # PLCOutputTransform PLCOutputTransform is a signal component that receives position and rotation data from external systems and applies it to Unity GameObjects. This signal type is essential for controlling object positions from external controllers, robots, or motion planning systems. ## Overview [Section titled “Overview”](#overview) PLCOutputTransform receives transform data from external interfaces and automatically applies position and rotation changes to the GameObject it’s attached to. The component handles both receiving data from external systems and applying it to the Unity transform in real-time. ## Properties [Section titled “Properties”](#properties) ### Value [Section titled “Value”](#value) The current transform data as a Unity Pose structure. * **Type**: Pose (Vector3 position + Quaternion rotation) * **Default**: Transform position and rotation at initialization * **Use case**: Contains both position (x, y, z coordinates) and rotation (quaternion) data for complete 6DOF control ### Status [Section titled “Status”](#status) Internal status information for the signal. * **Type**: StatusTransform * **Use case**: Tracks connection status and value changes for interface management ## Usage Examples [Section titled “Usage Examples”](#usage-examples) ### Basic Setup [Section titled “Basic Setup”](#basic-setup) 1. Add PLCOutputTransform component to a GameObject you want to control externally 2. Connect the signal to your interface (S7, OPC-UA, MQTT, etc.) 3. External systems can now send position and rotation commands 4. The GameObject automatically moves to received positions ### Robot Control [Section titled “Robot Control”](#robot-control) ```csharp // Example of controlling transform from a custom script public class RobotTargetController : MonoBehaviour { public PLCOutputTransform robotTargetSignal; void SetRobotTarget(Vector3 position, Quaternion rotation) { if (robotTargetSignal != null) { Pose targetPose = new Pose(position, rotation); robotTargetSignal.SetValue(targetPose); } } void MoveToPosition(float x, float y, float z) { Vector3 targetPos = new Vector3(x, y, z); Quaternion currentRot = transform.rotation; SetRobotTarget(targetPos, currentRot); } } ``` ### Interface Integration [Section titled “Interface Integration”](#interface-integration) PLCOutputTransform works with all realvirtual interfaces that support transform data: * **S7 TCP**: Receives 28 bytes (7 floats: x,y,z position + x,y,z,w quaternion) * **OPC-UA**: Subscribes to structured data with position and rotation components * **MQTT**: Receives transform data as binary or JSON format * **Modbus**: Reads from float register arrays ## Data Format [Section titled “Data Format”](#data-format) The transform data is internally stored as: * **Position**: Vector3 (x, y, z coordinates in millimeters) * **Rotation**: Quaternion (x, y, z, w components for orientation) * **Byte Size**: 28 bytes total (7 × 4-byte floats) ## Methods [Section titled “Methods”](#methods) ### Public Methods [Section titled “Public Methods”](#public-methods) #### SetValue(Pose value) [Section titled “SetValue(Pose value)”](#setvaluepose-value) Sets the transform value and triggers GameObject movement. * **Parameters**: value - Unity Pose containing position and rotation * **Use case**: Programmatically control object position and rotation #### SetValue(byte\[] value) [Section titled “SetValue(byte\[\] value)”](#setvaluebyte-value) Sets the transform value from byte array received from interface. * **Parameters**: value - 28-byte array containing position and rotation data * **Use case**: Internal method used by interfaces to update transform #### SetTransformFromValue() [Section titled “SetTransformFromValue()”](#settransformfromvalue) Applies the current signal value to the GameObject’s transform. * **Use case**: Force immediate application of received transform data #### SetValueToTransform() [Section titled “SetValueToTransform()”](#setvaluetotransform) Updates the signal value from the GameObject’s current transform. * **Use case**: Synchronize signal value with current GameObject position ## Automatic Updates [Section titled “Automatic Updates”](#automatic-updates) PLCOutputTransform automatically applies received transform data to the GameObject in `FixedUpdate()` when new values are received. This ensures smooth, real-time positioning without manual intervention. ## Motion Smoothing [Section titled “Motion Smoothing”](#motion-smoothing) The component applies transform changes directly without interpolation. For smooth motion between positions, consider: * Using intermediate waypoints from your external controller * Implementing motion planning in your PLC or external system * Adding animation components for interpolated movement ## Coordinate Systems [Section titled “Coordinate Systems”](#coordinate-systems) PLCOutputTransform uses Unity’s local coordinate system: * **Position**: Local position relative to parent GameObject * **Rotation**: Local rotation relative to parent GameObject * **Units**: Position values are typically in millimeters (realvirtual standard) ## See Also [Section titled “See Also”](#see-also) * [PLCInputTransform](/doc/unity/components-and-scripts/interfaces/plc-input-transform/) - For sending transform data to external systems * [Interfaces](/doc/unity/components-and-scripts/interfaces/) - Overview of all signal types and interface concepts * [S7 TCP](/doc/unity/components-and-scripts/interfaces/s7-tcp/) - Siemens S7 interface supporting transform data * [OPC-UA](/doc/unity/components-and-scripts/interfaces/opcua/) - Industrial communication protocol with structured data support *** © 2025 realvirtual GmbH [https://realvirtual.io](https://realvirtual.io/) - All rights reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or by any means, including printing, saving, photocopying, recording, or other electronic or mechanical methods, without the prior written permission of the publisher. # PLCSIM Advanced > Connecting virtual Siemens PLCs with realvirtual.io Caution This Interface is only available in realvirtual.io Professional ### Introduction [Section titled “Introduction”](#introduction) PLCCSIM-Advanced is a virtual PLC from Siemens. PLCCSIM-Advanced can be used to simulate S7-1500 PLCs. If you use PLCSim-Advanced no real PLC is needed. > PLCCSIM-Advanced will work in a multi-threaded mode by starting a parallel .exe command line programm. The PLCCSIM-Advanced interface will only work in Windows environments. Please check the Siemens Website for more information about PLCCSIM-Advanced:\ Here is a short Youtube Tutorial showing you the interface in action: [Video](https://www.youtube-nocookie.com/embed/BZtHKd0lCiY) Note **realvirtual CONNECT talks to PLCSIM Advanced without a coupler.** If you use realvirtual WEB through realvirtual CONNECT, you do not need this interface, the coupler process or the shared-memory bridge at all: CONNECT drives the Siemens simulation API directly in its own process. It addresses tags **symbolically**, browses the instance’s tag list, works with optimized data blocks and over Softbus, and needs neither PUT/GET nor absolute addresses. See [Supported Protocols — PLCSIM Advanced](https://realvirtual.io/doc/web/connect/interfaces/protocols/) in the CONNECT documentation. The Unity interface described below stays unchanged and is the right choice when the simulation runs in the Unity Editor or a Unity build. ### Interface configuration[](#interface-configuration) [Section titled “Interface configuration ”](#interface-configuration) For using the PLCSim-Advanced Interface, you need to add an interface to your scene by selecting *Tools > realvirtual> Add Component > Interface > PLCSIMAdvanced* or you add the Script SharedMemoryInterface to an empty Gameobject. Danger For working in a Unity Build, this interface requires `Allow unsafe Code` to be turned on in Player Settings. ![](/doc/unity/assets/plcsimadvanced-unsafecode.png) Note **New in Version 6.0.7**: The PLCSim Advanced Interface now features an automated setup system that streamlines the configuration process. The entire setup now takes 40-70 seconds with real-time progress indicators and automatic detection of Siemens DLLs. ### Automated Setup Process [Section titled “Automated Setup Process”](#automated-setup-process) As a prerequisite, you need to have PLCSIM-Advanced installed on your computer. Starting with version 6.0.7, the setup process has been greatly simplified with a single-click automated setup system. ![Automated setup interface showing dynamic status indicators and single-button setup](/doc/unity/assets/plcsimadvanced-automated-setup.png) PLCSim Advanced automated setup interface with real-time progress indicators The automated setup performs two steps automatically: 1. **Auto-detect Siemens DLL**: The system automatically searches for the Siemens.Simatic.Simulation.Runtime.Api.x86.dll in four common installation paths. API 3.0 is checked first and preferred over API 2.0: * C:/Program Files (x86)/Common Files/Siemens/PLCSIMADV/API/3.0/ (checked first) * C:/Program Files (x86)/Common Files/Siemens/PLCSIMADV/API/2.0/ * C:/Program Files/Common Files/Siemens/PLCSIMADV/API/3.0/ * C:/Program Files/Common Files/Siemens/PLCSIMADV/API/2.0/ The detected path is used as an installation check only — the DLL is no longer copied anywhere. 2. **Download PLCSimAdvancedCoupler.exe**: If not already present, the system automatically downloads the required coupler executable from the realvirtual repository. Caution **Delete an old Siemens DLL from StreamingAssets.** Earlier versions copied *Siemens.Simatic.Simulation.Runtime.Api.x86.dll* into the StreamingAssets folder as a third setup step. The coupler now loads the PLCSIM Advanced API that is actually installed on the machine, and a copy next to the executable shadows it — typically with the message “PLCSIMAdvanced Runtime Not available”. If the file is still in your StreamingAssets folder, delete it. The interface writes a warning to the console when it finds it. The **InfoBox** at the top of the inspector provides real-time feedback during setup: * **⚠ Warning**: Indicates setup is required or incomplete * **ℹ Progress**: Shows current operation in progress with detailed status * **✓ Complete**: Confirms setup is finished and ready to use Simply click the **“Setup PLCSim Advanced Interface”** button to start the automated setup process. The system will display progress for each step, and the entire process typically completes in 40-70 seconds. ### Connection Configuration [Section titled “Connection Configuration”](#connection-configuration) After setup is complete, configure the connection parameters: ![](/doc/unity/assets/plcsimadvanced.png) PLCSIM Advanced Interface connection settings For connecting you need to define the PLCCSIM-Advanced *Instance Name* as well as the synchronization cycle in Ms under *Sync Cycle Ms*: If you select *Pause With Unity*, PLCCSIM-Advanced will pause as long as Unity is paused. *DebugMode* turns on a special debug mode, where all signals are also displayed in the command line prompt. This might take quite a time during the simulation start. Please turn this off for productive use. *If HMIOnly* is turned on, only variables which are marked as HMI variables in the PLC project itself are imported. You are now able to import the Signals of PLCSim-Advanced by selecting *Import Signals*. All PLCSignals will be created automatically as sub-objects under the interface. After importing the Signals you can start the simulation. The signals will be exchanged between Unity and PLCCSIM-Advanced automatically. ### Signal Import Filter [Section titled “Signal Import Filter”](#signal-import-filter) Note This feature was added in realvirtual **6.3.6** (Professional). Large PLC programs often contain many thousand signals, but a simulation usually needs only a small part of them. Every imported signal becomes a GameObject below the interface, so importing all of them makes entering play mode noticeably slower. With the signal import filter you decide which signals are imported at all. Turn on **Use Signal Filter** to activate the filter: * **Import Include Filters** – A list of regular expressions. A signal is imported when its name matches at least one of the patterns. An empty list imports all signals. * **Import Exclude Filters** – A list of regular expressions. A signal matching any of these patterns is never imported. The exclude patterns are applied after the include patterns. * **Filter Ignore Case** – Matches the patterns without regarding upper and lower case. * **Signals Imported** / **Signals Filtered** – Show how many signals the last import created and how many were skipped. Filtered signals are skipped before the GameObject is created, so they exist neither in the scene nor in the cyclic signal exchange. Typical patterns: | Pattern | Matches | | ----------------- | --------------------------------------------- | | `^HMI_` | all signals starting with `HMI_` | | `Conveyor.*Speed` | `Conveyor1Speed`, `Conveyor_12_Speed`, … | | `^Axis[0-9]+_` | `Axis1_Pos`, `Axis12_Speed`, … | | `^Diag_` | as an exclude pattern: all diagnostic signals | If a scene was already imported without a filter, define the filter and use **Delete Signals Not Matching Filter** to remove the signals which are no longer needed. Signals referenced by drives, sensors or scripts lose their connection when they are deleted, so the button asks for confirmation. ### Importing Data Block Tags [Section titled “Importing Data Block Tags”](#importing-data-block-tags) Note This feature was added in realvirtual **6.3.6** (Professional) and requires PLCSimAdvancedCoupler.exe **6.1.11** or newer. Run **Setup PLCSim Advanced Interface** once to get the matching coupler. By default the interface exchanges the process image only — inputs and outputs. Many TIA projects keep the values a simulation needs in global data blocks instead: setpoints, recipes, status words or a dedicated HMI interface DB. Those tags are imported on demand. Enter the exact data block names in **Import Data Blocks**: * Use the block name as it appears in TIA Portal, without quotation marks and **without wildcards**. Siemens only accepts exact names. * A name that does not exist in the PLC program is ignored silently by PLCSIM Advanced. The coupler window therefore prints how many tags each requested block contributed — a block with `0 entries` is almost always a typo or a wrong upper/lower case spelling. * **Data Block Tags Imported** shows how many data block tags the last import created. * Names containing `;`, `"` or `\` cannot be passed to the coupler and are rejected with an error message. Leave the list empty to keep the previous behaviour: only inputs and outputs are exchanged. #### Direction: the signal type decides [Section titled “Direction: the signal type decides”](#direction-the-signal-type-decides) The PLC cannot tell whether your simulation reads a data block tag or writes it, so the signal component below the interface decides — exactly like the [S7 TCP/IP interface](/doc/unity/components-and-scripts/interfaces/s7-tcp/) handles DB addresses: | Component on the tag’s GameObject | Meaning | | ------------------------------------------------------------ | ------------------------------------------------------------------------------------------- | | **PLCOutput…** (PLCOutputBool, PLCOutputInt, PLCOutputFloat) | The simulation **reads** the tag from the PLC. This is the default for newly imported tags. | | **PLCInput…** (PLCInputBool, PLCInputInt, PLCInputFloat) | The simulation **writes** the tag into the PLC. | To turn a tag into one the simulation writes, remove the **PLCOutput…** component from its GameObject and add the matching **PLCInput…** component instead. Keep the GameObject name unchanged — it is the PLC tag name. The new direction takes effect with the next import, which also happens automatically every time you enter play mode. Caution Change the direction in edit mode only. The direction of the running exchange is frozen at import time, so swapping a component while the simulation runs has no effect until the next import. If the data type of a tag changed in TIA Portal (for example INT to REAL), the old signal component is still on the GameObject. The import reports such a tag with an error and skips it — delete the outdated component on that GameObject and import again. #### Writing and reading the same tag [Section titled “Writing and reading the same tag”](#writing-and-reading-the-same-tag) A tag the simulation writes is not read back while it is written: the value from Unity wins, and PLC writes through the API take effect at the cycle control point. Do not write a tag from the PLC program and from the simulation at the same time; decide per tag which side owns it. #### Limits [Section titled “Limits”](#limits) * **Tag list size**: PLCSIM Advanced reserves memory for up to 500 000 tag list entries, and **every array and structure element counts**. Importing whole data blocks with large arrays can exceed this and makes the API report `NotEnoughMemory` (-43). The coupler then falls back to HMI-visible tags only and says so in its window. Import fewer blocks, or mark the needed tags as *Accessible from HMI* in TIA Portal and turn on **HMI Only**, which applies to data block tags as well. * **Supported types**: BOOL, BYTE, WORD, DWORD, INT, DINT and REAL. Whole structures and arrays cannot be accessed by the API, so only their primitive elements are imported. 64-bit types (LINT, LREAL, LWORD) are not transported for data block tags, because they cannot be written safely through the 4-byte exchange slot. * **Failsafe data blocks**: Variables in F-DBs and F-I/O DBs can only be changed while safety mode is deactivated (SIMATIC Safety — Configuring and Programming, chapter 10.7.4). Writing them from the simulation has no effect during safety operation. Caution Importing more than 2000 signals writes a warning to the console. Scenes with many thousand signal GameObjects take significantly longer to enter play mode — use the filter to keep the number of imported signals low. Note A separate .EXE file *PLCSimAdvancedCoupler.EXE* needs to be started for the PLCCSIM-Advanced Interface. This is due to the fact, that the Siemens DLLs can’t compile under Unity. For this the separate *PLCSimAdvancedCoupler.EXE* is creating a Shared Memory Interface to exchange the Signals between Unity and *PLCSimAdvancedCoupler.EXE*. The EXE itself is exchanging the values with PLCSim-Advanced. This is just for your information, as *PLCSimAdvancedCoupler.EXE* is part of the asset delivery and is copied automatically to the StreamingAssets folder and will be started automatically during Simulation startup or for the import of signals. ### Compatibility and Automatic Recovery [Section titled “Compatibility and Automatic Recovery”](#compatibility-and-automatic-recovery) #### Input write permissions [Section titled “Input write permissions”](#input-write-permissions) The interface and **PLCSimAdvancedCoupler.exe** must use matching shared-memory protocol versions. The updated interface requires **protocol 1** and refuses to start an older coupler. Update both files together. An incompatible download is rejected and the existing executable is retained. The other direction is covered as well: a coupler **6.1.12 or newer** also serves interfaces of realvirtual versions before 6.3.6. It notices within a few seconds that such an interface publishes no write permissions and then exchanges the inputs exactly as the earlier couplers did, so the public download link can always carry the current coupler without breaking older installations. The coupler window reports this as *Legacy client detected*; the per-input write permissions described below need the current interface. Only imported inputs with **Active** enabled are written to the PLC. Excluded or inactive inputs are left untouched; disabling an input does not reset its value in the PLC. Writes start after the interface has transferred a complete set of values and permissions. Importing signals or rebuilding the connection does not by itself enable input writes. #### Usage example [Section titled “Usage example”](#usage-example) Import the required PLC tags, then assign the generated signal to your simulation component. For example, a simulated sensor can supply an input during initialization and subsequent physics updates: ```csharp using realvirtual; using UnityEngine; public class SimulatedSensor : MonoBehaviour { public PLCInputBool SensorInput; public bool Occupied; private void Awake() { SensorInput.Value = Occupied; } private void FixedUpdate() { SensorInput.Value = Occupied; } } ``` Assign the signal before entering Play mode. Use **Import Include Filters** to select only the inputs your model supplies. Set **Active** to false to stop writing an individual input after the next interface update. PLC outputs remain readable. Siemens also supplies a Visual Studio co-simulation example under [Entry 109739660: S7-PLCSIM Advanced Getting Started](https://support.industry.siemens.com/cs/ww/en/view/109739660). It demonstrates API-based sensor updates; it is not a dedicated Safety test example. For F-inputs, explicitly identify the channel and its value-status signal from your TIA project. The interface does not identify Safety tags automatically or set them to true. Any simulated channel fault must use the appropriate channel/value-status combination. These semantics and the distinction between F-input simulation and modifying F-DBs are described in [Siemens: Testing the Safety program with S7-PLCSIM/S7-PLCSIM Advanced](https://docs.tia.siemens.cloud/r/en-us/v20/simatic-safety-configuring-and-programming/compiling-and-commissioning-a-safety-program/testing-the-safety-program/testing-the-safety-program-with-s7-plcsim/s7-plcsim-advanced). The write-permission correction addresses general input handling. A project-specific Safety failure has not been reproduced. Note This behavior was improved in realvirtual **6.3.5** (Professional). The coupler is tolerant of the installed PLCSIM Advanced version. It automatically loads with a compatible API version, so the same build connects whether you run an older PLCSIM Advanced installation or a current V8 runtime — no manual DLL selection is required for the connection to succeed. When you download a changed program from TIA Portal onto the running PLC, the interface no longer stops. Signal exchange is paused while the download is in progress, and the interface automatically reconnects and re-imports the (possibly changed) signals once the download has finished. For diagnostics the coupler writes a **coupler.log** next to *PLCSimAdvancedCoupler.exe*. It records the loaded API version, the running Runtime Manager version and any communication errors — send this file if you ever need support. The previous run is preserved as **coupler.prev.log**. ### Which interface? [Section titled “Which interface?”](#which-interface) realvirtual offers three ways to work with PLCSIM Advanced: * **PLCSIM Advanced (this page)** – the coupler interface. The Siemens API runs in the separate coupler process, so a problem in the Siemens library cannot end Unity. It stays fully supported for existing and new projects. * **[PLCSIM Advanced Native (Pro)](/doc/unity/components-and-scripts/interfaces/plcsim-advanced-native/)** – preview of an in-process interface that uses the native Siemens runtime API without a coupler process or download. The Siemens backend of its plugin is not included yet. * **[realvirtual CONNECT](https://realvirtual.io/doc/web/connect/interfaces/protocols/)** – for realvirtual WEB, without Unity. Never connect the coupler interface and the native interface to the same PLCSIM Advanced instance at the same time. © 2025 realvirtual GmbH [https://realvirtual.io](https://realvirtual.io/) - All rights reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or by any means, including printing, saving, photocopying, recording, or other electronic or mechanical methods, without the prior written permission of the publisher. # PLCSIM Advanced Native (Pro) > Connecting Siemens PLCSIM Advanced in-process through the native Siemens runtime API (preview) Caution **Preview.** The PLCSIM Advanced Native interface is part of realvirtual **6.3.6** (Professional) as a preview. It is built on the Siemens runtime API 6.0 and contains the complete connection to PLCSIM Advanced, but it has not yet been released for production projects. Use the [PLCSIM Advanced](/doc/unity/components-and-scripts/interfaces/plcsim-advanced/) interface (coupler) for production projects, and send us your feedback if you try the native interface. ## Overview [Section titled “Overview”](#overview) The **PLCSIM Advanced Native** interface connects your realvirtual simulation to a running Siemens PLCSIM Advanced instance **inside the Unity process**. It uses the official native Siemens runtime API through the realvirtual plugin *rv\_plcsim.dll* — there is no external coupler process, no shared memory and no coupler download. The Siemens API DLL is loaded from your PLCSIM Advanced installation at runtime and is never shipped with realvirtual. The interface is built on the realvirtual FastInterface standard: it reconnects automatically, shows the connection state in the Inspector and exchanges all signals once per communication cycle as one batch. It works in the Unity Editor and in Windows x64 builds (Mono and IL2CPP). It exists **next to** the [PLCSIM Advanced](/doc/unity/components-and-scripts/interfaces/plcsim-advanced/) coupler interface, which stays fully supported for existing projects. See [Which interface?](#which-interface) below. Danger **In-process trade-off.** Because the Siemens runtime library runs inside the Unity process, a crash inside that library ends Unity. The coupler interface isolates the Siemens API in a separate process and does not have this risk. ## Requirements [Section titled “Requirements”](#requirements) * Windows x64, Unity Editor or Windows Standalone build * Siemens PLCSIM Advanced installed on the **same** computer, including the **API folder matching the plugin** (*API\6.0*; PLCSIM Advanced V6, V7 and V8 install it). The Siemens API interfaces are not compatible between major versions, so the plugin only uses the API version it was built for. If only other versions are installed, the Inspector names the required and the found versions. * A running PLCSIM Advanced instance (started from the PLCSIM Advanced Control Panel or by a TIA Portal download) ## Quick Start [Section titled “Quick Start”](#quick-start) 1. Select **Tools > realvirtual > Add Interface > PLCSIM Advanced Native (Pro)**, or add the component **realvirtual > Interfaces > PLCSIM Advanced (Native)** to an empty GameObject. 2. Check the setup box. The interface detects the Siemens API automatically; click **Detect Siemens API** to search again or **Select DLL…** to pick *Siemens.Simatic.Simulation.Runtime.Api.x64.dll* manually. 3. Enter the **Instance Name** exactly as shown in the PLCSIM Advanced Control Panel. 4. Click **⬇️ Import Signals**. One signal GameObject is created per supported PLC tag. 5. Connect the signals to your Drives, Sensors and Behaviors and press Play. ## Key Properties [Section titled “Key Properties”](#key-properties) **Instance Name** (string) The name of the PLCSIM Advanced instance the interface attaches to. **Siemens API DLL** (string) Path to the Siemens runtime API DLL (x64). It is filled automatically from the PLCSIM Advanced installation. Before loading, the plugin checks that the file is a 64-bit DLL with the expected Siemens entry points and a valid digital signature by Siemens AG. **Detected API Version** (string, read-only) The API version folder that matches the native plugin. **Import Hmi Tags Only** (boolean) Imports only tags marked as HMI-visible in TIA Portal. Keep this on for large programs to limit the number of signals. **Import Data Blocks** (boolean) Also imports tags from data blocks. Data blocks can contain very many tags, so enable this only when you need them. **Start Stop With Unity** (boolean) Sets the PLC instance to RUN when play mode starts and to STOP when it ends. **Pause With Unity** (boolean) Freezes the virtual time of the PLC while Unity is paused (Editor pause button or application pause). The PLC stays in RUN and continues exactly where it stopped when you resume. The interface stays connected during the pause. When the interface disconnects, the PLC returns to its normal operating mode and keeps running on its own. **Update Cycle Ms** (integer) The communication cycle in milliseconds (default 10). **Setup Status**, **PLC Status**, **Disabled Signals**, **Tag Errors**, **Resync Count** (read-only) Show the plugin and Siemens API status, the connection and PLC operating state, signals whose binding was disabled after a TIA change, tags that currently report an error, and how often the interface re-synchronized after a PLC change. **Test Connection** (button) Attaches to the instance once in Edit Mode, reports the operating state and detaches again. ## Signals [Section titled “Signals”](#signals) Tags are addressed **by name**, never by absolute address, so recompiling the TIA project does not break the connection. The direction is decided by the memory area of the tag: | PLC tag | realvirtual signal | Direction | | ---------------------------------- | --------------------------------------------------- | ----------- | | Input (I) | `PLCInputBool` / `PLCInputInt` / `PLCInputFloat` | Scene → PLC | | Output (Q), marker (M), data block | `PLCOutputBool` / `PLCOutputInt` / `PLCOutputFloat` | PLC → scene | Supported data types are Bool, Byte, Word, Int, DWord, DInt and Real. Tags of other types are skipped with a warning. Values that do not fit the tag type (for example 70000 for an Int) are not written and produce one warning instead of a wrapped value. ## Downloads from TIA Portal [Section titled “Downloads from TIA Portal”](#downloads-from-tia-portal) When you download a changed program while the simulation runs, the interface re-synchronizes automatically without reconnecting: * **New tags** get new signals. * **Unchanged tags** keep running, and all inputs are written once completely so the PLC has the current scene values after the download. * **Tags that changed type or direction** are *disabled*: the signal keeps its component and its last value, is listed under **Disabled Signals** and produces a warning. Components that reference the signal stay valid. Run **Import Signals** in Edit Mode to update such signals. * **Removed tags** are disabled the same way and marked as *tag missing*. In Edit Mode, **Import Signals** replaces a signal whose type or direction changed. If other components reference that signal, the import lists these references and asks before replacing it, because the references become invalid. If a single tag reports an error, only that signal is marked under **Tag Errors** and a warning is logged; all other signals keep running. ## Common Use Cases [Section titled “Common Use Cases”](#common-use-cases) * **Virtual commissioning without the coupler** – Connect S7-1500 programs in PLCSIM Advanced where the external coupler process is blocked by virus scanner or firewall policies. * **Pause and step through a scenario** – Pause Unity to freeze the PLC time together with the scene and resume without a RUN/STOP change. * **Iterative TIA development** – Download program changes while the simulation runs; new tags appear automatically. ## Which interface? [Section titled “Which interface?”](#which-interface) | | [PLCSIM Advanced](/doc/unity/components-and-scripts/interfaces/plcsim-advanced/) (coupler) | PLCSIM Advanced Native (preview) | [realvirtual CONNECT](https://realvirtual.io/doc/web/connect/interfaces/protocols/) | | --------------- | ------------------------------------------------------------------------------------------ | ----------------------------------------- | ----------------------------------------------------------------------------------- | | Runs in | Unity, via the external coupler process | Unity process | CONNECT gateway | | Setup | Siemens DLL detection + coupler download | Siemens API detection only | CONNECT configuration | | Crash isolation | Siemens API isolated in the coupler | a crash in the Siemens library ends Unity | separate process | | Status | supported | preview | supported | Never connect the coupler interface and the native interface to the **same** PLCSIM Advanced instance at the same time. ## See Also [Section titled “See Also”](#see-also) * [PLCSIM Advanced (coupler interface)](/doc/unity/components-and-scripts/interfaces/plcsim-advanced/) * [Custom Interfaces (FastInterface)](/doc/unity/components-and-scripts/interfaces/custom-interfaces/) * [FMI / FMU](/doc/unity/components-and-scripts/interfaces/fmi/) # RFSuite (Pro) > Interface to robotics simulation made with RFSuite Caution Please note that this interface is only included in realvirtual.io Professional **RF::Suite Interface Overview** The RF::Suite interface facilitates seamless communication between Winmod and realvirtual.io, particularly beneficial for virtual commissioning tasks, notably in automotive production.For more information about RF::Suite please check: 🔗 [RFSuite website](https://www.eks-intec.de/rf.html) The interface relies on shared memory, necessitating both RF::Suite and realvirtual.io to operate on the same Windows computer. This ensures optimal compatibility and efficient data exchange. ## Interface properties [Section titled “Interface properties”](#interface-properties) **`SHMName`:** * Specifies the name of the Shared memory. This needs to be set to the same value as in the RF::Suite application **`ImportSymbolTable`:** * Specifies the symbol table utilized for signal importation. To select a table, click the “Select symbol table” button. After selecting the table, you can import it and create signals during runtime by clicking “Import symbol table”. **`RegExNotImportSymbolNames`:** * Specifies a list of regular expressions for excluding specific symbol names from signal importation. **`SHMSize`:** * Indicates the size of the shared memory utilized by the interface. **`Status`** * Reflects the status of the interface during simulation. **`NumInputs` and `NumOutputs`:** * Provide information on the number of input and output signals configured within the interface, respectively. ![](/doc/unity/assets/rfsuite-properties.png) RFSuite interface properties ## **Importing Signals** [Section titled “Importing Signals”](#importing-signals) Signals can be conveniently imported using a .txt file, exported directly from RF::Suite applications. It’s imperative to adhere to a specific table format, precisely matching the column headers as outlined in the example provided. For selecting and importing Signals you need to use the buttons “Select symbol table” and “Import symbol table” Here is an example for the signal import table: ```plaintext Line number Driver Signal Symbol Address Datatype Default Value Comment 1 XE 0.0 YE_ReserveBit_1 XE 0.0 bool VISU Input Reserve Bool 1 2 XE 0.1 YE_ReserveBit_2 XE 0.1 bool VISU Input Reserve Bool 2 3 XE 0.2 YE_ReserveBit_3 XE 0.2 bool VISU Input Reserve Bool 3 4 XE 0.3 YE_ReserveBit_4 XE 0.3 bool VISU Input Reserve Bool 4 5 XE 0.4 YE_ReserveBit_5 XE 0.4 bool VISU Input Reserve Bool 5 6 XE 0.5 YE_ReserveBit_6 XE 0.5 bool VISU Input Reserve Bool 6 ``` ## **Manually Setting Up Signals** [Section titled “Manually Setting Up Signals”](#manually-setting-up-signals) For manual signal configuration, it’s essential to define the signal’s position within the Shared Memory Area. This involves appending a memory position description to the signal name, following a standardized convention detailed below: ![](/doc/unity/assets/rfsuite-signalname.png) Defining the memory position for a signal * **For Outputs:** Use “XA” as the first two letters. * **For Inputs:** Utilize “XE” as the initial two letters. * Signal Data Types: * Boolean: Example format - “XE 13.6” * Int8: Example format - “XEB 27” * Int16: Example format - “XEW 160” * Int32: Example format - “XEDW 200” * Float: Example format - “XEDW573” # RoboDK (Pro) > Connecting the RobotDK robot simulation with realvirtual.io Caution Please note that this interface is only included in realvirtual.io Professional [RoboDK](https://robodk.com/) is a powerful and cost-effective simulator for industrial robots and robot programming. No programming skills are required with RoboDK’s intuitive interface. You can easily program any robot offline with just a few clicks and [RoboDK](https://robodk.com/) has an extensive library with over 500 robot arms. ![](/doc/unity/assets/robodk.png) With the RoboDK Interface, you can use [RoboDK](https://robodk.com/) to control the robots in your realvirtual.io models and you can connect the RobotIO’s to realvirtual.io behavior models. By modeling the full production line with realvirtual.io and by connecting the real PLCs you can simulate and commission big robot cells including all PLCs and HMIs. Here is a Youtube video showing the RoboDK interface in action:\ RoboDK can be tested for free. You can download RoboDK from this website:\ ### RoboDK Demo scene [Section titled “RoboDK Demo scene”](#robodk-demo-scene) realvirtual.io includes a Demo scene with a RoboDK interface. You can find the Demo scene under Assets/game4automation/Scenes/DemoRoboDK or you can find the demo in the realvirtual.io menu under additional demos. ![](/doc/unity/assets/rvDemoRoboDK.png) If RoboDK is installed on your computer RoboDK will be started automatically as soon as the Demo scene is started. The RoboDK file is loaded into RoboDK automatically. ### Using the RoboDK Interface [Section titled “Using the RoboDK Interface”](#using-the-robodk-interface) #### Setup [Section titled “Setup”](#setup) To use RoboDK to control your robots in realvirtual.io you always need to configure in RoboDK the same robot as in realvirtual.io. The kinematic of the realvirtual.io robot needs to be prepared as usual. Each robot axis needs to have a [Drive](/doc/unity/components-and-scripts/motion/drive/) connected to the Geometry and the kinematic hierarchy needs to be prepared. Please check the example in the demo scene or our Youtube tutorial about defining robot kinematics: The RoboDK interface must be positioned in a parent Gameobject of the Robot. For connecting the RoboDK interface with the robot kinematic the 6 Robot Axis needs to be assigned to the RoboDK interface, starting with the first base axis. In Unity editor mode all robot axis must be positioned in the zero position of the robot controller and RoboDK. ![](/doc/unity/assets/robodk-interfaces.png) The RoboDK application needs to be referenced by RoboDK Application as well as the RoboDK file. You can create a new RoboDK file by manually starting RoboDK or by pushing *Open RoboDK file* in the RoboDK interface. #### RobotIOs [Section titled “RobotIOs”](#robotios) Inside RoboDK Input and Output signals can be defined. These signals can be used to wait for example for a start signal, to open the gripper of the robot or for sending other information about the robot status. Inside RoboDK these signals can be defined under Options>Station. In your realvirtual.io scene, you can import these signals by pushing the Button *Import Robot IOs*. For all signals inside RoboDK the realvirtual.io signals are created and you can use these signals in your PLC or Behavior scripts. This is how it is also possible to connect RoboDK with the PLCs inputs and outputs of realvirtual.io. ### Targets [Section titled “Targets”](#targets) By pushing on *Get Targets* you can get all RoboDK targets and show them inside unity. The Target Prefab must be connected to the RoboDK interface. Currently, the Targets must be defined inside RoboDK, for example by teaching the RoboDK during Unity simulation mode. In future releases, we plan also send back to RoboDK the target positions if they are changed inside Unity. © 2025 realvirtual GmbH [https://realvirtual.io](https://realvirtual.io/) - All rights reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or by any means, including printing, saving, photocopying, recording, or other electronic or mechanical methods, without the prior written permission of the publisher. # S7 TCP ### Introduction[](#introduction) [Section titled “Introduction ”](#introduction) The S7 TCP-IP interface is providing a direct connection to Siemens Hardware Controllers including the S7-300,400,1200,1500 as well as Simotion and Sinumerik controllers. The S7 Interface is running in a separate thread to achieve maximum performance. The S7 TCP-IP interface is based on Snap7 from Davide Nardella, for more information see . Thanks to Davide for providing us Snap7 under special license conditions. Note Please make sure that there is no collision between real hardware configured PLC inputs on your PLC and inputs for your virtual commissioning setup. You can’t write with realvirtual.io to a physical configured inputs on your PLC. You need to change your hardware configuration to prevent this. Here is a short Youtube Tutorial showing you the interface in action: [Video](https://www.youtube-nocookie.com/embed/X3kQcYQnulM) ### Configuring the PLC[](#configuring-the-plc) [Section titled “Configuring the PLC ”](#configuring-the-plc) For allowing the access of the PLC, you will need to set the TIA portal property, under the CPU project, in the left pane under *Properties* the item *Protection* to *Full access*. You also need to *check permit access with PUT/GET …* ![](/doc/unity/assets/s7tcpip-plcconfig.png) ### Interface configuration[](#interface-configuration) [Section titled “Interface configuration ”](#interface-configuration) The S7 interface is added to the Scene by selecting *Tools > realvirtual > Add Object > Interface > S7* or by adding the script *S7interface* to an empty GameObject. You will get an inspector window like this: ![](/doc/unity/assets/s7tcpip-inspector.png) For the PLC you need to configure the IP-Adress under *Adress* and the *Rack* and *Slot* number.\ For importing symbols, a path to a symbol table (.sdf-format) needs to be added. By pushing the *Check Connection* button you can check if the PLC is reachable. If everything is OK you will get an *OK* in the *Connection Status* as well as a *Running* in the *PLC Status* ### Importing Signals [Section titled “Importing Signals”](#importing-signals) With *Import symbol table* all symbols that are in the table are imported and GameObjects with the any realvirtual.io signal objects (PLCInput…, PLCOutput…) are created. ![](/doc/unity/assets/s7tcpip-signal.png) The name of the GameObject will be the Symbol name. The name of the Signal Script (PLCInput.. and PLCOutput..) will be the absolute plc address. This address is the basic id for the interface signal. It is also possible to manually add signals and to configure the address (in the *Name* property of the Signal script) yourself. After the interface configuration is done and after you have checked if the PLC is reachable, you can start the simulation. You will see, that all signals are updated automatically. ### Adding Signals manually [Section titled “Adding Signals manually”](#adding-signals-manually) It is possible to add signals manually. In this case you must make sure that the Signal adress is proided in the Signal as name and that the Data type (see table below) of the signal is provided as property in Origin Data Type: ![](/doc/unity/assets/s7tcpip-manualsignal.png) These data types are supported: | Datatype | Description | | -------- | ------------------------ | | BOOL | Boolean, one Bit | | BYTE | Byte, 8 Bit | | WORD | Word, 16 Bit | | DWORD | Double Word with 32 Bit | | SINT | Signed Int with 8 Bit | | INT | Signed Int with 16 Bit | | DINT | Signed Int with 32 Bit | | USINT | Unsigned Int with 8 Bit | | UINT | Unsigned Int with 16 Bit | | UDINT | Unsigned Int with 32 Bit | | REAL | Real with 32 Bit | Please check the [Realvirtual.io Class Reference](https://game4automation.com/documentation/current/apidoc/html/classgame4automation_1_1_s7_interface.html) for more information about the properties and methods of this component. ### Reading and Writing DBs [Section titled “Reading and Writing DBs”](#reading-and-writing-dbs) It is also possible to read and write Data Blocks (DBs) on a PLC. DB variables are not part of the signal table and you need to configure the access to the DB values manually based on their physical address in the PLC. To be able to access the DB values *Optimized Block Access* needs to be turned off in the DB properties: ![](/doc/unity/assets/s7tcp-dbaccess.png) Here is an example how to access a Byte inside the DB. The Name of the PLCOutput or Input needs to be the absolute adress of the DB value: ![](/doc/unity/assets/s7tcp-dbbyte.png) This is an example how to access a Real inside the DB: ![](/doc/unity/assets/s7tcp-dbreal.png) ### Improving Performance with Area Read Write Mode[](#improving-performance-with-area-read-write-mode) [Section titled “Improving Performance with Area Read Write Mode ”](#improving-performance-with-area-read-write-mode) Area Read Write Mode can improve performance if you want to transmit a lot of signals in a contiguous memory area of the PLC. You can do this by turning on the Area Read Write Mode Option. For M and DB areas you need to define Min and Max Memory positions for the input and outputs because based on the area it could be both. It is very important, that inputs and outputs are in two totally separated blocks in the memory area. For DBs there is a limit of one DB acting as an input and another DB acting as an output. ![](/doc/unity/assets/s7-areareadwrite.png) © 2025 realvirtual GmbH [https://realvirtual.io](https://realvirtual.io/) - All rights reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or by any means, including printing, saving, photocopying, recording, or other electronic or mechanical methods, without the prior written permission of the publisher. # SEW SimInterface (Pro) > Interface to SEW Controllers Caution Please note that this interface is only included in realvirtual.io Professional The `SEWSimInterface` is used to communicate with [SEW MOVI-C Controller](https://www.sew-eurodrive.de/movi-c-controller/). As a basis communication protocol MQTT is used. ### Overview [Section titled “Overview”](#overview) The **SEW SimInterface** component is responsible for managing communication between realvirtual.io and an external SEW controller via MQTT. It connects to a broker and receives signals (e.g. Drive Positions, Inputs and Outputs) from the SEW Controller. ![](/doc/unity/assets/sewmqttinterface.png) SEW Sim Interface properties ### SEW SimInterface properties [Section titled “SEW SimInterface properties”](#sew-siminterface-properties) #### General Settings [Section titled “General Settings”](#general-settings) * **Active**: Controls when the SEW interface is active. * **Broker**: The IP address or hostname of the MQTT broker. Example: `127.0.0.1` * **Port**: The MQTT broker’s port number. This is typically `1883` for standard non-secure MQTT communication. Example: `1883` * **Use W String**: A checkbox indicating whether to use a “W” string format when parsing incoming data. This option should be usually turned on. * **Receive Topic PLC Outputs**: The MQTT topic that the SEW SimInterface will subscribe to in order to receive data from the SEW controller (PLC outputs). Example: `SEW/SimOUT` * **Send Topic PLC Inputs**: The MQTT topic that the SEW SimInterface will publish to, sending data to the SEW controller (PLC inputs). Example: `SEW/SimIN` * **Debug Mode**: A checkbox enabling detailed logging for debugging purposes. This is useful for development and troubleshooting MQTT connections and data exchange. * **Symbol Table**: The path to the symbol table file that maps SEW controller variables to Unity-readable variables. This is essential for interpreting the data coming from the SEW system and mapping it to corresponding actions or values in Unity. Example: `E:/realvirtual-release/game4automation/realvirtual/Assets/realvirtual/` * **Split Char**: Defines the character used to split incoming data fields. This is usually set based on the data format from the SEW system. Example: `;` (semicolon) #### Inputs/Outputs [Section titled “Inputs/Outputs”](#inputsoutputs) * **Num Inputs**: Displays the number of inputs being managed by the SEW SimInterface, corresponding to the number of PLC inputs from the SEW controller. * **Num Outputs**: Displays the number of outputs being managed by the SEW SimInterface, corresponding to the number of PLC outputs to the SEW controller. #### Thread Status [Section titled “Thread Status”](#thread-status) * **Thread Status**: The status of the communication thread managing data exchange. This will indicate whether the connection to the SEW system is active, and whether data exchange is functioning correctly. ### Symbol Table [Section titled “Symbol Table ”](#symbol-table) The symbol table used in the **SEW SimInterface** component is a CSV file that defines the mapping between signals from the SEW controller and **realvirtual** Inputs and Outputs. Each row in the table corresponds to a signal, specifying its name, data type, and direction (whether the signal is an input to or output from Unity). Note **The CSV can be generated automatically via the SEW MKC SimInterface in the IEC-Editor** #### Importing a Symbol Table [Section titled “Importing a Symbol Table”](#importing-a-symbol-table) To import a symbol table: 1. Select the symbol table file using the **“Select Symbol Table”** button. 2. After selecting, click on **“Import Symbol Table”** to load and apply the mappings. #### Format [Section titled “Format”](#format) The CSV file has the following columns: * **Name**: The name of the signal in the SEW system, which is used in Unity to identify the signal. * **Type**: The data type of the signal, which can be one of the following: * **REAL**: For real or float values (used for PLC inputs and outputs). * **BOOL**: For boolean signals (true/false). * **INT**: For integer signals. * **TEXT**, **STRING**, **WSTRING**: For text signals. * **Direction**: Specifies whether the signal is an input to Unity or an output from Unity. * **PLC\_IN**: Input signal (data received from the SEW system). * **PLC\_OUT**: Output signal (data sent to the SEW system). #### Example Symbol Table [Section titled “Example Symbol Table”](#example-symbol-table) Below is an example of a symbol table that could be used in the **SEW SimInterface**: ```plaintext Name;Type;Direction Stacker_Crane_x_Achse_SimlrActualVelocity;REAL;PLC_OUT Stacker_Crane_x_Achse_SimlrActualPosition;REAL;PLC_OUT Stacker_Crane_y_Achse_SimlrActualVelocity;REAL;PLC_OUT Stacker_Crane_y_Achse_SimlrActualPosition;REAL;PLC_OUT z_Achse_SimlrActualVelocity;REAL;PLC_OUT StackerCrane_ExecuteOrder;BOOL;PLC_OUT StackerCrane_Ready;BOOL;PLC_OUT StackerCrane_PickBox;BOOL;PLC_OUT z_Achse_SimlrActualPosition;REAL;PLC_OUT ``` ```csv ``` # Siemens Simit Interface (Pro) Caution Please note that this interface is only included in realvirtual Professional Note **New in Version 6.0.4:** This documentation includes new features and improvements coming in realvirtual 6.0.4, including one-click compiler define setup and enhanced SIMIT Unity Coupling V4.0.2 support. ## Overview [Section titled “Overview”](#overview) The Siemens Simit Unity Coupling Interface provides time-synchronized communication between realvirtual and Siemens SIMIT simulation platform. This interface enables precise coupling of Unity-based virtual commissioning with SIMIT plant models and PLC simulation environments including PLCSIMAdvanced. **Key Features:** * Time-synchronized communication with SIMIT * Automatic signal mapping between realvirtual and SIMIT * Support for Binary, Analog, and Integer signal types * One-click compiler define setup *(New in 6.0.4)* * Enhanced SignalType enum handling *(New in 6.0.4)* * Compatible with PLCSIMAdvanced integration * Real-time bidirectional data exchange ## When to Use This Interface [Section titled “When to Use This Interface”](#when-to-use-this-interface) Use the Siemens SIMIT Interface when you need: * **Precise timing synchronization** between Unity and SIMIT simulations * **Coupled simulation** where Unity waits for SIMIT calculation steps * **PLCSIMAdvanced integration** through SIMIT coupling * **Advanced co-simulation** scenarios requiring deterministic timing For standard applications without timing requirements, consider the [SIMIT Shared Memory Interface](/doc/unity/components-and-scripts/interfaces/simit-shared-memory/) as a lighter alternative. Additional information on the Siemens Simit Interface can be found at this page: 🔗 [Siemens Simit Coupling - Documentation](https://support.industry.siemens.com/cs/document/109769816/simit-%E2%80%93-unity-kopplung?dti=0\&lc=de-DE) ## Requirements [Section titled “Requirements”](#requirements) **Software Requirements:** * Unity 2022.3 LTS or later (Unity 6 recommended) * Siemens SIMIT V11.2 or later * SIMIT Unity Coupling Package V4.0.2 or later * realvirtual Professional license **Hardware Requirements:** * Windows 10/11 (64-bit) * Minimum 8GB RAM (16GB recommended) * DirectX 11 compatible graphics card ## Installation [Section titled “Installation”](#installation) ### Step 1: Obtain SIMIT Unity Coupling Package [Section titled “Step 1: Obtain SIMIT Unity Coupling Package”](#step-1-obtain-simit-unity-coupling-package) Download the SIMIT Unity Coupling package from Siemens: * Visit: * Download the latest SIMIT Unity Coupling package * Follow Siemens installation instructions in the manual ### Step 2: Install SIMIT Unity Package [Section titled “Step 2: Install SIMIT Unity Package”](#step-2-install-simit-unity-package) 1. Extract the SIMIT Unity package to a local directory 2. In Unity, open **Window → Package Manager** 3. Click **+ → Add package from disk** 4. Navigate to the extracted SIMIT package and select `package.json` 5. Wait for Unity to import the package ![](/doc/unity/assets/SiemensSimitRuntime.png) Siemens Simit Interface ### Step 3: Setup Compiler Define Symbol [Section titled “Step 3: Setup Compiler Define Symbol”](#step-3-setup-compiler-define-symbol) The interface requires the compiler define `REALVIRTUAL_SIEMENSSIMIT` to be set. realvirtual 6.0.4 provides an automated setup: 1. Add a **SiemensSimitInterface** component to a GameObject in your scene 2. In the Inspector, click **“Add REALVIRTUAL\_SIEMENSSIMIT Define”** button 3. Unity will automatically add the define and recompile scripts Tip **New in 6.0.4:** The one-click compiler define setup eliminates manual configuration errors and streamlines the SIMIT interface setup process. ![](/doc/unity/assets/siemens-simit-interface-setup.png) One-click compiler define setup Note The setup button automatically disappears once the define is properly configured, preventing accidental duplicate defines. **Alternative Manual Setup:** If needed, you can manually add the define in **Project Settings → Player → Scripting Define Symbols**: * Add: `REALVIRTUAL_SIEMENSSIMIT` ## Configuration [Section titled “Configuration”](#configuration) ### Adding the Interface to Your Scene [Section titled “Adding the Interface to Your Scene”](#adding-the-interface-to-your-scene) 1. **Create Interface GameObject:** * Add an empty GameObject to your scene * Add **SiemensSimitInterface** component * The **realvirtualCoupler** component is added automatically 2. **Add SIMIT Connection:** * Drag the **SimitConnection** prefab from the SIMIT Unity package into your scene * Reference it in the **Simit Connection** field of the SiemensSimitInterface ![](/doc/unity/assets/siemens-simit-interface-updated.png) Complete SIMIT interface setup in Unity ### Signal Configuration [Section titled “Signal Configuration”](#signal-configuration) **Step 1: Add realvirtual Signals** 1. Add all realvirtual signal components as children of the SiemensSimitInterface GameObject 2. Supported signal types: * **PLCInputBool/PLCOutputBool** → SIMIT Binary signals * **PLCInputFloat/PLCOutputFloat** → SIMIT Analog signals * **PLCInputInt/PLCOutputInt** → SIMIT Integer signals **Step 2: Update Signal Mapping** With **Auto Update Signals** enabled (the default), the signal mapping is exported automatically whenever you add, remove, rename or retype a child signal in edit mode. You no longer have to trigger it by hand - the interface re-exports the Simit signal list debounced on hierarchy changes and on scene save. To refresh the mapping manually (or when Auto Update Signals is turned off), click the **“Refresh Simit Signals”** button in the SiemensSimitInterface component. Either way the interface maps all child signals for SIMIT coupling and handles signal type conversion automatically. ![](/doc/unity/assets/siemens-simit-auto-update-signals.png) SiemensSimitInterface with Auto Update Signals and the Refresh Simit Signals button **Step 3: Import Signals in SIMIT** 1. In your SIMIT project, use **Unity Coupling → Update Signals** 2. All signals appear in SIMIT with the naming convention: ```plaintext [SimitInterfaceName].realvirtualCoupler.[SignalName] ``` ![](/doc/unity/assets/image%20\(3\)%20\(2\).png) Scene with SIMIT interface and signals ![](/doc/unity/assets/SimitEdit%20\(1\).png) Signals imported in SIMIT ## Properties [Section titled “Properties”](#properties) **Siemens Simit Interface (Script)** * **Active** (Always/Never) - Interface activation mode * **Simit Connection** (GameObject) - Reference to SimitConnection prefab * **Allow Time Sync** (boolean) - Let SIMIT drive Unity’s FixedUpdate rate and the signal update cycle * **Auto Update Signals** (boolean) - Automatically re-export the Simit signal list in edit mode when child signals are added, removed, renamed or change type, so you do not have to click “Refresh Simit Signals” manually * **Debug Mode** (boolean) - Enable debug logging **Realvirtual Coupler (Script)** * **Signals** (Signal\[]) - Auto-populated array of mapped signals (read-only) ## Troubleshooting [Section titled “Troubleshooting”](#troubleshooting) **Common Issues:** 1. **“SIMIT types not found” compilation errors** * Ensure SIMIT Unity package is properly installed * Verify `REALVIRTUAL_SIEMENSSIMIT` define is set * Use the automated setup button in the interface 2. **No signals appear in SIMIT** * Check that signals are children of SiemensSimitInterface * Make sure **Auto Update Signals** is enabled, or click the **“Refresh Simit Signals”** button * Verify SimitConnection is referenced and active 3. **Interface not connecting** * Ensure SimitConnection prefab is in the scene * Check SIMIT Unity Coupling settings in SIMIT * Verify network connectivity if using remote SIMIT Caution Always ensure the SIMIT Unity Coupling package is properly installed before using this interface. Missing SIMIT components will cause compilation errors. # Signal Force Set (Pro) > Force boundary signals to defined values for virtual commissioning and test scenarios Note This feature was added in realvirtual **6.3.4** (Professional). ## Overview [Section titled “Overview”](#overview) `SignalForceSet` lets you hold one or more PLC signals at fixed values during simulation — independent of what the PLC or simulation logic writes. This is the realvirtual equivalent of the force table in Siemens TIA Portal or Beckhoff TwinCAT: a forced signal always wins against any other writer. The typical use case is virtual commissioning (VIB), where certain boundary signals have no real source in the simulation but must carry a defined value so the PLC program can run: voltage-present flags, emergency-stop release, system pressure, operating mode — all need to be “forced” to their nominal values before the first cycle can execute. You can define as many force sets as you need — one per scenario. Multiple sets can be active at the same time. ![](/doc/unity/assets/signal-force-set-overview.jpg) The Signal Force Monitor and a force set in the DemoSignalForce sample scene > **💡 Hint**\ > A dedicated **Signal Force Monitor** window shows all active force sets and every currently forced signal in the scene. Open it from **realvirtual DEV > Testing > Signal Force Monitor** or via the **Open Force Monitor** button on any `SignalForceSet`. ## Properties [Section titled “Properties”](#properties) ![](/doc/unity/assets/signal-force-set-inspector.png) A force set holding the virtual-commissioning base-state boundary signals ### General [Section titled “General”](#general) **Set Name** — Display name for this scenario (e.g., `VC_BaseState`, `TEST_EmergencyStop`). Shown in the Signal Force Monitor for quick identification. ### Entries [Section titled “Entries”](#entries) **Entries** — List of signals with their forced values. Each entry contains: | Field | Description | | ----------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | | **Signal** | Reference to the PLC signal to force (PLCInputBool, PLCOutputBool, PLCInputFloat, etc.) | | **Enabled** | Whether this entry is applied when the set is active. Uncheck to temporarily exclude a signal without removing it from the list | | **Bool / Float / Int / Text Value** | Target value to force. The visible field matches the signal type | | **Comment** | Free-text note for documentation (e.g., `"Voltage present"`, `"Automatic mode"`) | ### Behavior [Section titled “Behavior”](#behavior) **Apply On Start Sim** — Automatically apply this force set when the simulation starts. Enable this for the VIB base state so the PLC always starts with correct boundary conditions. **Release On Stop Sim** — Automatically release all forces when the simulation stops. Enabled by default as a safety measure to prevent forces from persisting unnoticed. ### Timed Active [Section titled “Timed Active”](#timed-active) **Timed Active** — Activate the set only within a time window after simulation start, then release automatically. Useful for startup pulses and reset sequences. **Active From Seconds** — Start time in simulation seconds after which the set becomes active. **Active To Seconds** — End time in simulation seconds after which the set is automatically released. ### Status [Section titled “Status”](#status) **Is Active** *(read-only)* — Shows whether this force set is currently applied. Visible in the Inspector at runtime for quick status checks. ### HMI [Section titled “HMI”](#hmi) Note HMI buttons for force sets were added in realvirtual **6.3.6** (Professional) **Apply Button** — Optional HMI pushbutton that applies this force set when pressed. Together with **Toggle With Apply Button** the same button acts as a switch: press once to force the set, press again to release it. While the set is active the button shows the **Button Active Color**. **Release Button** — Optional HMI pushbutton that only releases the force set. **Toggle With Apply Button** — If enabled, the Apply Button toggles between apply and release. If disabled, it only applies and a Release Button is needed to release. **Button Active Color** — Color of the Apply Button while the force set is active. The button returns to its own color when the set is released. Set **Use Skin Colors** to false on the pushbutton if it should keep its individual colors independent of the UI skin. ### Inspector Buttons [Section titled “Inspector Buttons”](#inspector-buttons) | Button | Action | | -------------------------- | --------------------------------------------------------------------------------------------- | | **Apply** | Force all enabled entries immediately | | **Release** | Release all forces from this set immediately | | **Capture Current Values** | Read the current live values of all listed signals and store them as the forced target values | | **Open Force Monitor** | Open the Signal Force Monitor editor window | ## Signal Force Monitor [Section titled “Signal Force Monitor”](#signal-force-monitor) The Signal Force Monitor is a persistent editor window that gives you a scene-wide overview of all active forces. Open it from **realvirtual DEV > Testing > Signal Force Monitor** or via the **Open Force Monitor** button on any `SignalForceSet`. ![](/doc/unity/assets/signal-force-monitor.png) The Signal Force Monitor — force sets on top, all currently forced signals below The window shows: * **All force sets** in the scene with their current active state and per-set **Apply** / **Release** buttons * **Watch all forces** — a live list of every currently forced signal, including signal type, current value, forced value, and the source set * **Release All** button to remove all active forces in one click * A **persistent warning banner** while any force is active, so no forced signal goes unnoticed ## Quick Start [Section titled “Quick Start”](#quick-start) 1. Add a `SignalForceSet` component to any GameObject (`realvirtual > Professional > Signal Force Set`) 2. Set a descriptive **Set Name** (e.g., `VC_BaseState`) 3. Click the **+** icon in the **Entries** list and drag the signal you want to force into the **Signal** field 4. Set the desired **Value** for each entry and add a **Comment** for clarity 5. Enable **Apply On Start Sim** so the base state is always applied at simulation start 6. Press **Apply** in the Inspector or start the simulation to activate the forces 7. Open the **Signal Force Monitor** to confirm which signals are currently forced ## Common Use Cases [Section titled “Common Use Cases”](#common-use-cases) * **VIB base state** — Force boundary signals (voltage-present, e-stop released, system pressure, operating mode) so the PLC program can execute its first scan without waiting for missing feedback * **Test scenario: emergency stop triggered** — Create a dedicated set with the e-stop signal forced to `false` to verify the PLC reacts correctly; switch between sets to compare behavior * **Test scenario: pressure too low** — Force a pressure signal below its threshold to test protective shutdown logic without modifying physical hardware * **Startup pulse** — Use **Timed Active** with a 0–2 second window to emit a reset pulse on program start, then release automatically once the PLC has initialized * **Demo scenes** — Keep a force set with **Apply On Start Sim** enabled so demo environments always start in a defined, runnable state ## MCP Tools [Section titled “MCP Tools”](#mcp-tools) For automation and AI-agent control, realvirtual provides MCP tools to force and release signals programmatically: * `signal_force_bool`, `signal_force_float`, `signal_force_int` — Force individual signals by name * `signal_unforce` — Release the force on a single signal * `signal_force_list` — List all currently forced signals * `force_set_apply`, `force_set_release` — Apply or release a named force set * `force_set_list` — List all force sets in the scene with their active state ## See Also [Section titled “See Also”](#see-also) * [Interfaces Overview](/doc/unity/components-and-scripts/interfaces/) — All available interfaces and signal tools * [Signal Test Generator](/doc/unity/components-and-scripts/interfaces/signal-test-generator/) — Generate cyclic test values for interface testing without a PLC * [Signal Manager](/doc/unity/components-and-scripts/interfaces/signal-manager/) — Automatically connect and manage large numbers of signals * [Signal Importer / Exporter](/doc/unity/components-and-scripts/interfaces/signal-importer-exporter/) — Import and export signal configurations # Signal Importer / Exporter # Signal Manager > for automatically connecting signals with the model Caution This is a function for professional users who want to manage big simulations with a big number of signals. The Signal Manager is used to automatically link imported signals to specific PLC Signals within your realvirtual.io project. Additionally, Signals that are not linked can be deleted or deactivated. Depending on your rules for automatic connection, an appropriate script must be added. The Signal Manager also offers the possibility to automatically create signals in your realvirtual.io project if no suitable signals are found in the already existing and previously imported signals. Note If you have thousands of unused and unconnected Signals in your project after importing the signals, you can significantly improve the startup time of your simulation if you disable or delete unconnected Signals. ![](/doc/unity/assets/signalmanager.png) ### How to use the signal manager[](#how-to-use-the-signal-manager) [Section titled “How to use the signal manager ”](#how-to-use-the-signal-manager) To use the Signal Manager, it must be added as a component to the game object that contains the imported signals as subcomponents (and usually the interface itself). To get an overview of the number of connected and unconnected signals, you can select “Check Signals”. This will update the information displayed in the Signal Manager. ### Component elements [Section titled “Component elements”](#component-elements) **AutoConnectLevels**\ In the “AutoConnectLevels” list you specify for which game objects (and child objects) the signal connection should be performed. This way you avoid checking and connecting parts of the simulation model where you don’t want to perform an automatic signal creation or connection. **Check signals**.\ Updates the signal information. **Disable unconnected signals**\ Disables all unconnected Signals. **Enable Unconnected Signals**\ Enables all unconnected Signals. **Delete Unconnected Signals**\ Deletes all unconnected Signals. **Delete automatically created signals**.\ Deletes all automatically created Signals, connected or disconnected. **Start and connect signal creation**\ Starts the automatic connection of Signals. Signals that are not found are created automatically. To use automatic signal connection and creation, you need to define your own custom user scripts that implement your connection and naming rule (see below). ### User scripts [Section titled “User scripts”](#user-scripts) The signal manager uses the custom script to assign the Signals. This script must be of type “AutoConnectBase”. Within the script you define how the matching should be done. One possibility is to use the definition of kinematic groups to assign the signals to a drive or a gripper, for example. The use of EditorUtility.SetDirty is necessary to update the editor. Below you will find a corresponding code example: ```csharp namespace realvirtual.io { public partial class AutoConnectExample : AutoConnectBase { public override bool AutoConnect(BehaviorInterface component) { var connected = false; var signalname = ""; Debug.Log($" Checking AutoConnect for " +component.name); /// Here you can define your connection rules, create signals and assign them to the behavior models Kinematic kin = component.GetComponent(); if (component.GetType() == typeof(Gripper)) { signalname = kin.GroupName + "_Oeffnen"; // define Signal name based on custom rule var signal = GetOrCreateSignal(signalname); // create the signal if not already there ((Gripper)component).OpenGripper = signal; // connect the signal to the behavior model EditorUtility.SetDirty(component); connected = true; signalname= kin.GroupName + "_Schliessen"; // define Signal name based on custom rule signal = GetOrCreateSignal(signalname); // create the signal if not already there ((Gripper)component).CloseGripper = signal; // connect the signal to the behavior model EditorUtility.SetDirty(component); connected = true; } if (component.GetType() == typeof(Drive_FollowPosition)) { signalname = kin.GroupName + "_Position"; var drivesignal = GetOrCreateSignal(signalname); ((Drive_FollowPosition)component).Position = drivesignal; // connect the signal to the behavior model EditorUtility.SetDirty(component); connected = true; } return connected; } } } ``` After import and matching you can check the matching it by using “Check for unconnected Signals”. According to that it is possible to delete automatically created or unconnected signals. © 2025 realvirtual GmbH [https://realvirtual.io](https://realvirtual.io/) - All rights reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or by any means, including printing, saving, photocopying, recording, or other electronic or mechanical methods, without the prior written permission of the publisher. # Signal Test Generator > Generate test signal values for interface testing without a PLC Note This feature was added in realvirtual **6.3**. ## Overview [Section titled “Overview”](#overview) The Signal Test Generator automatically generates cyclic test values for all PLCInput signals on its parent interface. It discovers Bool, Float, and Int input signals and applies test patterns: **sine waves** for floats, **on/off toggling** for bools, and **incrementing counters** for ints. Attach it to any interface GameObject to simulate signal activity without a real PLC connection. This is useful for testing interface communication, verifying signal routing, and demonstrating data exchange in demo scenes. ## Setup [Section titled “Setup”](#setup) 1. Select the interface GameObject that contains your PLC signals as children 2. Add the **Signal Test Generator** component (`Tools > realvirtual > Interfaces > Signal Test Generator`) 3. Press Play — all PLCInput signals will start generating test values automatically The component discovers signals at startup. If you add or remove signals at runtime, click **Refresh Signals** to re-scan. ## Properties [Section titled “Properties”](#properties) ### Test Settings [Section titled “Test Settings”](#test-settings) | Property | Description | | ------------------- | --------------------------------------------------- | | **Enable Testing** | Enable or disable test signal generation | | **Update Interval** | Time in seconds between signal value updates | | **Sine Amplitude** | Amplitude of the sine wave for float signals | | **Sine Offset** | Center offset of the sine wave for float signals | | **Sine Frequency** | Frequency of the sine wave in Hz | | **Toggle Interval** | Time in seconds between bool signal toggles | | **Int Increment** | Increment value per update cycle for int signals | | **Int Max** | Maximum value before the int counter resets to zero | ### Status [Section titled “Status”](#status) | Property | Description | | --------------- | ---------------------------------------------------- | | **Cycle Count** | Number of update cycles completed since play started | ## Test Patterns [Section titled “Test Patterns”](#test-patterns) ### Float Signals (Sine Wave) [Section titled “Float Signals (Sine Wave)”](#float-signals-sine-wave) Each PLCInputFloat signal follows a sine wave: `Offset + Amplitude * sin(2pi * Frequency * time + phase)`. Multiple float signals get different phase offsets so they don’t move in sync. ### Bool Signals (Toggle) [Section titled “Bool Signals (Toggle)”](#bool-signals-toggle) PLCInputBool signals toggle between `true` and `false` at the configured toggle interval. Even-indexed and odd-indexed signals toggle on opposite phases for visual variety. ### Int Signals (Counter) [Section titled “Int Signals (Counter)”](#int-signals-counter) PLCInputInt signals increment by the configured step each update cycle and wrap around at the maximum value. Multiple int signals get different offsets. ## Common Use Cases [Section titled “Common Use Cases”](#common-use-cases) * **Interface demo scenes** — Show live signal exchange without requiring a PLC * **WebSocket testing** — Verify server/client signal transmission with changing values * **UI development** — Generate varying signals for testing HMI displays and dashboards * **Integration testing** — Simulate signal activity for automated test scenarios ## See Also [Section titled “See Also”](#see-also) * [Interfaces Overview](/doc/unity/components-and-scripts/interfaces/) — All available interfaces * [WebSocket Realtime Interface (Pro)](/doc/unity/components-and-scripts/interfaces/websocket-pro/) — WebSocket-based signal exchange * [Custom Interfaces](/doc/unity/components-and-scripts/interfaces/custom-interfaces/) — Building your own interfaces # Simit Shared Memory (Pro) > Connecting Siemens Simit with realvirtual.io Note From Version 6.2 on this interface is only included in realvirtual.io Professional ### Introduction [Section titled “Introduction”](#introduction) Shared memory is also called mapped memory files. It is a Microsoft standard for fast inter process communication on one computer. See this link\ Note Because the access to the shared memory interface is very fast, this interface does not need to use multi threading like most other interfaces. Generally everything can be written into a shared memory file. This means, that a standard format for the memory is needed, if two processes want to communicate data over shared memory. The realvirtual.io Shared Memory Interface is based on the Simit shared memory standard. Simit is a tool for virtual commissioning, specifically for the modeling of sensor- and actuator behavior models. It has very poor 3D capabilities, this is why a connection to realvirtual.io is a good complimentary fit. Please check here for more information about Simit:\ The realvirtual.io Simit interface can be used to connect Simit to realvirtual.io but it can be also used for connecting other processes to realvirtual.io. If you want to learn more about the Simit Shared Memory Interface data structure you should check the Simit documentation: Here is a short Youtube Tutorial showing you the interface in action: [Video](https://www.youtube-nocookie.com/embed/-0kKDvMZQv8) ### Interface configuration[](#interface-configuration) [Section titled “Interface configuration ”](#interface-configuration) For using the Shared Memory Interface you need to add an interface to your scene by selecting *Tools > realvirtual > Add Object > Interface > Shared Memory* or you add the Script SharedMemoryInterface to an empty Gameobject. Next you need to configure the Shared Memory Interface . The SHM Interface needs to get a name (in the Example “Simit” which is exactly the same as in Simit (see the picture): ![](/doc/unity/assets/sharedmemory-ui.png) Simit should be configured like this: ![](/doc/unity/assets/sharedmemory-simit.png) Note **Please make sure, that the Shared Memory Name is identical to your setting in Unity.**\ **Please also make sure that “Signaldescription in header” is set to true.** You can now push on *Import Signals* in the Shared Memory Interface inspector. You will get all Signals available in Simit created as Sub-Gameobjects under your Interface (in the example the signals Test2 and Test). Please keep in mind, that no signals are deleted automatically. Import signals is only adding and updating but not deleting any signals. If you now push *Play* in Unity you will see, that during simulation the signals are updated automatically. Please check the [Realvirtual.io Class Reference ](https://game4automation.com/documentation/current/apidoc/html/structgame4automation_1_1_s_h_m_signal.html)for more information about the properties and methods of this component.\ \ \ \ \ \ © 2025 realvirtual GmbH [https://realvirtual.io](https://realvirtual.io/) - All rights reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or by any means, including printing, saving, photocopying, recording, or other electronic or mechanical methods, without the prior written permission of the publisher. # Simulink > Connecting Mathworks Simulink with realvirtual.io Caution The Simulink Interface is only available in realvirtual.io Professional The Simulink interface allows the direct connection between Simulink from MathWorks () and realvirtual.io. It creates a direct memory communication between the two tools for fast communication. This video gives you a short overview:\ Note Please note, that this Interface is currently in Beta. For Simulink you need the realvirtual.io Interface block. It is for free available from MathWorks. You will need to send us an email to and we will forward your request to MathWorks. ![](/doc/unity/assets/simulink.png) ### Interface configuration[](#interface-configuration) [Section titled “Interface configuration ”](#interface-configuration) To use the interface you need first to implement a realvirtual.io Interface block into your Simulink modell. In this interface you must define all Inputs and Outputs that should be exchanged with realvirtual.io. ![](/doc/unity/assets/simulink-block.png) To add the Simulink interface into your realvirtual.io scene you need to select *Tools > realvirtual > Add Object > Interface > Simulink (Pro)* After this Simulink can be startet and the Signals can be imported by pushing on the Button *Import Signals*. You will now see all Simulink Signals as Singal Objects underneath your Simulink interface and you can connect them to your realvirtual.io objects. ![](/doc/unity/assets/simulink-interface.png) © 2025 realvirtual GmbH [https://realvirtual.io](https://realvirtual.io/) - All rights reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or by any means, including printing, saving, photocopying, recording, or other electronic or mechanical methods, without the prior written permission of the publisher. # TwinCAT > Connecting Beckhoff PLC with realvirtual.io Caution Please note, that this Interface is only available in realvirtual.io Professional ### Introduction[](#introduction) [Section titled “Introduction ”](#introduction) [TwinCAT](https://www.beckhoff.de/twincat/) is the programming framework for Beckhoff PLCs.\ The realvirtual.io TwinCAT interfaces uses ADS as communication framework to Beckhoff PLCs. The Bechoff PLCs can be virtual ones like the one delivered with the TwinCAT programming environment (which can be downloaded for free here ) or it could be a real PLC connected over the network with your PC. The TwinCAT programming environment is enabling, just for development purposes, for free 7 day trial licenses for the TwinCAT PLC runtime. The virtual PLC can also act as a OPCUA server and it can be also used with the OPCUA interface. But we recommend to use directly the TwinCAT Interface if you just want to communicate with Bechoff PLCs because this interface is faster and creates less overhead than the OPCUA interface. [Tutorial Beckhoff Interface](https://www.youtube-nocookie.com/embed/YR28CuQGEVs) Tutorial Beckhoff Interface ### Prerequisites for TwinCAT ADS Communication [Section titled “Prerequisites for TwinCAT ADS Communication”](#prerequisites-for-twincat-ads-communication) To establish TwinCAT ADS communication, you must have either a complete TwinCAT3 environment, which includes a virtual PLC, programming environment, and ADS router, installed on your PC, or you can opt to install just the TwinCAT ADS component (TC1000 TwinCAT 3 ADS). The necessary software is available for download from the official website. 🔗 [TwinCAT3 Downloads](https://www.beckhoff.com/de-de/produkte/automation/twincat/tc1xxx-twincat-3-base/tc1000.html) ### Interface configuration [Section titled “Interface configuration”](#interface-configuration) The TwinCAT interface is added to the Scene by selecting *Tools > realvirtual > Add Component > Interface > TwinCAT* or by adding the script *TwinCATADSinterface* to an empty GameObject. ![](/doc/unity/assets/rvTwinCatInterface.png) You will get an inspector window like this: ![](/doc/unity/assets/twincat-inspector.png) For accessing the virtual or the hardware Beckhoff PLC you need to configure the NetID-Adress under *Net Id* and the *Port* number. The standard settings of the interface are for a local installed TwinCAT3 development environment with a local virtual PLC. For TwinCAT2 the Port number must be changed. For more information about the configuration of NetIDs and Ports please refer to the [Bechoff documentation](https://infosys.beckhoff.com/english.php?content=../content/1033/tcadscommon/html/tcadscommon_identadsdevice.htm\&id=Beckhoff). ### Importing signals [Section titled “Importing signals”](#importing-signals) With *Import signals* all signals of the current TwinCAT project are imported. Note Please make sure that NetID and PortID are configured and that the TwinCAT configuration is activated. Otherwise an error will appear if you try to import the signals. The icon of TwinCAT in the Windows Taskbar should now be green. ![](/doc/unity/assets/twincat-activateconfiguration.png) After importing the signals you get all signals as Gameobjects in your scene: ![](/doc/unity/assets/twincat-importedsignals.png) #### RegEx for Signal import[](#regex-for-signal-import) [Section titled “RegEx for Signal import ”](#regex-for-signal-import) For limiting the number of signals you can define with RegEx (see ) special filters. In the simplest case a Regex is a part of a string which can be found in the Symbol name. ![](/doc/unity/assets/twincat-regax.png) **RegEx Import Signals**\ For limiting the number of imported signals another RegEx can be used. In *RegEx Import Signals* one ore multiple RegEx as part of the signal names can be defined. If the list is empty everything is imported. If the list has one or multiple RegEx are defined only signals which are matching one of the RegEx are imported. For example be defining this RegEx ![](/doc/unity/assets/twincat-regexio.png) only signals which are named IO…. are imported like *IO.TestInputBool,IO.TestOutputBool* and so on. **RegEx Skip Signals**\ If you give here one or multiple strings all signals which are matching one of the strings will not be imported. **RegEx Symbol is PLC Input**\ If the imported signals are defined in the TwinCAT project as an Input or Output, the corresponding realvirtual.io signal type will be attached to the Signal.\ For global TwinCAT variables, which are not assigned an input or output area, this is not possible, because it is not defined if the signal should be a PLC output or input. If it is not defined, the standard setting will import everything as input. You can change it manually by for example replacing the *PLCOutputBool* script against a *PLCInputBool* script.\ If you give here one or multiple strings all signals which are matching one of the strings will be imported as input. This is only necessary for global variables where it can’t be detected, if they are input our output. #### Sub-folders when importing signals [Section titled “Sub-folders when importing signals”](#sub-folders-when-importing-signals) TwinCAT is organizing variable in an object oriented approach. The signal symbol names are usually *\[object].\[name]*. You\ If the option *Create sub folders* is selected for each *\[object]* one additional hierarchy in the Signal hierarchy is created. ### Interface communication modes [Section titled “Interface communication modes”](#interface-communication-modes) The TwinCAT interface provides 3 different operation modes. Dependent on that mode, all signals are exchanged in a cyclic manner or signals are exchanged based on change events. You should select the mode which fits best your application and performance needs. **CyclicSumCommand**\ This is the standard option and is the best performing mode with a lot of fast changing signals. The TwinCAT interface is operating in this case in Multithreaded mode and the thread status is displayed in the inspector. In this mode all signals are exchanged with one ADS command for reading and one ADS command for writing in each Thread cycle. For example about 700 input and output signals can be exchanged in a cycle of about 30ms. With MinCommCycleMS define a minimal cycle time and if you communication is faster the parallel thread is waiting for the next cycle. The communication thread is running independently from the main Unity thread and the signal data exchange will not slow down your simulation. **Cyclic**\ The AdsNotification event is fired cyclically.\ The Notification will be registered on the ADS Server side for a cyclical trigger (dependent on time parameter) and is bound to the ‘default’ task of the addressed target. In case of the PLC target (e.g. Port 851) the default task is the first configured task.\ Each time the ‘default’ task has finished its cycle the real-time system will check for the expired cycle time and sends the AdsNotification message on expiry. Please be aware, that server side ‘Change’ notifications stress the real-time system and should be handled with care. **OnChange**\ The Notification will be registered on the ADS Server side for an on-change and optional cyclical trigger (dependent on parameters) and is bound to the ‘default’ task of the addressed target. In case of the PLC target (e.g. Port 851) the default task is the first configured task.\ Each time this task has finished its cycle the realtime system will check for the changed value and an optional expired cycle time and sends the Note Please note that Cyclic and OnChange can stress with a lot of fast changing signals the communication a lot and due to the many events the Unity and PLC performance can decrease dramatically. Please use this option only if the speed of signal changes and the number of changed signals is limited. © 2025 realvirtual GmbH [https://realvirtual.io](https://realvirtual.io/) - All rights reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or by any means, including printing, saving, photocopying, recording, or other electronic or mechanical methods, without the prior written permission of the publisher. # TwinCAT HMI > Connecting Bechoff PLC via Websocket with realvirtual.io Caution This interface is only available in **realvirtual.io Professional** and depends on the **BestWebsocketsBundle**, which must be purchased separately from the Unity Asset Store: [Best Websockets Bundle](https://assetstore.unity.com/packages/tools/network/best-websockets-bundle-268838). **Important:** Currently, the interface works only with **BestHTTP V2**, which is no longer available on the Asset Store. After purchasing, please contact us at **** or reach out to the BestHTTP developer to obtain BestHTTP V2. Additionally, in your project’s scripting define symbols, you need to add **`REALVIRTUAL_BESTHTTP`** (without the “3”) to use this version. This interface is beside TwinCAT ADS another interface for Beckhoff PLCs. It requires HMI licenses on the TwinCAT PLC. The advantage of this interface is that it does not depend on an installation on the device on which the simulation model is running. Communication takes place exclusively via WebSockets. This interface works on any type of target platform and also works within WebGL builds. In contrary TwinCAT ADS requires ADS installed on the machine and is by this limited to Windows System. The interface can be added to a realvirtual.io scene by selecting *Tools > realvirtual > Add Object > Interface > TwinCATHMI*. ![](/doc/unity/assets/twincathmi.png) TwinCAT HMI interface (based on Websockets) for realvirtual.io ## Prerequisites [Section titled “Prerequisites”](#prerequisites) * TE2000 license is needed for properties (HMI) configuration. * TE2000 Version 1.12.758.8 and above * You need on your PLC TF2000 licenses ![](/doc/unity/assets/twincathmi-tf2000%20\(1\).png) TF2000 license within TwinCAT * `REALVIRTUAL_BESTHTTP3` needs to be added to your Unity Project `Project Settings > Player > Script Compilation` * Newtonsoft.Json needs to be available and installed. In latest standard Unity releases Newtonsoft is already included. For enabling Newtonsoft please also add `REALVIRTUAL_JSON` to your Scripting Define Symbols `Project Settings > Player > Script Compilation`. For more infomation about how to install and get please check section[ Newtonsoft JSON](/doc/unity/advanced-topics/newtonsoft-json/) ![](/doc/unity/assets/image%20\(18\).png) BestHTTP and JSON in Scripting Define Symbols ## Annotations in the PLC code [Section titled “Annotations in the PLC code”](#annotations-in-the-plc-code) Within the TwinCAT PLC source all symbols needs to be annotated with *{ attribute ‘TcHmiSymbol.AddSymbol’ }*, if they should be available for the TwinCATHMI interface. ![](/doc/unity/assets/twincathmi-annotation.png) ## Interface Properties [Section titled “Interface Properties”](#interface-properties) ![](/doc/unity/assets/twincathmi-inspector.png) TwinCAT HMI inspector properties #### IsConnected (Readonly) [Section titled “IsConnected (Readonly)”](#isconnected-readonly) True, if the interface is successfully connected to the PLC. #### Server Adress [Section titled “Server Adress”](#server-adress) The adress of the Server (Notation must be ws\://IP:Port #### Status (Readonly) [Section titled “Status (Readonly)”](#status-readonly) The current Status of the Websocket, “Open” if connection is active. #### IsConnecting (Readonly) [Section titled “IsConnecting (Readonly)”](#isconnecting-readonly) True during reconnection to Server. #### DebugMode [Section titled “DebugMode”](#debugmode) If set to true additional messages are printed out to the Unity console #### Intervall Time [Section titled “Intervall Time”](#intervall-time) The Intervaltime in Milliseconds. All update messages are collected to one message inside the PLC within the intervall time. #### Subscribe Outputs [Section titled “Subscribe Outputs”](#subscribe-outputs) If set to true, the outputs are subscribed and only changed outputs are send within the intervall time. #### Poll Outputs [Section titled “Poll Outputs”](#poll-outputs) If set to true all outputs are send wthin the intervall time. #### Symbol Table [Section titled “Symbol Table”](#symbol-table) It is possible to import all symbold from an external CSV file. The table must look like this: **Security** If you want to use security features and login into the PLC with domain, user and password you need to set this to true and define the user and the password. **EventSignalRead** An Event which is fired when a Signal is read from the interface. ## Complex data types [Section titled “Complex data types”](#complex-data-types) ![](/doc/unity/assets/twincathmi-complexdata.png) Only primitive datatypes like floats, ints, bools are transformed automatically to the realvirtual.io PLCInput and PLCOutput Variables. **Reading primitives within complex data** For reading complex datatypes you can access the primitive data within the complex datatype by adressing them like this: **Reading complex data with C# scripts** For subscribing a complex datatype you should create a variable of Type PLCOutputText. Within this text you will get the complex data as a Json. You can now use within a C# script JSON deserialization to transfer this JSON to a C# data type. **Writing complex data with C# scripts** For writing complex data you can call the public Method *WriteSymbol* ```csharp public void WriteSymbol (string symbol, object signal) ``` This will serialize the given object into a JSON and send it to the PLC. It is important that the C# data structure is identical to the data structure within the PLC. **Writing complex data with write acknowledgement** Usually, when using *WriteSymbol* for direct writing symbols into the PLC, the function is non blocking. You don’t get any value back and you won’t be automatically informed if the symbol is not written. In very complex and big data structures writing can take some time. If you want to be sure that the data is written there is another write command: ```csharp public int WriteSymbolControlled (string symbol, object signal) ``` This function is giving back an *id* as an INT Before calling *WriteSymbolControlled* you should subscribe to this event, which will be called as soon as a reply is send from the PLC. ```csharp EventSignalRead.AddListener(OnSymbolWritten); ``` The code for your event should look somehow like this. You need now to check if the method was exactly called for your *WriteSymbolControlled* id (which was given back in the call) and if there was no error (*error == false*). You can also look in detail into the reply which is given you as a full JSON string in *reply*. ```csharp private void OnSymbolWritten(int id, bool error, string reply) { // Here check if error is false and the id is the same as given back in WriteSymbolControlled } ``` © 2025 realvirtual GmbH [https://realvirtual.io](https://realvirtual.io/) - All rights reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or by any means, including printing, saving, photocopying, recording, or other electronic or mechanical methods, without the prior written permission of the publisher. # UDP Note This interface is currently in Beta ## **UDP Interface Overview** [Section titled “UDP Interface Overview”](#udp-interface-overview) The UDP Interface provides high-performance signal communication with minimal cycle times, offering swift connectivity between applications and realvirtual.io. It supports automatic signal configuration through CSV symbol table import, making integration with PLCs and external systems quick and efficient. ## Interface Properties [Section titled “Interface Properties”](#interface-properties) The UDP interface operates using separate sending and listening ports. It’s crucial to assign distinct ports for sending and listening purposes. All PLCInput signals are transmitted to the remote partner, while all PLCOutput signals are received from the remote partner. ![](/doc/unity/assets/udpinterface%20\(1\).png) UDP Interface properties ### Basic Properties [Section titled “Basic Properties”](#basic-properties) * **Remote Listen Port** - UDP port number on the remote machine where messages are sent (default: 11000) * **Local Listen Port** - UDP port number on the local machine for receiving incoming messages (default: 11001) * **Remote IP Address** - IP address of the remote machine to send UDP messages to (e.g., 127.0.0.1 for localhost) * **Debug Mode** - Enables detailed logging of sent and received UDP messages for troubleshooting ### CSV Symbol Table Properties [Section titled “CSV Symbol Table Properties”](#csv-symbol-table-properties) * **Symbol Table** - Path to the CSV symbol table file containing signal definitions * **Split Char** - Character delimiter used to separate columns in the CSV file (typically semicolon or comma) When using the UDP Interface, all signals are transmitted and received in the form of a byte array, ensuring the most efficient packet size. Each signal must define a value in its Name property to indicate its position in the byte array. Since there is a single sending and receiving message, the positions of inputs and outputs may overlap. Signal data sizes must adhere to the following guidelines: * **Boolean:** Always occupies the first bit in one full byte (1 byte total) * **Integer:** Occupies 4 bytes * **Float (REAL):** Occupies 4 bytes ![](/doc/unity/assets/image%20\(3\).png) ## CSV Symbol Table Import [Section titled “CSV Symbol Table Import”](#csv-symbol-table-import) The UDP Interface supports automatic signal configuration through CSV symbol table import. This feature allows you to quickly configure all signals by importing a CSV file exported from your PLC or SCADA system. ### CSV File Format [Section titled “CSV File Format”](#csv-file-format) The CSV file must contain three columns with a header row: ```plaintext Name;Type;Direction SpeedSetpoint;REAL;PLC_IN CurrentSpeed;REAL;PLC_OUT StartButton;BOOL;PLC_IN RunningStatus;BOOL;PLC_OUT ErrorCode;INT;PLC_OUT TargetPosition;INT;PLC_IN ``` **Column Definitions:** 1. **Name** - The signal name (will be used as SymbolName in realvirtual) 2. **Type** - Data type of the signal * `BOOL` - Boolean value (1 byte) * `INT` - Integer value (4 bytes) * `REAL` - Float value (4 bytes) * `TEXT`, `STRING`, `WSTRING` - Text values (limited support) 3. **Direction** - Signal direction * `PLC_IN` - INPUT signal (Unity → External application) * `PLC_OUT` - OUTPUT signal (External application → Unity) ### Using CSV Import [Section titled “Using CSV Import”](#using-csv-import) 1. **Export Symbol Table** from your PLC/SCADA system in CSV format 2. **Select Symbol Table** - Click the “Select symbol table” button in the Inspector to choose your CSV file 3. **Import** - Click the “Import symbol table” button to automatically create all signals The import process will: * Automatically create signals for each row in the CSV * Calculate byte positions sequentially for INPUT and OUTPUT signals separately * Display the total number of signals imported and byte sizes for each direction **Example Console Output:** ```plaintext Successfully imported 6 signals from C:\symbols.csv Total byte sizes - Inputs (Unity→PLC): 12 bytes, Outputs (PLC→Unity): 13 bytes ``` ### Signal Byte Positioning [Section titled “Signal Byte Positioning”](#signal-byte-positioning) The import automatically calculates byte positions: * **INPUT signals** (PLC\_IN) - Byte positions start at 0 and increment based on data type size * **OUTPUT signals** (PLC\_OUT) - Byte positions start at 0 and increment independently from inputs **Example:** | Signal Name | Type | Direction | Byte Position | Size | | -------------- | ---- | --------- | ------------- | ------- | | StartButton | BOOL | PLC\_IN | 0 | 1 byte | | TargetPosition | INT | PLC\_IN | 1 | 4 bytes | | SpeedSetpoint | REAL | PLC\_IN | 5 | 4 bytes | | RunningStatus | BOOL | PLC\_OUT | 0 | 1 byte | | CurrentSpeed | REAL | PLC\_OUT | 1 | 4 bytes | | ErrorCode | INT | PLC\_OUT | 5 | 4 bytes | **Total Message Sizes:** * INPUT message (Unity → PLC): 9 bytes * OUTPUT message (PLC → Unity): 9 bytes ## Common Use Cases [Section titled “Common Use Cases”](#common-use-cases) * **PLC Integration** - Exchange data with Siemens, Beckhoff, or other PLC systems via UDP * **SCADA Communication** - Connect to SCADA systems for real-time data exchange * **SEW Drive Integration** - Import signal tables from SEW Eurodrive systems * **Custom Tools** - Communicate with custom Python, C#, or other applications * **High-Speed Data Exchange** - Minimal overhead for fast cycle times ## See Also [Section titled “See Also”](#see-also) * [Interface Overview](/doc/unity/components-and-scripts/interfaces/) * [OPC UA Interface](/doc/unity/components-and-scripts/interfaces/opc-ua-pro/) * [S7 Interface](/doc/unity/components-and-scripts/interfaces/s7-interface-pro/) # Universal Robots (Pro) Caution Please note: Universal Robots interface is only available in realvirtual.io Professional. This interface conncets the real or virtual robot controller with realvirtual.io. You can get [URIM als a virtual machine](https://www.universal-robots.com/download/software-e-series/simulator-non-linux/offline-simulator-e-series-ur-sim-for-non-linux-594/) from the Universal Robots website. You control the virtual robot in realvirtual.io like the real one. The axis positions are transmitted to realvirtual.io and the robot’s inputs and outputs are available as signals in realvirtual.io. The communication for axes and robot outputs is done via the RTDE interface of Universal Robots. The robot inputs are transmitted to the robot using URScript commands. More information about the interfaces can be found here: [](/doc/unity/assets/universalrobot.mp4) ## Demo scene[](#demo-scene) [Section titled “Demo scene ”](#demo-scene) In the folder realvirtual/private/interfaces/UniversalRobots there is a demo scene where pumkins are loaded into a box. The PLC logic is mapped in realvirtual.io with LogicSeps within the Gameobject Logics. The UR robot is controlled with input and output signals. In the scene you will find a UR10 robot that is used for the demo scene and a fully prepared UR3 robot that is switched off. The Interface folder also contains realvirtualdemo.script, the script for URSIM. If you copy this script to the robot controller, you can run the demo scene. ![](/doc/unity/assets/universalrobots-demoscene.png) ## URSIM preparation[](#ursim-preparation) [Section titled “URSIM preparation ”](#ursim-preparation) You can download URSIM from the Universal Robots website. There you will find a virtual machine image which can be run with VirtualBox or VMWare. The communication with the (virtual) robot controller is done via TCP-IP, this is why it is important, that the robot controller and realvirtual.io are connected to the same network. Please use bridged network settings within the Virtual Machine: ![](/doc/unity/assets/universalrobots-vmware.png) After you have started the virtual robot controller (in URSIM you can find all available robot controllers for UR3, UR5, UR10 and so on), you have to turn on the network in the robot controller and use DHCP or a static network address in your network: ![](/doc/unity/assets/universalrobots-tcp.png) ## Robot preparation[](#robot-preparation) [Section titled “Robot preparation ”](#robot-preparation) You need to prepare a robot with the usual realvirtual.io kinematics. In the UniversalRobot interface you have to assign the drives and the signals. You can leave signals empty that you do not need. ![](/doc/unity/assets/universalrobots-signals.png) In the demo scene there is a prepared UR5 and UR10 robot. ## Interface properties [Section titled “Interface properties”](#interface-properties) #### Is Connected [Section titled “Is Connected”](#is-connected) Is true, if the connection is sucessfully established. #### Ur Ip Adress [Section titled “Ur Ip Adress”](#ur-ip-adress) The IP adress of the (virtual) robot controller. #### Output Frequency [Section titled “Output Frequency”](#output-frequency) The Frequence in reads per second, in which the outputs should be read from URSIM #### Axis [Section titled “Axis”](#axis) Here you need to assign all Drives of the 6 robot axis. #### Digital Outputs [Section titled “Digital Outputs”](#digital-outputs) Assigned PLCOutputBool Signals to the robot outputs. #### Configurable Outputs [Section titled “Configurable Outputs”](#configurable-outputs) Assigned PLCOutputBool Signals to the robot configurable outputs. #### Digital Inputs [Section titled “Digital Inputs”](#digital-inputs) Assigned PLCInputBool Signals to the robot inputs. #### Configurable Inputs [Section titled “Configurable Inputs”](#configurable-inputs) Assigned PLCInputBool Signals to the configurable robot inputs. © 2025 realvirtual GmbH [https://realvirtual.io](https://realvirtual.io/) - All rights reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or by any means, including printing, saving, photocopying, recording, or other electronic or mechanical methods, without the prior written permission of the publisher. # Wandelbots Nova > Controlling real robots from Unity and realvirtual.io Caution This interface is currently in Beta and included in realvirtual.io Professional since Version 6.1.0 ## Overview [Section titled “Overview”](#overview) This documentation provides a guide for utilizing the Wandelbots NOVA Interface within the realvirtual.io framework for automation concept design, virtual commissioning, and 3D-HMI. This interface facilitates seamless communication and control of robotic systems through the Wandelbots NOVA API. ![](/doc/unity/assets/WandelbotsNova.png) Wandelbots NOVA Interface ![](/doc/unity/assets/WandelbotsNovaWeb.png) NOVA controlling the Demo scene Wandelbots NOVA provides additional value in allowing users to leverage the robot program they have created and let it run on the phyiscal robot using Wandelbots NOVA. **Features:** * **Signal Handling:** Import and manage input/output signals dynamically. * **Robot Motion Control:** Supports jogging, target creation, and program execution. * **Teach Mode:** Real-time robot teaching with a dedicated mode for setting targets within the Unity Editor. * **Program Execution:** Execute robotic programs with built-in templating and monitoring of current robot position. ## Installation and Requirements [Section titled “Installation and Requirements”](#installation-and-requirements) Wandelbots NOVA requires an installation, whether used locally or hosted. “Check out the Wandelbots NOVA documentation for further information.” (The docs are currently not public. ) Contact Wandelbots to get more information and access to Wandelbots NOVA. () ## Robot Preparation [Section titled “Robot Preparation”](#robot-preparation) The demo scene includes a **Fanuc CRX-10iA\_L Robot** prefab, which serves as a basis for configuring other robots. To prepare a new robot, certain requirements must be met to ensure compatibility with the Wandelbots NOVA Interface and the realvirtual.io framework. ### Requirements for Configuring a New Robot [Section titled “Requirements for Configuring a New Robot”](#requirements-for-configuring-a-new-robot) * **Robot Prefab** * Use the **Fanuc CRX-10iA\_L Robot prefab** as a starting template. * Adjust dimensions, structure, or components based on the specific robot you are configuring. * **Drives for Robot Axis** * Every axis pivot point of the robot must include a **Drive** component. * The Drive positive direction needs to point in the positive axis jog direction. * **Target Parent Setup** * The **0 point** of the **Target parent** GameObject must align with the robot’s **0 point** (base of the robot). * This ensures accurate positioning and motion planning. * **Hierarchy and Pivot Points** * Maintain a clean and structured hierarchy for the robot parts. * Ensure pivot points for each axis are correctly positioned relative to the physical robot’s design. * **TCP (Tool Center Point)** * Define the robot’s TCP as a separate GameObject attached to the robot. * The TCP represents the point of interaction for tools or end effectors. * **Robot Targets** * Ensure all targets are created under the specified **Robot Target Root**. * Targets should be defined relative to the TCP for precise motion control. * Targets needs to be in a parent correctly defining the logical 0 point of the robot as shown in this picture: ![](/doc/unity/assets/WandelbotTargets.png) Robot Targets 0 Point Caution After preparing the robot in the Unity Editor, it is crucial to save its **0 Position** by pressing “**Save 0 Pos**” before starting any operations. This step ensures that you can revert the robot to its default position if issues arise during the teaching process in Unity Editor mode. ## Importing and Managing Signals [Section titled “Importing and Managing Signals”](#importing-and-managing-signals) To import signals, click the **Import Signals** button in the Wandelbots NOVA Interface. This will load all available signals, including standard ones. For better performance, delete any unneeded signals to reduce overhead and keep the setup efficient. ## Teaching the Robot in Unity Editor [Section titled “Teaching the Robot in Unity Editor”](#teaching-the-robot-in-unity-editor) The Wandelbots interface allows teaching robot targets directly in the Unity Editor without switching between Edit and Play modes. You can use the **NOVATarget Prefab**, placing it under the **Target Root**, to define positions for the robot. ### Target modes [Section titled “Target modes”](#target-modes) Selecting or moving a target makes the robot automatically jump to the specified position, which works in **Pose Mode** or **Joint Mode**. * **Pose Mode:** Defines a target pose (position and orientation). The robot moves to the nearest solution during runtime, though multiple solutions can be previewed in the Editor. * **Joint Mode:** Defines a specific joint configuration (axis angles). This fixed solution is transferred to the robot program, ensuring precise movements. * **Fixed Solution:** Generated when saving a position in **Teach Mode**, locking the robot to an exact configuration without allowing pose changes. ### NOVATarget Properties [Section titled “NOVATarget Properties”](#novatarget-properties) ![](/doc/unity/assets/WandelbotNovaTarget.png) Robot Target * **Follow In Edit Mode:** Allows the robot to follow target movements in the Editor. * **Display Axis:** Toggles visibility of target coordinate axes. * **Display Gripper Ghost:** Shows a transparent gripper representation at the target. * **Hide Axis Gripper On:** Hides axis and gripper visuals during specific operations. * **Axis:** Assigns the axis visual (GameObject). * **Gripper Ghost:** Assigns the gripper ghost visual (GameObject). * **Target Mode:** Defines the interaction mode: * **Pose Mode:** Moves to a pose using the nearest solution. * **Joint Mode:** Fixes specific joint angles. * **Fixed Solutions:** Locks the robot to an exact pose. * **Solution:** Displays and changes the current solution. * **Pose:** The current Pose in Wandelscript format. * **Joints:** The current Joint solution in Wandelscript format. * **Update Solutions:** Recalculates available solutions. * **Move to Target:** Moves the robot to the defined target. ### Teach Mode [Section titled “Teach Mode”](#teach-mode) In **Teach Mode**, the robot automatically aligns with the current **Wandelbots NOVA Status**. This mode allows precise control over the robot’s positioning and target creation. * **Speed Control:** Define maximum linear and rotational speeds for movements (in mm/s or Degrees / s). * **Jogging:** Adjust all linear and rotational axes manually. * **Create Target:** Use the **Create Target** button to generate a **NOVATarget** in the **Fixed Solution** configuration, ensuring the robot is locked to the exact saved position. ![](/doc/unity/assets/WandelbotsTeachMode.png) Teach Mode ## Robot Programms [Section titled “Robot Programms”](#robot-programms) Wandelscript offers a high-level programming language to control robots. It is easy to learn and use, especially if you’re familiar with Python. Wandelscript is a domain-specific language that is designed to be used with Wandelbots NOVA. You can find some Wandelscript examples here: ### Wandelscript Templates [Section titled “Wandelscript Templates”](#wandelscript-templates) You can create a standard robot program with placeholders (e.g., `{Targetname}`) to streamline the integration of robot targets. This approach allows dynamic target updates without manually modifying the robot program. ![](/doc/unity/assets/WandelbotWandelscript.png) Example Wandelscript template with Placeholders * **Placeholder Use:** Define placeholders like `{Targetname}` in the program template. * **Automatic Target Insertion:** When starting the robot program via realvirtual, all targets (joint or pose definitions) will be inserted automatically into the program. * **Dynamic Updates:** Adjust targets in the Unity Editor without manually adapting the program. * **Program Definition:** One program can be assigned in the interface properties. * **Start Program:** Press the **Start Program** button to execute the robot program automatically. ### Starting Programms with Signals [Section titled “Starting Programms with Signals”](#starting-programms-with-signals) The **WandelscriptRunner** component enables execution of different robot program templates via the **WandelscriptInterface**. Assign a robot program to **Wandelscript**, a **PLCOutput** to **Start Wandelscript** to trigger the program, and optionally configure **Wandelscript Is Running** and **Wandelscript Finished** with **PLCInput** signals to monitor the program’s execution status. This allows dynamic triggering and management of robot programs through PLC signals. ![](/doc/unity/assets/WandelscriptRunner.png) Wandelscript Runner ## Interface Properties [Section titled “Interface Properties”](#interface-properties) #### **Active** [Section titled “Active”](#active) Defines in which modes the interface should be acive. Check[ Connection Status](/doc/unity/basics/runtime-ui/#connection-status) for more information. #### **Wandelbots Server** [Section titled “Wandelbots Server”](#wandelbots-server) URL of the Wandelbots NOVA server. Can be a local or a cloud instance (e.g. `http://172.20.125.85`) for local instance. #### **Motion Group** [Section titled “Motion Group”](#motion-group) Identifier for the robot’s motion group (e.g. `1@fanuc`) #### **Username** [Section titled “Username”](#username) The username used for authentication with the Wandelbots server. #### **Password** [Section titled “Password”](#password) The password used for authentication with the Wandelbots server. #### **Access Token** [Section titled “Access Token”](#access-token) Token for authentication, overriding `Username` and `Password`. Must be used for cloud instances. #### **Cell** [Section titled “Cell”](#cell) Identifier for the robotic cell (standard is `cell`). #### **Debug Mode** [Section titled “Debug Mode”](#debug-mode) Enables detailed debug logging in the Unity console. Turn it on on connection problems. #### **Cycle Time (ms)** [Section titled “Cycle Time (ms)”](#cycle-time-ms) Time interval for state updates from the server (standard 20ms). #### **Start Program On Simulation** [Section titled “Start Program On Simulation”](#start-program-on-simulation) Automatically starts the program when the simulation begins. #### **Loop Program** [Section titled “Loop Program”](#loop-program) Enables looping of the executed program. #### **Program Timeout (s)** [Section titled “Program Timeout (s)”](#program-timeout-s) Timeout period for program execution. #### **Program Template** [Section titled “Program Template”](#program-template) Text asset containing the template code for the robot program. #### **Program Executed** [Section titled “Program Executed”](#program-executed) Text asset where the executed program code is saved. #### **Robot Target Prefab** [Section titled “Robot Target Prefab”](#robot-target-prefab) Prefab used for creating new robot targets in Teach Mode. #### **TCP** [Section titled “TCP”](#tcp) GameObject representing the robot’s Tool Center Point. #### **Robot Target Root** [Section titled “Robot Target Root”](#robot-target-root) Parent GameObject for all created robot targets. #### **Coordinate System Prefab** [Section titled “Coordinate System Prefab”](#coordinate-system-prefab) Prefab for visualizing the robot’s coordinate system in Teach Mode. #### **Controller** [Section titled “Controller”](#controller) Name of the robot controller (read-only). #### **Inputs** [Section titled “Inputs”](#inputs) Number of inputs available in the robot controller. #### **Outputs** [Section titled “Outputs”](#outputs) Number of outputs available in the robot controller. #### **Program Is Running** [Section titled “Program Is Running”](#program-is-running) Indicates if a program is currently running. #### **Teach Mode** [Section titled “Teach Mode”](#teach-mode-1) Indicates if Teach Mode is currently active. 1. # WebSocket Realtime Interface > High-performance WebSocket interface for bidirectional signal exchange (Pro) Note This feature was added in realvirtual **6.3** (Professional). Note This interface requires the **REALVIRTUAL\_JSON** compiler define. See [Newtonsoft JSON](/doc/unity/advanced-topics/newtonsoft-json/) for setup instructions. ## Overview [Section titled “Overview”](#overview) The WebSocket Realtime Interface provides high-performance, bidirectional signal exchange over WebSocket connections. It operates as both **server** and **client**, enabling connectivity between two Unity instances, external applications, PLCs, or any system that supports WebSocket communication. Built on the [FastInterface](/doc/unity/components-and-scripts/interfaces/custom-interfaces/) framework, it offers thread-safe background communication, automatic reconnection, change detection, and low-latency signal transport. **Key capabilities:** * **Server and Client mode** in a single component * **Flat JSON wire protocol (v2)** for easy integration from any language * **Signal import** from remote side with automatic direction inversion * **SSL/TLS support** (wss\://) for secure connections through reverse proxies * **Pattern-based signal direction detection** for external systems without PLC-style type prefixes * **Subscribe filtering** so clients only receive the signals they need Tip **realvirtual CONNECT** speaks the same protocol on `ws://:5100/ws`. To connect this interface to CONNECT, use client mode with **Port** `5100` and **Path** `/ws`. If you build your own application against CONNECT rather than against Unity, use the [CONNECT REST and WebSocket API](/doc/web/connect/development/rest-and-websocket-api/) reference: it covers authentication, error behaviour and the few points where CONNECT differs from a Unity server. ## Setup [Section titled “Setup”](#setup) ### Adding the Interface [Section titled “Adding the Interface”](#adding-the-interface) 1. Drag the **WebsocketRealtimeInterface** prefab into your scene, or add the component to an existing GameObject 2. The interface appears as a child of your realvirtual root object 3. Create PLC signal objects (PLCInputBool, PLCOutputFloat, etc.) as children of the interface ![](/doc/unity/assets/websocket-realtime-inspector.png) WebSocket Realtime Interface Inspector ### Server Mode [Section titled “Server Mode”](#server-mode) Set **Is Server** to `true` (in the **Connection Settings** foldout). The server listens on the configured address and port and broadcasts signal data to all connected clients. * **Address**: IP to bind to (`127.0.0.1` for localhost, `0.0.0.0` for all interfaces) * **Port**: TCP port (default: 1234) ### Client Mode [Section titled “Client Mode”](#client-mode) Set **Is Server** to `false`. The client connects to a remote WebSocket server. * **Address**: IP address of the server * **Port**: TCP port of the server * **Use SSL**: Enable for `wss://` connections (e.g. through a reverse proxy) * **Path**: Optional URL path (e.g. `/my-bridge/ws` for reverse proxy routing) * **Client Name**: Identification sent during handshake ### Signal Import [Section titled “Signal Import”](#signal-import) #### Client Mode Import (Edit Mode) [Section titled “Client Mode Import (Edit Mode)”](#client-mode-import-edit-mode) In **client mode**, you can import signals from the remote server without manually creating them: 1. Make sure the remote server is running 2. Click **Import Signals** in the Inspector (works in edit mode — no play mode required) 3. The interface connects, requests the signal catalog, creates local mirror signals with inverted directions, and disconnects You can also use **Test Connection** to verify connectivity without importing. #### Server Mode Import (Play Mode) [Section titled “Server Mode Import (Play Mode)”](#server-mode-import-play-mode) In **server mode**, you can import signals from connected clients during play mode: 1. Start the simulation so the server is running and clients are connected 2. Click **Import Signals from Clients** in the Inspector 3. The server broadcasts an import request to all connected clients and creates local mirror signals with inverted directions This is useful for discovering which signals a remote client provides without manually defining them. ## Properties [Section titled “Properties”](#properties) ### Configuration [Section titled “Configuration”](#configuration) | Property | Description | | -------------------------------- | --------------------------------------------------------------------------- | | **Update Cycle Ms** | Communication loop interval in milliseconds (default: 10) | | **Only Transmit Changed Inputs** | Only send signals whose values changed since last cycle | | **Auto Reconnect** | Automatically reconnect on connection loss | | **Reconnect Interval Seconds** | Seconds between reconnection attempts | | **Max Reconnect Attempts** | Maximum number of reconnection attempts before giving up (`-1` = unlimited) | | **Debug Mode** | Enable detailed logging for troubleshooting | ### Connection Settings [Section titled “Connection Settings”](#connection-settings) | Property | Description | | ------------------- | -------------------------------------------------------- | | **Is Server** | `true` = WebSocket server, `false` = WebSocket client | | **Address** | IP address to bind (server) or connect to (client) | | **Port** | TCP port for communication (default: 1234) | | **Use SSL** | (Client only) Use `wss://` for encrypted connections | | **Path** | (Client only) Optional URL path appended after host:port | | **Client Name** | (Client only) Name sent during init handshake | | **Connect On Play** | Automatically connect when entering play mode | ### Status [Section titled “Status”](#status) | Property | Description | | --------------------- | --------------------------------------------------- | | **Connected Clients** | (Server only) Number of currently connected clients | ### Signal Import [Section titled “Signal Import”](#signal-import-1) | Property | Description | | ---------------------------- | ---------------------------------------------------------------------------- | | **Default Signal Direction** | Direction for imported signals when no pattern matches (`Input` or `Output`) | | **Use Pattern Matching** | Enable name-based direction detection | | **Input Patterns** | Name substrings that identify signals Unity writes (e.g. `"Unity"`) | | **Output Patterns** | Name substrings that identify signals the PLC writes | ## Use Cases [Section titled “Use Cases”](#use-cases) * **Unity-to-Unity** distributed simulation with signal mirroring * **External application** integration (web dashboards, custom HMIs, test frameworks) * **PLC bridge** connections (e.g. via a bridge application running on ctrlX CORE or other edge devices) * **WebGL builds** where TCP-based protocols are not available *** ## Wire Protocol v2 Reference [Section titled “Wire Protocol v2 Reference”](#wire-protocol-v2-reference) The WebSocket Realtime Interface uses a flat JSON protocol. All messages are UTF-8 encoded JSON objects sent as WebSocket text frames. There is **no double-encoding** - all fields are native JSON types. The examples on this page use port `1234`, the default of this interface. realvirtual CONNECT serves the same protocol on port `5100` at the path `/ws`, but behaves differently as a server in a few points: it sends `import_answer` and a full `data` message right after connect without a request, ignores `subscribe` (every client receives every change), never sends `snapshot`, does not apply `config_set`, needs an API key for clients on other machines, and closes connections that send nothing for 90 seconds. See the [CONNECT REST and WebSocket API](/doc/web/connect/development/rest-and-websocket-api/). ### Message Envelope [Section titled “Message Envelope”](#message-envelope) Every message has a `type` field that determines its purpose: ```json { "type": "", "version": 2, ... } ``` ### Message Types [Section titled “Message Types”](#message-types) #### `init` - Client Identification [Section titled “init - Client Identification”](#init---client-identification) Sent by the client immediately after the WebSocket connection is established. ```json { "type": "init", "version": 2, "name": "MyClient" } ``` | Field | Type | Description | | --------- | ------ | -------------------------- | | `type` | string | Always `"init"` | | `version` | int | Protocol version (`2`) | | `name` | string | Client identification name | #### `data` - Cyclic Signal Exchange [Section titled “data - Cyclic Signal Exchange”](#data---cyclic-signal-exchange) Sent cyclically in both directions. Contains signal names and their current values. ```json { "type": "data", "signals": { "Sensor1": true, "DriveSpeed": 150.5, "MotorOn": false, "Counter": 42, "Status": "Running" } } ``` | Field | Type | Description | | --------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------ | | `type` | string | Always `"data"` | | `signals` | object | Map of signal name to current value. Values are native JSON types: `true`/`false` for bool, numbers for int/float, strings for text. | #### `import_request` - Signal Discovery Request [Section titled “import\_request - Signal Discovery Request”](#import_request---signal-discovery-request) Sent from one side to request the full signal catalog from the other side. ```json { "type": "import_request", "version": 2 } ``` #### `import_answer` - Signal Catalog Response [Section titled “import\_answer - Signal Catalog Response”](#import_answer---signal-catalog-response) Response to `import_request`. Contains all signal names, their current values, and their PLC type strings. ```json { "type": "import_answer", "version": 2, "signals": { "Sensor1": true, "DriveSpeed": 0.0, "Counter": 0 }, "signalTypes": { "Sensor1": "PLCInputBool", "DriveSpeed": "PLCInputFloat", "Counter": "PLCOutputInt" } } ``` | Field | Type | Description | | ------------- | ------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `signals` | object | Signal name to current value | | `signalTypes` | object | Signal name to type string. Recognized types: `PLCInputBool`, `PLCOutputBool`, `PLCInputInt`, `PLCOutputInt`, `PLCInputFloat`, `PLCOutputFloat`, `PLCInputText`, `PLCOutputText`. Neutral types without prefix (e.g. `Bool`, `Float`) are also accepted. | **Direction inversion on import:** When the receiving side imports signals, the direction is inverted: * Remote `PLCInputBool` (remote reads from PLC) becomes local `PLCOutputBool` (local writes to Unity) * Remote `PLCOutputBool` (remote writes from PLC) becomes local `PLCInputBool` (local reads from Unity) #### `subscribe` - Filter Server Output [Section titled “subscribe - Filter Server Output”](#subscribe---filter-server-output) Sent by the client to tell the server which signals it wants to receive. The server then only sends matching signals in `data` messages. If no subscribe message is sent, the server sends all signals. ```json { "type": "subscribe", "version": 2, "subscribe": ["Sensor1", "DriveSpeed", "Counter"] } ``` #### `snapshot` - Immediate Full State [Section titled “snapshot - Immediate Full State”](#snapshot---immediate-full-state) Sent by the server after receiving a `subscribe` message. Contains the current values of all subscribed signals. ```json { "type": "snapshot", "signals": { "Sensor1": true, "DriveSpeed": 0.0, "Counter": 0 } } ``` #### `config_get` - Read Server Configuration [Section titled “config\_get - Read Server Configuration”](#config_get---read-server-configuration) Sent by the client to request the current configuration from the server (e.g. a bridge application). ```json { "type": "config_get", "version": 2 } ``` #### `config_answer` - Configuration Response [Section titled “config\_answer - Configuration Response”](#config_answer---configuration-response) Sent by the server in response to `config_get`. Contains the current configuration as a key-value map. ```json { "type": "config_answer", "version": 2, "config": { "publishIntervalMs": 5, "loggingLevel": "Information", "browsePaths": [ { "prefix": "plc/app/Application/sym", "direction": "input", "recursive": true } ] } } ``` | Field | Type | Description | | -------- | ------ | ----------------------------------------------------------------------------------------------------- | | `config` | object | Application-specific key-value configuration map. The structure depends on the server implementation. | #### `config_set` - Write Server Configuration [Section titled “config\_set - Write Server Configuration”](#config_set---write-server-configuration) Sent by the client to update configuration values on the server. The server should persist and apply the new configuration. ```json { "type": "config_set", "version": 2, "config": { "publishIntervalMs": 10, "loggingLevel": "Debug", "browsePaths": [ { "prefix": "plc/app/Application/sym", "direction": "input", "recursive": true } ] } } ``` #### `config_result` - Configuration Update Result [Section titled “config\_result - Configuration Update Result”](#config_result---configuration-update-result) Sent by the server in response to `config_set`. Reports whether the configuration was applied successfully. ```json { "type": "config_result", "version": 2, "success": true, "message": "Configuration saved and applied" } ``` | Field | Type | Description | | --------- | ------- | --------------------------------------------------------- | | `success` | boolean | `true` if the configuration was applied, `false` on error | | `message` | string | Human-readable result message | Note The `config` messages are optional and application-specific. They are used by the ctrlX bridge to remotely configure publish intervals, logging levels, and Data Layer browse paths. If you implement your own server, you can define any key-value structure for the `config` field or ignore these messages entirely. ### Signal Value Types [Section titled “Signal Value Types”](#signal-value-types) | realvirtual Type | JSON Type | Example | | ---------------------------------- | --------- | ----------------------- | | `PLCInputBool` / `PLCOutputBool` | boolean | `true`, `false` | | `PLCInputInt` / `PLCOutputInt` | integer | `42`, `-1`, `0` | | `PLCInputFloat` / `PLCOutputFloat` | number | `3.14`, `0.0`, `-100.5` | | `PLCInputText` / `PLCOutputText` | string | `"Running"`, `""` | *** ## Implementing the Other Side [Section titled “Implementing the Other Side”](#implementing-the-other-side) This section describes how to build your own WebSocket application that communicates with the realvirtual WebSocket Realtime Interface. You can use any programming language that supports WebSocket connections. ### Connection Sequence [Section titled “Connection Sequence”](#connection-sequence) When connecting to a realvirtual **server**: ```plaintext 1. Open WebSocket connection to ws://address:port 2. Send "init" message with your client name 3. (Optional) Send "import_request" to discover available signals 4. (Optional) Send "subscribe" to filter which signals you receive 5. Start cyclic exchange of "data" messages ``` When running your own **server** that realvirtual connects to as client: ```plaintext 1. Start WebSocket server on your address:port 2. Receive "init" message from realvirtual (client identifies itself) 3. (Optional) Receive "subscribe" message listing signals the client wants 4. (Optional) Send "snapshot" with current values of subscribed signals 5. Start cyclic exchange of "data" messages ``` ### Example: Python Client [Section titled “Example: Python Client”](#example-python-client) A minimal Python client that connects to a realvirtual server, imports signals, and exchanges data: ```python import asyncio import json import websockets async def main(): uri = "ws://127.0.0.1:1234" async with websockets.connect(uri) as ws: # 1. Send init await ws.send(json.dumps({ "type": "init", "version": 2, "name": "PythonClient" })) print("Connected and init sent") # 2. Request signal catalog await ws.send(json.dumps({ "type": "import_request", "version": 2 })) # 3. Wait for import_answer while True: raw = await ws.recv() msg = json.loads(raw) if msg.get("type") == "import_answer": print(f"Available signals: {list(msg['signalTypes'].keys())}") break # 4. Subscribe to specific signals (optional) await ws.send(json.dumps({ "type": "subscribe", "version": 2, "subscribe": ["Sensor1", "DriveSpeed"] })) # 5. Cyclic data exchange while True: # Receive data from realvirtual raw = await asyncio.wait_for(ws.recv(), timeout=5.0) msg = json.loads(raw) if msg.get("type") in ("data", "snapshot"): signals = msg.get("signals", {}) print(f"Received: {signals}") # Send data back to realvirtual await ws.send(json.dumps({ "type": "data", "signals": { "MyOutput": True, "SetSpeed": 100.5 } })) asyncio.run(main()) ``` ### Example: Python Server [Section titled “Example: Python Server”](#example-python-server) A server that realvirtual connects to as a client. This is useful when your application is the “host” and realvirtual is a connected client: ```python import asyncio import json import websockets # Signal state signals = { "PLC_Running": True, "PLC_Speed": 0.0, "PLC_Counter": 0 } signal_types = { "PLC_Running": "PLCOutputBool", "PLC_Speed": "PLCOutputFloat", "PLC_Counter": "PLCOutputInt" } async def handle_client(ws): client_name = "unknown" subscribed_signals = None # None = send all async for raw in ws: msg = json.loads(raw) msg_type = msg.get("type") if msg_type == "init": client_name = msg.get("name", "unknown") print(f"Client connected: {client_name}") elif msg_type == "import_request": # Send signal catalog await ws.send(json.dumps({ "type": "import_answer", "version": 2, "signals": signals, "signalTypes": signal_types })) elif msg_type == "subscribe": subscribed_signals = msg.get("subscribe", []) # Send snapshot of subscribed signals snapshot = {k: v for k, v in signals.items() if k in subscribed_signals} await ws.send(json.dumps({ "type": "snapshot", "signals": snapshot })) elif msg_type == "data": # Receive values from realvirtual received = msg.get("signals", {}) print(f"From {client_name}: {received}") # Process received values in your application... # Send updated values back to_send = signals if subscribed_signals is not None: to_send = {k: v for k, v in signals.items() if k in subscribed_signals} await ws.send(json.dumps({ "type": "data", "signals": to_send })) async def main(): async with websockets.serve(handle_client, "0.0.0.0", 1234): print("WebSocket server running on ws://0.0.0.0:1234") await asyncio.Future() # run forever asyncio.run(main()) ``` ### Example: C# Client (.NET) [Section titled “Example: C# Client (.NET)”](#example-c-client-net) For .NET applications (e.g. a bridge application on a PLC or edge device): ```csharp using System; using System.Collections.Generic; using System.Net.WebSockets; using System.Text; using System.Text.Json; using System.Threading; using System.Threading.Tasks; public class RealvirtualWebSocketClient { private ClientWebSocket ws; private readonly string uri; private readonly string clientName; public RealvirtualWebSocketClient(string uri, string clientName = "DotNetClient") { this.uri = uri; this.clientName = clientName; } public async Task ConnectAsync(CancellationToken ct = default) { ws = new ClientWebSocket(); await ws.ConnectAsync(new Uri(uri), ct); // Send init await SendAsync(new { type = "init", version = 2, name = clientName }, ct); } public async Task> ReceiveDataAsync( CancellationToken ct = default) { var buffer = new byte[8192]; var result = await ws.ReceiveAsync(buffer, ct); var json = Encoding.UTF8.GetString(buffer, 0, result.Count); var msg = JsonSerializer.Deserialize(json); var msgType = msg.GetProperty("type").GetString(); if (msgType == "data" || msgType == "snapshot") { var signals = new Dictionary(); foreach (var prop in msg.GetProperty("signals").EnumerateObject()) signals[prop.Name] = prop.Value; return signals; } return null; } public async Task SendDataAsync(Dictionary signals, CancellationToken ct = default) { await SendAsync(new { type = "data", signals }, ct); } public async Task RequestImportAsync(CancellationToken ct = default) { await SendAsync(new { type = "import_request", version = 2 }, ct); } private async Task SendAsync(object message, CancellationToken ct) { var json = JsonSerializer.Serialize(message); var bytes = Encoding.UTF8.GetBytes(json); await ws.SendAsync(bytes, WebSocketMessageType.Text, true, ct); } } ``` ### Example: JavaScript / TypeScript (Browser or Node.js) [Section titled “Example: JavaScript / TypeScript (Browser or Node.js)”](#example-javascript--typescript-browser-or-nodejs) ```javascript const ws = new WebSocket("ws://127.0.0.1:1234"); ws.onopen = () => { // Send init ws.send(JSON.stringify({ type: "init", version: 2, name: "WebClient" })); // Request signal catalog ws.send(JSON.stringify({ type: "import_request", version: 2 })); }; ws.onmessage = (event) => { const msg = JSON.parse(event.data); switch (msg.type) { case "import_answer": console.log("Available signals:", Object.keys(msg.signalTypes)); // Subscribe to specific signals ws.send(JSON.stringify({ type: "subscribe", version: 2, subscribe: ["Sensor1", "DriveSpeed"] })); break; case "data": case "snapshot": console.log("Received signals:", msg.signals); // Send data back ws.send(JSON.stringify({ type: "data", signals: { "MyOutput": true, "SetSpeed": 100.5 } })); break; } }; ``` ### Direction Mapping Guide [Section titled “Direction Mapping Guide”](#direction-mapping-guide) When implementing the other side, understanding signal direction is critical: | Your application sends… | realvirtual creates… | Meaning | | ------------------------------------------ | ------------------------------------------ | -------------------------------------- | | `signalTypes: {"Speed": "PLCOutputFloat"}` | Local `PLCInputFloat` named “Speed” | Your app writes Speed, Unity reads it | | `signalTypes: {"Enable": "PLCInputBool"}` | Local `PLCOutputBool` named “Enable” | Your app reads Enable, Unity writes it | | `signalTypes: {"Value": "Float"}` | Direction from pattern matching or default | Neutral type - no direction prefix | **Rule of thumb:** If your application **writes** a value, declare it as `PLCOutput`. If your application **reads** a value from Unity, declare it as `PLCInput`. realvirtual inverts the direction on import. ### Tips for Implementers [Section titled “Tips for Implementers”](#tips-for-implementers) * **JSON only** - All messages are JSON text frames. Binary frames are not used. * **No heartbeat required** - The cyclic `data` messages serve as implicit heartbeat. If you stop sending data, the connection to a Unity server remains open. realvirtual CONNECT is stricter: it closes a connection after 90 seconds without an incoming message, so send `init` every 25 seconds when talking to CONNECT. * **Partial updates** - `data` messages do not need to contain all signals. You can send only the signals that changed. * **Type coercion** - realvirtual will attempt to convert JSON number types. Sending `1` for a float signal or `1.0` for an int signal works. * **Signal names** - Use consistent names between both sides. Names are case-sensitive and matched exactly. * **SSL/TLS** - For production deployments through reverse proxies (nginx, traefik), configure `useSSL=true` and set the `path` to match your proxy route. ## Troubleshooting [Section titled “Troubleshooting”](#troubleshooting) **Interface does not connect:** * Check that the server is running and reachable on the configured address and port * For client mode, verify the address, port, SSL, and path settings * Use the **Test Connection** button to verify connectivity * Enable **Debug Mode** for detailed logging **Signals not updating:** * Ensure signals are child GameObjects of the interface * Check signal directions (Input = Unity writes, Output = Unity reads) * Verify that signal names match exactly between both sides * Check the **data** messages being sent contain the expected signal names **Import creates wrong directions:** * Review your `signalTypes` in the `import_answer` - `PLCInput` and `PLCOutput` are inverted on import * For neutral types, configure **Input Patterns** and **Output Patterns** or set the **Default Signal Direction** ## See Also [Section titled “See Also”](#see-also) * [Custom Interfaces (FastInterface)](/doc/unity/components-and-scripts/interfaces/custom-interfaces/) - How to build your own interfaces * [Signal Manager](/doc/unity/components-and-scripts/interfaces/signal-manager/) - Managing PLC signals * [Interfaces Overview](/doc/unity/components-and-scripts/interfaces/) - All available interfaces * [realvirtual CONNECT REST and WebSocket API](/doc/web/connect/development/rest-and-websocket-api/) - The same protocol served by CONNECT on port 5100 # Windmod Y200 Note This interface is currently in Beta [Winmod](https://www.winmod.de/english/), an application for virtual commissioning, seamlessly integrates with realvirtual.io. This collaboration enhances the simulation experience by leveraging high-performance 3D models from realvirtual.io and Winmod’s extensive component library. Winmod and realvirtual.io communicate via shared memory, enabling efficient data exchange and synchronization. Both applications must run on the same Windows computer to ensure compatibility and optimal performance ## Interface properties [Section titled “Interface properties”](#interface-properties) **SharedMemoryName** Name of the Shared Memory used for communication. Enter the name of the shared memory corresponding to the Winmod Y200 setting. **Status** Status of the interface during simulation. This value is read-only and displays “SHM connected” when the interface is functioning properly. **DebugMode** Toggle debug mode for additional logging. Enable this option to activate debug mode and receive additional logging information. **SignalList** Path to the symbol table of Winmod (text file). Enter the path to the symbol table file (\*.txt) containing the PLC signals for later on importing **CycleCounter** Counter of the current cycle. This value is read-only and indicates the current cycle counter. **TickCount** Current tick count. This value is read-only and indicates the current tick count. ![](/doc/unity/assets/winmod-properties%20\(1\).png) Winmod interface properties ## **Importing Signals** [Section titled “Importing Signals”](#importing-signals) ## **Manually Setting Up Signals** [Section titled “Manually Setting Up Signals”](#manually-setting-up-signals) To manually configure signals, it’s crucial to specify each signal’s position within the Shared Memory Area. This is accomplished by adding a memory position description to the signal name, adhering to the following standardized convention: ![](/doc/unity/assets/winmod-signal.png) Defining the memory position for a signal **Boolean** * **Description:** Represents a boolean value (true or false). * **Syntax:** `MB 13.6` * **Explanation:** Bit shared memory position 13, bit 6. **Integer** * **Description:** Represents a signed integer value (2 bytes). * **Syntax:** `MI 100` * **Explanation:** Integer (2 bytes) at shared memory position 100. **Double Integer** * **Description:** Represents a signed integer value (4 bytes). * **Syntax:** `MD 102` * **Explanation:** Double integer (4 bytes) at shared memory position 102. **Float** * **Description:** Represents a floating-point value (4 bytes). * **Syntax:** `MF 106` * **Explanation:** Float (4 bytes) at shared memory position 106. # Motion and Kinematic Motion axes are modeled by connecting [Drives](/doc/unity/components-and-scripts/motion/drive/) to GameObjects. The [Drive](/doc/unity/components-and-scripts/motion/drive/) will move the GameObject, including its sub-components, along a defined rotational or linear axis. The [Drive](/doc/unity/components-and-scripts/motion/drive/) is a base component with some generic [Drive](/doc/unity/components-and-scripts/motion/drive/) behavior but it does not expose a Signal interfaces to a PLC. For this a [Drive Behavior](/doc/unity/components-and-scripts/motion/drive-behavior/) script is added in addition to the [Drive](/doc/unity/components-and-scripts/motion/drive/) script for the GameObject. The [Drive Behavior](/doc/unity/components-and-scripts/motion/drive-behavior/) includes special behaviors (such as pneumatic cylinders or position controlled drives) including any signals supporting the special behavior. Note The standard units for drive positions in all realvirtual.io components are millimeters for linear drives and degrees for rotational drives. The standard units for speeds are millimeters per second and degrees per second. In Unity, each millimeter is represented as one Unity unit (which means what you see in the Transform component in Unity is in meters). You can adjust the scale in **realvirtualController**, but this is generally not recommended. ## Choosing a Motion Approach [Section titled “Choosing a Motion Approach”](#choosing-a-motion-approach) realvirtual offers several complementary ways to move geometry. Pick the one that matches how your mechanism is built: * **[Drive](/doc/unity/components-and-scripts/motion/drive/) + hierarchy** — the standard, and the right choice for the vast majority of axes. A Drive moves a GameObject and all its children along one linear or rotational axis. Chain Drives through the Transform hierarchy to build serial kinematics (a stacked XYZ gantry, a conveyor, a simple robot wrist). Add a [Drive Behavior](/doc/unity/components-and-scripts/motion/drive-behavior/) for PLC signals and special behaviors (pneumatic cylinders, position control). * **[Kinematic Joints](/doc/unity/components-and-scripts/motion/kinematic-joints/) *(Professional)*** — a position-based constraint solver for **closed kinematic chains** that a parent/child hierarchy cannot express, because one link has to satisfy more than one constraint at once. Use it for Delta robots, four-bar linkages, scissor lifts and parallel grippers. Drives still drive the active joints; the solver positions every passive link each FixedUpdate, without physics, jitter or drift. Its `KinematicTarget` companion adds inverse (Cartesian-target) control to the same mechanism. Runs in a native, multi-threaded solver that scales to hundreds of mechanisms. * **[Joint](/doc/unity/components-and-scripts/motion/joint/)** — a PhysX-based joint. Physics joints are force-driven and iterative, so they tend to **jitter, sag and drift**: a closed loop never settles perfectly, springs and dampers have to be tuned, and the same input can give slightly different results from run to run. Use PhysX joints only when you genuinely want dynamic behaviour (falling parts, collisions, compliance) — not when you need an exact, repeatable mechanism pose. * **[Kinematic](/doc/unity/components-and-scripts/motion/kinematic/)** — a CAD import helper that groups parts and corrects pivots; despite the similar name it is unrelated to Kinematic Joints. * **Robot IK *(Professional)*** — dedicated inverse kinematics for standard serial 6-axis and collaborative robots, with path planning and blending (see [Robot Inverse Kinematics](/doc/unity/components-and-scripts/robot-inverse-kinematics/)). Tip **Accuracy over physics for mechanisms.** For any mechanism where the pose has to be *correct* — a Delta robot picking to an exact point, a linkage indexing to a fixed stop, a gripper closing to a precise width — prefer **[Kinematic Joints](/doc/unity/components-and-scripts/motion/kinematic-joints/)** over PhysX joints. The constraint solver satisfies the geometry exactly every FixedUpdate with no jitter, no drift and fully deterministic, repeatable results, while a physics joint only ever approximates the constraint and needs tuning to stay stable. In realvirtual, physics is mainly used for the **parts (MUs) themselves** — parts falling, colliding, singulating and accumulating on [transport surfaces](/doc/unity/components-and-scripts/motion/transportsurface/), in chutes and in bins — where the dynamic, force-driven behaviour is exactly what you want. Use physics for the material flow; use Drives and Kinematic Joints for the machine’s own moving structure. The rest of this page focuses on the standard [Drive](/doc/unity/components-and-scripts/motion/drive/). This Youtube tutorial shows how to define [Drives](/doc/unity/components-and-scripts/motion/drive/) [Tutorial Adding Drives](https://www.youtube-nocookie.com/embed/VoAYuNF4kRM) Tutorial Adding Drives > We supply seveal standard Behavior models, but due to the large variety of automation devices and functionality, it is most likely you will need to add your own behavior models. The next image gives a good overview of [Drives](/doc/unity/components-and-scripts/motion/drive/) moving GameObjects. The [Drive](/doc/unity/components-and-scripts/motion/drive/) is contolled by a special Drive Behavior which is connected to one or more Signals. The Signals are then connected to a PLC (using an [Automation Interface](https://game4automation.com/documentation/current/interface.html)) ![](/doc/unity/assets/motion-axis.png) © 2025 realvirtual GmbH [https://realvirtual.io](https://realvirtual.io/) - All rights reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or by any means, including printing, saving, photocopying, recording, or other electronic or mechanical methods, without the prior written permission of the publisher. # Cable (Pro) Note The Cable component is part of realvirtual **Professional**. Find it under **realvirtual > Mechanical (Pro) > Cable** and **Cable Point**. ## Overview [Section titled “Overview”](#overview) The **Cable** makes a cable, hose, or dress pack **flexible**. You place **Cable Points** along the route, and the Cable calculates how the cable sags, bends, and follows moving machine parts such as robot axes or linear slides. The result is deterministic, so the same motion always gives the same cable shape — suitable for virtual commissioning. Two components work together: | Component | What it is | | --------------- | ------------------------------------------------------------------------------------------------------- | | **Cable** | The cable itself: its length, thickness, stiffness, and how it is drawn | | **Cable Point** | A child object of the Cable that marks where the cable is **fixed** (Anchor) or **led through** (Guide) | The Cable can deform an existing CAD mesh, draw a generated tube, or show a simple line. In the Scene view you see a live preview of the cable shape while you place the points, even without running the simulation. ## Quick Start [Section titled “Quick Start”](#quick-start) 1. Add a **Cable** to a GameObject. For a CAD cable, use the GameObject that holds the cable mesh and leave **Render Mode** on **DeformMesh**. 2. Click **Add Anchor** twice to create the start and end point of the cable. Add **Add Guide** points for clips or supports in between. 3. Move the points in the Scene view with the standard Unity move tool. Each point has its own gizmo, so you can click it directly. 4. For an end that sits on a moving part, drag that part (for example a robot axis) into **Connected To** of the Cable Point. 5. Leave **Cable Length** at 0 for an automatic length, or enter the real length in millimeters. 6. Press Play. The cable follows the moving parts. ## Cable [Section titled “Cable”](#cable) ### Cable [Section titled “Cable”](#cable-1) **Points** (list of Cable Point) The ordered anchors and guides along the cable, from start to end. The first and last entry are the two cable ends; at least two points are required. Use the **Add Anchor** and **Add Guide** buttons to create points as children of the Cable. **Cable Length** (float, millimeters) The rest length of the cable. 0 calculates it automatically as 1.05 times the distance along the points, which gives a slightly slack cable. Enter the real length to get realistic sag and reach. **Diameter** (float, millimeters) Thickness of the cable. It sets the tube thickness, the line width, and the clearance used for collisions. **Render Mode** (DeformMesh / ProceduralTube / LineOnly) How the cable is drawn. **DeformMesh** bends an existing CAD mesh along the solved cable. **ProceduralTube** generates a tube of the given Diameter. **LineOnly** draws a simple line, useful for debugging. If the CAD mesh cannot be deformed, the cable switches to ProceduralTube and logs a warning. **Source Mesh** (MeshFilter) The mesh to deform in DeformMesh mode. Leave it empty to use the mesh on the Cable’s own GameObject. Note DeformMesh needs a mesh with **Read/Write** enabled in its import settings. CAD imports often have it switched off. ### Simulation [Section titled “Simulation”](#simulation) **Segments** (integer) Number of calculation segments between the first and last point. More segments give a smoother cable but cost more calculation time. The minimum is 2. **Solver Iterations** (integer) How often the cable constraints are refined per step. Higher values give a more accurate, stiffer result at higher cost. Together with Segments it sets the cost of the cable. **Stiffness** (0 to 1) Bending stiffness. Low values give a limp cable, high values a stiff hose that resists bending. **Min Bend Radius** (float, millimeters) The smallest radius the cable can be bent to. Set it to the bending radius from the cable datasheet so the cable never kinks. 0 means unlimited. **Damping** (0 to 1) Calms the cable motion. Higher values make it settle faster and swing less. ### Collision [Section titled “Collision”](#collision) **Collide With Scene** (boolean) Pushes the cable out of colliders it would run into, for example the robot arms. The colliding objects need Colliders; a convex Mesh Collider on each robot link is enough. Non-convex Mesh Colliders cannot be used and produce a warning. **Collision Layers** (layer mask) The layers the cable collides with. Only shown when **Collide With Scene** is on. **Collision Clearance** (float, millimeters) Extra gap kept between the cable surface and the colliders. Only shown when **Collide With Scene** is on. ### Status [Section titled “Status”](#status) **Overstretched** (boolean, read-only) True while the points are further apart than the cable length. The cable is then pulled taut and drawn in orange in the Scene view. Increase **Cable Length** or move the points closer. ## Cable Point [Section titled “Cable Point”](#cable-point) **Mode** (Anchor / Guide) **Anchor** pins the cable to this point. **Guide** only leads the cable through or near the point, so the cable can slide through it like a clip or a cable guide. **Connected To** (Transform) Optional moving part this point follows, such as a robot axis or a slide. Leave it empty to use the point’s own position. When it is set, the point is positioned by that part, and its direction is taken from that part as well. **Guide Radius** (float, millimeters) Only for guides. The allowed slack around the guide point. 0 holds the cable exactly on the point; larger values let it move freely inside that radius. **Direction Length** (float, millimeters) Length over which the cable is held straight along the point’s local Z axis (the blue arrow). On an **Anchor** the cable is rigidly fixed in that direction, like a cable gland. On a **Guide** the direction is held but the cable can still slide through, like a clip. 0 leaves the cable free. Note Direction Length was added in realvirtual **6.3.6** (Professional) ### Scene View [Section titled “Scene View”](#scene-view) Cable Points draw their own gizmo, so you can click them in the Scene view and move or rotate them with the standard Unity tools. Rotate a point to change the direction of its straight run. | Color | Meaning | | ------ | -------------------------------------------------------- | | Red | Anchor | | Yellow | Anchor that follows a moving part (**Connected To** set) | | Green | Guide | The cable itself is drawn blue, or orange when it is overstretched. A line from the point shows the **Direction Length**; for a guide it extends in both directions. ## Common Use Cases [Section titled “Common Use Cases”](#common-use-cases) * **Robot Dress Pack** – Replace the rigid CAD hoses on a robot with a cable that follows every axis. * **Energy Chain Replacement** – Show a festoon or supply cable between a fixed point and a moving slide. * **Cable Gland and Clip Behavior** – Use **Direction Length** to leave a connector straight and to hold a cable in a clip. * **Concept Layouts** – Visualize cable routing early, without modeling every hose by hand. ## Tips [Section titled “Tips”](#tips) * Set **Min Bend Radius** from the datasheet. A realistic bending radius prevents unnatural kinks. * Place a **Guide** wherever the real cable is held by a clip or sleeve. The cable then slides through it instead of being pinned. * Use an **Anchor** with **Direction Length** at a connector so the cable leaves it straight before it bends. * If the cable sinks into a robot arm, enable **Collide With Scene** and give each link a convex Mesh Collider. ## See Also [Section titled “See Also”](#see-also) * [Robot Inverse Kinematics](/doc/unity/components-and-scripts/robot-inverse-kinematics/) — robots whose axes the cable follows * [Drive](/doc/unity/components-and-scripts/motion/drive/) — the drives that move the parts the cable is attached to * [Ribbon (Web) Handling](/doc/unity/components-and-scripts/motion/ribbon-handling/) — flexible material running over rollers # CAM A CAM (Camshaft) is a connection mechanism between a master Drive and a slave Drive, often used in packaging machinery and other automation systems. CAMs allow the slave drive to move in relation to the master drive according to a predefined CAM profile. This is particularly useful for controlling complex motion profiles in automated systems. You can watch this tutorial video to learn more about CAMs:\ ### Defining CAMs[](#defining-cams) [Section titled “Defining CAMs ”](#defining-cams) CAM profiles can be defined and imported into Unity through various file types. The CAM component supports both Excel and CSV formats for defining these profiles. ![](/doc/unity/assets/cam.png) ## **File Types Supported:** [Section titled “File Types Supported:”](#file-types-supported) * **Excel**: `.xlsx` files. * **CSV**: `.csv` files. ## **Public Properties** [Section titled “Public Properties”](#public-properties) **MasterDrive**\ The master drive to which the slave drive is attached. The slave drive’s position will be determined by the master drive’s position according to the CAM profile. **MasterDriveAxisScale**\ A scale factor applied to the master drive position to get the value used in the CAM curve. **MasterDriveAxisOffset**\ An offset added to the master drive position to determine the value used in the CAM curve. **CAMAxisScale**\ The scale factor for the CAM axis. It scales the values of the CAM curve. **CAMAxisOffset**\ An offset added to the values of the CAM curve to determine the position applied to the CAM (slave) axis. **ExcelSheet**\ Name of the Excel sheet used when importing CAM data from an Excel file. **ExcelFile**\ Path to the Excel file used for importing CAM data. **CamDefintion**\ A text asset containing the CAM definition. This asset is a table with optional headers and columns describing the master axis position and the slave axis position. **UseColumnNames**\ Indicates whether column names are used to define the data to import. **MasterColumn**\ The name of the column in the text asset that contains the master axis position. **SlaveColumn**\ The name of the column in the text asset that contains the slave axis position. **UseColumnNumbers**\ Indicates whether column numbers are used to define the data to import. **MasterColumnNum**\ The column number (starting with 1) that contains the master axis position in the text asset. **SlaveColumnNum**\ The column number (starting with 1) that contains the slave axis position in the text asset. **CamDefinitionWithHeader**\ Indicates whether the first line of the text asset is a header. **ImportOnStart**\ Indicates whether the CAM data should be imported automatically when the simulation starts. **IsContinous**\ Indicates whether the CAM should continue as an offset based on the last CAM position, useful for continuous movements like transport chains. **Usage Instructions** 1. **Select CAM File**: Choose the CAM profile file using the `ExcelFile` or `CamDefintion` property, depending on whether you are using Excel or CSV. 2. **Set Scaling and Offsets**: Adjust the `MasterDriveAxisScale`, `MasterDriveAxisOffset`, `CAMAxisScale`, and `CAMAxisOffset` properties to fit your application’s requirements. 3. **Import CAM Profile**: Use the `ImportOnStart` property to automatically import the CAM profile when the simulation starts. 4. **Configure Continuous Mode**: Enable `IsContinous` if the CAM profile should operate continuously. Adjust `ContinousOffset` as needed. Please check the[ Realvirtual.io Class Reference](https://game4automation.com/documentation/current/apidoc/html/classgame4automation_1_1_base_c_a_m.html) for more information about the properties and methods of this component. © 2025 realvirtual GmbH [https://realvirtual.io](https://realvirtual.io/) - All rights reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or by any means, including printing, saving, photocopying, recording, or other electronic or mechanical methods, without the prior written permission of the publisher. # Chain Chains move components along spline paths or simulation paths for material handling systems, tool changers, and other applications requiring continuous linear motion. Note **New Feature**: Burst Compiler optimization was added in realvirtual **6.0.9** (beta) providing 20-33x performance improvements for chain simulations. ## Overview [Section titled “Overview”](#overview) Chains provide continuous movement of multiple components along a defined path. This is useful for modeling material handling systems or tool changers that are driven by chains. They are always connected to a Drive component that controls the chain’s movement speed and position. Chain elements are automatically created and positioned along the spline during simulation. Tip **Recommended path definition: Unity Splines.** Add a Unity `SplineContainer` component to the same GameObject as the Chain component. This is the only path definition that receives bug fixes and performance improvements. Danger **Deprecated: legacy point-and-tangent spline.** The older custom spline system (`Spline` component with `P1..Pn` child GameObjects holding `InTangent`/`OutTangent` transforms) is no longer maintained. Existing scenes keep working, but it does not receive bug fixes — known issues include non-symmetric element placement and drift when two chains share one drive. Please migrate to a Unity `SplineContainer`. The `DemoChain` scene shows both variants side by side; `Chain_UnitySplineHorizontal` and `Chain-UnitySplineVertical` are the reference setups. Caution Simulation path functionality requires realvirtual Simulation, which is not included in the base realvirtual package. There are separate demos for this in realvirtual Simulation. You can find a demo scene at `Assets/realvirtual/Scenes/DemoChain` demonstrating chain functionality. ### Basic Concepts [Section titled “Basic Concepts”](#basic-concepts) A chain is always connected to a drive, so the movement of the chain depends on the current drive position and speed. Usually, you should use a Drive with the Axis set to Virtual to move the chain. One or several Chain Elements are connected to the chain. These Chain Elements are created automatically upon simulation start by the chain. Usually, these chain elements should be Prefabs within your project. The Chain script requires an `IChain` implementation on the same GameObject. Use the Unity `SplineContainer` (via the `ChainUnitySpline` component) to define the path. The legacy point-and-tangent spline is deprecated — see the warning at the top of this page. ## Properties [Section titled “Properties”](#properties) ### Settings [Section titled “Settings”](#settings) #### Chain Orientation [Section titled “Chain Orientation”](#chain-orientation) Determines whether the chain moves horizontally or vertically. * **Type**: Enum (Horizontal, Vertical) * **Default**: Horizontal * **Use case**: Set based on your mechanical system orientation #### Chain Element [Section titled “Chain Element”](#chain-element) Prefab used for individual chain elements along the spline. * **Type**: GameObject reference * **Default**: None * **Use case**: Assign your custom chain link or carrier prefab #### Connected Drive [Section titled “Connected Drive”](#connected-drive) Drive component that controls chain movement. * **Type**: Drive reference * **Default**: None * **Use case**: Connect to a Drive with Virtual axis for chain control #### Number of Elements [Section titled “Number of Elements”](#number-of-elements) Total number of chain elements created along the spline. * **Type**: Integer * **Default**: 10 * **Range**: 1 to 1000 * **Use case**: Adjust based on spline length and element spacing needs #### Start Position [Section titled “Start Position”](#start-position) Offset position along the spline where the first element is placed. * **Type**: Float * **Default**: 0 * **Range**: 0 to spline length * **Use case**: Adjust starting position for alignment with mechanical systems #### Calculate Delta Position [Section titled “Calculate Delta Position”](#calculate-delta-position) Automatically calculates spacing between chain elements. * **Type**: Boolean * **Default**: true * **Use case**: Enable for even distribution, disable for custom spacing #### Scaled On Fixed Length [Section titled “Scaled On Fixed Length”](#scaled-on-fixed-length) Maintains constant total spline length for external drive positioning. * **Type**: Boolean * **Default**: false * **Use case**: Enable when external drives provide positional data for elements ## Performance Optimization [Section titled “Performance Optimization”](#performance-optimization) ### Burst Compiler Optimization [Section titled “Burst Compiler Optimization”](#burst-compiler-optimization) Note This feature was added in realvirtual **6.0.9** (beta) The Chain component supports Unity’s Burst Compiler for dramatically improved performance when simulating large numbers of chain elements. This optimization uses SIMD (Single Instruction, Multiple Data) compilation to native code, providing: **Performance Benchmarks:** * **Kinematic elements** (MoveRigidBody=false): **29-33x speedup** * **Physics elements** (MoveRigidBody=true): **19-23x speedup** #### How It Works [Section titled “How It Works”](#how-it-works) Burst optimization operates in two modes depending on your chain element configuration: **Kinematic Mode (Maximum Performance)** * Uses Unity’s TransformAccessArray for parallel batch processing * Ideal for visual chain elements without physics interactions * Achieves 29-33x performance improvement * Set **MoveRigidBody=false** on ChainElements to use this mode **Physics Mode (High Performance)** * Uses traditional Rigidbody updates with Burst-compiled calculations * Required when chain elements need collider interactions * Achieves 19-23x performance improvement * Set **MoveRigidBody=true** on ChainElements for physics #### Setup Instructions [Section titled “Setup Instructions”](#setup-instructions) **One-Click Setup (Recommended)** If Burst optimization is not enabled, you’ll see a warning message in the Chain Inspector with performance information and a setup button. ![](/doc/unity/assets/chain-burst-not-enabled.png) Chain Inspector showing Burst optimization not enabled with one-click setup button 1. Click **Enable Burst Optimization (Install Package & Define)** button in the Chain Inspector 2. Unity will automatically: * Install the Burst Compiler package * Add `REALVIRTUAL_BURST` to Script Compilation Symbols * Recompile scripts with Burst optimization enabled 3. Restart Unity if prompted **Manual Setup** 1. Install Unity Burst Compiler package via Package Manager 2. Add `REALVIRTUAL_BURST` to **Project Settings > Player > Script Compilation Symbols** 3. Unity will automatically recompile with Burst optimization **After Setup** Once enabled, the Chain Inspector displays confirmation of active optimization: ![](/doc/unity/assets/chain-burst-enabled.png) Chain Inspector with Burst optimization enabled showing performance tips #### Optimizing Chain Elements [Section titled “Optimizing Chain Elements”](#optimizing-chain-elements) For maximum performance, configure your ChainElements based on their purpose: **Visual-Only Elements (Fastest)** * Set **MoveRigidBody=false** on the ChainElement component * Use for chain links, carriers, or fixtures that don’t need physics * Achieves 29-33x speedup with kinematic batch processing **Physics-Interactive Elements** * Set **MoveRigidBody=true** on the ChainElement component * Required for elements with colliders that interact with other objects * Still achieves 19-23x speedup with Burst-optimized physics updates ![](/doc/unity/assets/chainelement-performance-tip.png) ChainElement Inspector showing MoveRigidBody property with performance guidance The ChainElement Inspector provides inline performance tips to help you choose the right setting. #### Advanced Settings [Section titled “Advanced Settings”](#advanced-settings) **Spline Bake Resolution** * Controls the number of pre-calculated spline samples used by Burst jobs * Higher values = smoother interpolation but more memory usage * Default: 100 samples * Adjust based on spline complexity and available memory **Use Burst Optimization** * Enable/disable Burst processing at runtime * Defaults to enabled when REALVIRTUAL\_BURST is defined * Useful for performance comparisons or debugging #### Common Use Cases [Section titled “Common Use Cases”](#common-use-cases) **High-Speed Bucket Elevators** * Set MoveRigidBody=false on buckets for 29-33x speedup * Buckets follow path without physics interaction * Ideal for material transport visualization **Overhead Conveyors with Load Detection** * Set MoveRigidBody=true on carriers for physics-based load pickup * Still achieves 19-23x speedup while maintaining collision detection * Necessary when carriers interact with sensors or parts **Mixed Configuration** * Combine kinematic and physics elements in the same chain * Use physics only where needed (e.g., pickup/drop zones) * Optimize performance while maintaining required functionality #### Technical Details [Section titled “Technical Details”](#technical-details) Burst optimization works by: 1. Pre-calculating spline positions and tangents into native arrays 2. Batch-processing all element position updates in parallel 3. Using SIMD instructions for vectorized calculations 4. Minimizing managed-to-native transitions The system automatically handles: * Spline position interpolation * Tangent calculation for element orientation * Batch updates synchronized with drive events * Memory management for native arrays ## Usage Examples [Section titled “Usage Examples”](#usage-examples) ### Basic Chain Setup [Section titled “Basic Chain Setup”](#basic-chain-setup) 1. Create a spline path using Unity Splines or custom spline 2. Add **Chain** component to the spline GameObject 3. Add **ChainUnitySpline** component for Unity Splines integration 4. Assign **Chain Element** prefab 5. Connect to a **Drive** component with Virtual axis 6. Set **Number of Elements** based on your requirements ### Unity Splines Integration [Section titled “Unity Splines Integration”](#unity-splines-integration) We recommend using Unity Splines for the chain. To do so, the Unity Splines package must be installed. Once the Unity Splines package is installed, the chain can be defined as follows: 1. In **Project Settings > Player**, add `REALVIRTUAL_SPLINES` under Script Compilation Symbols to use Unity Splines with realvirtual chains 2. Right-click in the Hierarchy and select the desired base spline from the **Spline** menu 3. Unity provides a Spline editing mode in the Scene view for adjusting spline control points. For each spline control point, Unity also shows the up direction at the point (red arrow). This is relevant if you want to set up a vertical chain 4. Add the **ChainUnitySpline** and **Chain** components to the created GameObject Once the chain is set up, it can be used with ChainElements and drives. ### Vertical Chain Configuration [Section titled “Vertical Chain Configuration”](#vertical-chain-configuration) To construct a vertical chain, follow these steps: 1. Build the spline in the positive Z direction, starting from the bottom-right anchor point, and continue clockwise 2. Maintain a vertical angle of exactly 90 degrees. Avoid inclinations to prevent misalignment with interpolated curves representing the height difference 3. Note that these instructions are currently applicable only to splines with four anchor points and not more 4. Ensure that the front of the chain element also faces in the positive Z direction. This orientation is necessary for the parent GameObject 5. Set **Chain Orientation** to Vertical > **💡 Hint**\ > For vertical chains, use exactly four anchor points and maintain precise 90-degree angles to prevent misalignment with interpolated curves. ## Editor Tools [Section titled “Editor Tools”](#editor-tools) ### Spline Construction (deprecated) [Section titled “Spline Construction (deprecated)”](#spline-construction-deprecated) Danger This section describes the legacy point-and-tangent spline. It is no longer maintained — please use Unity Splines instead. The description is kept here as a reference for existing scenes. For extending a spline or creating a first point, you can click the **Extend** button on the Spline. This generates a Point with 2 included Tangent points. You can move these points like any GameObject to construct your spline. The order of these GameObjects also defines the order of the points in the spline. If you select **Loop**, the spline is closed and the last point is connected to the first point of the spline. ### Unity Splines Editor [Section titled “Unity Splines Editor”](#unity-splines-editor) * Visual spline editing in Scene view * Control point manipulation with handles * Up direction indicators (red arrows) for vertical chain setup * Real-time spline preview and adjustment ## See Also [Section titled “See Also”](#see-also) * [Chain Element](/doc/unity/components-and-scripts/motion/chain-element/) - Individual elements moving along the chain * [Drive](/doc/unity/components-and-scripts/motion/drive/) - Motor control for chain movement * [Spline documentation](https://docs.unity3d.com/Packages/com.unity.splines@latest) - Unity Splines package reference *** © 2025 realvirtual GmbH [https://realvirtual.io](https://realvirtual.io/) - All rights reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or by any means, including printing, saving, photocopying, recording, or other electronic or mechanical methods, without the prior written permission of the publisher. # Chain Element Chain Elements represent individual links, buckets, or carriers in continuous chain transport systems. Note **New Feature**: Burst optimization support was added in realvirtual **6.0.9** (beta). Configure **MoveRigidBody** for optimal performance based on your physics needs. ## Overview [Section titled “Overview”](#overview) Chain Elements are the individual components that move along a chain path. Each element is automatically created and managed by the parent Chain component during simulation. Chain elements can be simple visual representations or physics-enabled objects that interact with other simulation elements. Most properties are automatically calculated by the Chain component, with key configuration options for alignment and physics behavior. ## Properties [Section titled “Properties”](#properties) ### Settings [Section titled “Settings”](#settings) **Align With Chain** (boolean) controls whether the element automatically rotates to follow the chain’s tangent direction during movement. Enable this for realistic chain behavior where elements orient along the path. **Move Rigid Body** (boolean) determines whether physics simulation is enabled for the chain element. When enabled, the element’s Rigidbody is actively moved and can interact with colliders. When disabled, only the transform is updated for visual representation, providing 29-33x performance improvement with Burst optimization compared to 19-23x with physics enabled. ![](/doc/unity/assets/chainelement-performance-tip.png) ChainElement Inspector showing MoveRigidBody property with Burst optimization performance guidance **Align Vector** (Vector3) defines the local axis used as the basis for alignment calculations when Align With Chain is enabled. This vector determines which direction on the element should point along the chain tangent. **Align Object Local Z Up** (GameObject) optionally specifies a reference object whose forward direction defines the up vector for element alignment instead of using Align Vector. **Debug Directions** (boolean) enables visual debugging in the Scene view showing the tangent direction (green) and up direction (red) for troubleshooting alignment issues. **Initial Position** (float) sets the starting position of the chain element along the chain path in millimeters, configured by the Chain component during element creation. **Offset To Drive Position** (float) adds a position offset in millimeters relative to the connected drive’s position, useful for fine-tuning element placement. **Connected Chain** (Chain reference) manually links to a specific Chain component. Leave this null for automatically generated elements, which are connected by the Chain during creation. ## Performance Optimization [Section titled “Performance Optimization”](#performance-optimization) ### Burst Compiler Support [Section titled “Burst Compiler Support”](#burst-compiler-support) Chain Elements support Unity’s Burst Compiler optimization when the parent Chain has Burst enabled. Configure the **MoveRigidBody** property based on your performance and physics requirements: **Visual-Only Elements (Maximum Performance)** * Set **MoveRigidBody = false** * Elements follow the chain path without physics interaction * Achieves 29-33x speedup with Burst optimization * Use for decorative chain links, visual carriers, or non-interactive elements **Physics-Interactive Elements** * Set **MoveRigidBody = true** * Elements can collide with and move other objects * Achieves 19-23x speedup with Burst optimization * Required when elements need to push parts, trigger sensors, or interact physically The Chain Element Inspector displays performance guidance to help you choose the optimal setting for your use case. ## Common Use Cases [Section titled “Common Use Cases”](#common-use-cases) **Bucket Elevator Buckets** * Set MoveRigidBody=false for visual-only material transport * Buckets follow the elevator path without physics overhead * Maximum 29-33x performance with Burst optimization **Overhead Conveyor Carriers** * Set MoveRigidBody=true when carriers need to interact with sensors * Physics enables collision detection for load pickup/drop * Maintains 19-23x speedup while preserving functionality **Chain Links** * Set MoveRigidBody=false for decorative chain visualization * Pure visual representation without collision calculations * Optimal performance for large chain installations ## Alignment Configuration [Section titled “Alignment Configuration”](#alignment-configuration) Chain elements can align with the chain path in two modes: **Vector-Based Alignment** * Uses the **Align Vector** property to define orientation * Specify which local axis should point along the tangent * Common settings: (1,0,0) for X-axis, (0,1,0) for Y-axis **Object-Based Alignment** * Uses **Align Object Local Z Up** reference object * The referenced object’s forward direction becomes the up vector * Useful for complex orientation requirements Enable **Debug Directions** to visualize: * Green ray: Chain tangent direction (forward) * Red ray: Up direction used for alignment ![](/doc/unity/assets/chain-element.png) Chain Element component in Unity Inspector ## Integration Notes [Section titled “Integration Notes”](#integration-notes) **Automatic Creation** * Chain elements are typically created automatically by the Chain component * Number and spacing defined by Chain properties * Elements are instantiated from the prefab specified in Chain settings **Manual Placement** * For manually placed elements, assign the **Connected Chain** reference * Useful for specialized elements at specific positions * Manually placed elements coexist with auto-generated ones **Drive Synchronization** * Elements automatically synchronize with the connected drive speed * Position updates occur during drive calculations * Batch processing optimizes performance for multiple elements ## See Also [Section titled “See Also”](#see-also) * [Chain](/doc/unity/components-and-scripts/motion/chain/) - Parent component managing chain element creation and movement * [Drive](/doc/unity/components-and-scripts/motion/drive/) - Controls chain speed and position © 2025 realvirtual GmbH [https://realvirtual.io](https://realvirtual.io/) - All rights reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or by any means, including printing, saving, photocopying, recording, or other electronic or mechanical methods, without the prior written permission of the publisher. # Drive **Drives** control the movement of GameObjects along a defined axis. They are used for any moving component in the scene—except for freely moving [MUs](/doc/unity/components-and-scripts/mu-movable-unit/) (Movable Units), which are handled differently. A Drive itself does *not* provide signal interfaces for PLC communication. To enable PLC interaction, you must attach a [**DriveBehavior**](/doc/unity/components-and-scripts/motion/drive-behavior/) component to the same GameObject that contains the Drive script. This separates the motion logic from the signal interface logic, keeping the system modular and flexible. > **💡 Hint**\ > The Drive direction for a **linear axis** is always defined based on the **local coordinate system** of the GameObject the Drive is attached to.\ > For a **rotational axis**, the **origin of the local coordinate system** acts as the center of rotation, and the object rotates around the defined axis.\ > A Drive can also be connected to a **Transport Surface**—in this case, only **MUs on the Transport Surface** will be moved by the Drive. > **💡 Hint**\ > The standard units for Drive positions in all **realvirtual** components are:\ > • **Millimeters** for linear Drives\ > • **Degrees** for rotational Drives > > Corresponding speed units are:\ > • **Millimeters per second** for linear movement\ > • **Degrees per second** for rotation > > In Unity, **1 millimeter equals 1 Unity unit**, meaning that **1 meter = 1000 Unity units** in realvirtual.\ > While you can change this scaling in the [realvirtualController](/doc/unity/components-and-scripts/game4automation/), doing so is **not recommended**, as it may lead to inconsistencies in physics and interaction. [Youtube tutorial about creating a first model and adding drives](https://www.youtube-nocookie.com/embed/VoAYuNF4kRM) Youtube tutorial about creating a first model and adding drives This picture shows how two drives are connected to the axis of the handling system in the [Demo Model](/doc/unity/basics/demo-model/): ![](/doc/unity/assets/Drive-Demo.png) Drives in the Demo model In the demo cell, **Drives** are responsible for moving the different parts of the CNC machine. The motion structure is defined by the **parent-child hierarchy** of GameObjects in Unity, which establishes the **kinematic chain** of the machine. > **💡 Hint**\ > If the imported CAD data does not match the required **kinematic hierarchy**, you can use the **Kinematic** component to define a **separate motion hierarchy** that references the original CAD parts.\ > This allows you to build a clean and functional motion structure without modifying the original CAD GameObject hierarchy. The **Drive component** in the Unity Inspector includes several properties that control motion behavior and configuration. These properties are explained in detail below. ![](/doc/unity/assets/Drive.png) Drive Inspector ## Drive handles in editor mode[](#drive-handles-in-editor-mode) [Section titled “Drive handles in editor mode ”](#drive-handles-in-editor-mode) ### Modern Drive Gizmos (Updated in 6.0.3) [Section titled “Modern Drive Gizmos (Updated in 6.0.3)”](#modern-drive-gizmos-updated-in-603) When you select a Drive in the Unity Editor, enhanced visual handles and real-time feedback are displayed to help you configure and monitor drive behavior: ![Modern Drive Handles and Gizmos](/doc/unity/assets/drive-handles-modern.png) Modern Drive gizmos showing rotational handles, real-time position (137.2°), and speed display (26.5°/s) ### Interactive Handle Features [Section titled “Interactive Handle Features”](#interactive-handle-features) #### Visual Elements [Section titled “Visual Elements”](#visual-elements) * **Blue Circular Handle**: Interactive rotation control for rotational drives * **Green/Yellow Directional Arrows**: Show drive direction and movement indicators * **Real-time Position Display**: Shows current drive position (e.g., “137.2°” for rotational drives) * **Speed Indicator**: Displays current movement speed (e.g., “26.5°/s”) #### Handle Interaction [Section titled “Handle Interaction”](#handle-interaction) * **Direction Control**: Click directional arrows to change drive axis direction * **Visual Feedback**: Current direction highlighted with distinct colors * **Real-time Updates**: Position and speed values update continuously during movement * **Precision Control**: Interactive handles allow precise drive configuration ### Changing Drive Directions [Section titled “Changing Drive Directions”](#changing-drive-directions) #### Visual Direction Selection [Section titled “Visual Direction Selection”](#visual-direction-selection) * **Active Direction**: Currently selected axis shown with prominent visual indicators * **Alternative Directions**: Other available axes shown in secondary colors * **Direction Inversion**: Click the current direction arrow to invert positive/negative orientation * **Axis Switching**: Click alternative direction arrows to change drive axis ### Linear Drive Handles [Section titled “Linear Drive Handles”](#linear-drive-handles) For linear drives, the modern gizmo system displays directional arrows for all three axes: ![Linear Drive Handles](/doc/unity/assets/drive-handles-linear-modern.png) Linear drive handles showing X (red), Y (green), and Z (blue) directional arrows for precise axis selection #### Linear Drive Features [Section titled “Linear Drive Features”](#linear-drive-features) * **Color-Coded Axes**: Red (X), Green (Y), Blue (Z) following Unity’s standard color scheme * **Direction Arrows**: Clear visual indicators for each possible movement direction * **Axis Selection**: Click any arrow to set the drive’s primary movement axis * **Visual Clarity**: Clean, modern appearance integrated with Unity’s gizmo system #### Gizmo Visibility Settings [Section titled “Gizmo Visibility Settings”](#gizmo-visibility-settings) Drive handles are only displayed if the **Drive Gizmo** is enabled in Unity’s gizmo settings. You can control gizmo visibility through Unity’s Preferences: ![Drive Gizmo Settings](/doc/unity/assets/drive-gizmo-settings.png) Unity Preferences showing Drive gizmo visibility controls in the Scripts section **Gizmo Controls:** * **Drive Gizmo Toggle**: Enable/disable drive handle visibility globally * **Icon Display**: Show/hide drive component icons in Scene view * **Recently Changed**: Quick access to recently modified gizmo settings * **Per-Component Control**: Individual visibility settings for different drive types Note Alternatively you can change the drive directions with hotkeys. By pressing on **SPACE** you invert the direction of the currently selected Drive.\ By pressing **TAB** you iterate through all 6 possible directions (3 linear and 3 rotational). ### Drive limits[](#drive-limits) [Section titled “Drive limits ”](#drive-limits) You can define upper and lower limits for drives. These limits are only used when driving the drive with the **Jog Forward** and **Jog Backward** signals. The modern limit display shows precise values and visual indicators: ![Modern Drive Limits Display](/doc/unity/assets/drive-limits-modern.png) Modern drive limits showing lower limit (-500 mm) and upper limit (1000 mm) with directional handles #### Modern Limit Display Features [Section titled “Modern Limit Display Features”](#modern-limit-display-features) * **Precise Value Display**: Shows exact limit values (e.g., “-500 mm” for lower, “1000 mm” for upper) * **Visual Range Indicators**: Clear visual representation of the allowable movement range * **Integration with Handles**: Limit display works seamlessly with directional handle system * **Real-time Updates**: Limit values update immediately when changed in the Inspector #### Limit Behavior [Section titled “Limit Behavior”](#limit-behavior) For linear axes, the limits define the exact positions where the drive will stop when using jog commands. The drive can only move within the defined range between the lower and upper limits. For rotational axes, the limit is displayed by a trimmed circle. The drive can only rotate in the white area. #### Practical Usage Example [Section titled “Practical Usage Example”](#practical-usage-example) When setting up a linear conveyor, you might configure: * **Lower Limit**: 0 mm (start position) * **Upper Limit**: 2000 mm (end of conveyor) This prevents the drive from moving beyond the physical conveyor length during jog operations. > **💡 Hint**\ > Avoid using **position limits** on Drives that are connected to a **motion or robot controller**.\ > These controllers usually handle motion constraints internally. Enabling limits in this case might **hide incorrect target positions**, making it harder to detect configuration or control errors. ## Troubleshooting [Section titled “Troubleshooting”](#troubleshooting) ### Drive Not Moving [Section titled “Drive Not Moving”](#drive-not-moving) * **Check Active Setting**: Ensure “Active” is set to “Always” or appropriate condition * **Verify Target Speed**: Confirm Target Speed > 0 for movement * **Limit Conflicts**: Check if limits are preventing movement * **Drive Behavior**: Ensure proper DriveBehavior is attached for PLC control ### Jerky or Erratic Motion [Section titled “Jerky or Erratic Motion”](#jerky-or-erratic-motion) * **Enable Acceleration**: Turn on “Use Acceleration” for smoother starts/stops * **Acceleration Values**: Set appropriate acceleration values (typically 10-50% of target speed) * **Speed Override**: Check if global speed override is affecting motion * **Physics Issues**: Verify proper collision detection and Rigidbody settings ### Performance Issues [Section titled “Performance Issues”](#performance-issues) * **Multiple Drives**: For many drives, consider using Drive Behaviors for optimized control * **Complex Hierarchies**: Use Kinematic component for complex motion chains * **Update Frequency**: Check FixedUpdate frequency for smooth motion > ⚠️ **Attention**\ > **Jogging with acceleration** and **Drive limits** is currently **not supported**.\ > If you enable both features, the Drive behavior may not function as expected. ## Drive handles in simulation mode[](#drive-handles-in-simulation-mode) [Section titled “Drive handles in simulation mode ”](#drive-handles-in-simulation-mode) During Play Mode, drive handles provide real-time monitoring and manual control capabilities. The modern interface displays live position and speed information directly in the Scene view: ![Drive Handles in Simulation Mode](/doc/unity/assets/drive-handles-simulation-mode.png) Drive handles during simulation showing real-time position (-327.8 mm), speed (620.0 mm/s), and QuickEdit integration ### Real-Time Display Features [Section titled “Real-Time Display Features”](#real-time-display-features) * **Live Position Display**: Shows current drive position floating near the drive (e.g., “-327.8 mm”) * **Speed Monitoring**: Displays current movement speed (e.g., “620.0 mm/s”) during motion * **QuickEdit Integration**: Drive selection and control through the realvirtual QuickEdit panel * **Visual Feedback**: Clear identification of active drives with highlighted information ### Manual Control During Simulation [Section titled “Manual Control During Simulation”](#manual-control-during-simulation) * **Direction Control**: Cannot change drive directions (set in Edit Mode) * **Jog Mode**: Use QuickEdit controls or handles to manually jog drives * **Limit Respect**: Manual jogging respects defined drive limits * **Real-time Updates**: Position and speed values update continuously ### Alternative Control Methods [Section titled “Alternative Control Methods”](#alternative-control-methods) **Keyboard Shortcuts:** * **Key 1**: Move drive in negative direction * **Key 3**: Move drive in positive direction **QuickEdit Panel:** * **Back/Forward buttons**: Manual jog control for selected drive * **Target Speed**: Adjust movement speed in real-time * **Drive Selection**: Shows active drive name (e.g., “GantryZ”) ### Rotational Drive Simulation [Section titled “Rotational Drive Simulation”](#rotational-drive-simulation) For rotational drives, the simulation interface provides specialized circular gizmos and angular position display: ![Rotational Drive in Simulation Mode](/doc/unity/assets/drive-rotational-simulation-mode.png) Rotational drive during simulation showing circular rotation gizmo, real-time angle display (0.0°), and Axis1 drive control **Rotational Features:** * **Circular Rotation Gizmo**: Blue circular handle indicating rotation axis and range * **Angular Position Display**: Real-time angle shown in degrees (e.g., “0.0°”) * **Direction Indicators**: Color-coded arrows showing rotation directions * **Axis Identification**: Drive name displayed in QuickEdit (e.g., “Axis1”) * **Precise Control**: Manual rotation control through handles or QuickEdit interface ## Drives and Unity Physics [Section titled “Drives and Unity Physics”](#drives-and-unity-physics) By default, **linear** and **rotational Drives** operate **without using Unity’s PhysX Rigidbody system**. This approach is generally **more stable and predictable**, especially for automation and simulation scenarios. In some cases, however—such as when interacting with physical objects or colliders—it may be necessary to move the **Rigidbody** component directly. To do this, you must enable the **“Move This Rigid Body”** option in the Drive component. > **💡 Hint**\ > Only enable **“Move This Rigid Body”** if you explicitly need Drive motion to affect Unity physics.\ > In most use cases, this setting should remain **disabled** to ensure optimal simulation stability and performance. ![](/doc/unity/assets/drive_moverigidbody.png) ## Drive properties[](#public-properties-and-methods) [Section titled “Drive properties ”](#drive-properties) ### Settings [Section titled “Settings”](#settings) * **Active**: Defines whether the Drive is active. Usually this should be set to Always. For more information please check **ConnectionStatus** in [Runtime UI](/doc/unity/basics/runtime-ui/) * **Direction**: Selects the movement axis. Choose from linear (`X`, `Y`, `Z`) or rotational (`Rotation X`, `Rotation Y`, `Rotation Z`). Movement is always defined in the local coordinate system. * **Reverse Direction**: Inverts the movement direction along the selected axis. * **Offset**: Applies an offset to the Drive’s position. This value is **added to the internal position** during simulation.\ For example, if the `Offset` is set to **100** and the `Current Position` is **50**, the resulting position in the simulation is **150**.\ This is useful when aligning Drive values with external systems, such as PLCs, where a consistent value shift is required for coordination. * **Start Position**: The Drive’s starting position when the scene starts or the Drive is reset. * **Speed Override**: Multiplies the base speed to dynamically adjust how fast the Drive moves. * **Speed Scale Transport Surface**: Scales the speed if connected to a Transport Surface (default: 1). * **Move This Rigid Body**: Enables the Drive to move the attached Rigidbody (not recommended unless Unity physics interaction is required). * **Transport Surfaces**: Allows linking [Transport Surfaces](/doc/unity/components-and-scripts/motion/transportsurface/) to the Drive. Only [MUs](/doc/unity/components-and-scripts/mu-movable-unit/) on linked surfaces are moved. ### Drive IOs [Section titled “Drive IOs”](#drive-ios) The **Drive IOs** section contains input and output fields that allow you to interact with the Drive during simulation. * **Jog Forward**\ Boolean input to jog the Drive forward as long as the signal is active.\ Uses the set **Target Speed** without acceleration smoothing. * **Jog Backward**\ Boolean input to jog the Drive in the opposite direction.\ Also uses **Target Speed** and ignores acceleration settings. * **Target Position**\ A numeric input defining the desired position (in millimeters or degrees) that the Drive should move to.\ Can be controlled via script or PLC. * **Target Speed**\ Defines the maximum speed the Drive can reach when moving toward the **Target Position**.\ Value is in mm/s (for linear) or deg/s (for rotational). * **Target Start Move**\ Boolean input signal to start the move toward the **Target Position** using the defined **Target Speed**.\ Only starts the motion; does not affect target value. * **Reset Drive**\ Resets the Drive position to the configured **Start Position**.\ Can be triggered manually or via a PLC signal. * **Stop Drive**\ Immediately stops the Drive’s motion, overriding current target or jogging input. * **Is At Upper Limit**\ Boolean output indicating whether the Drive has reached its defined **Upper Limit** (if limits are enabled). > **💡 Hint**\ > The **Drive IOs** can be accessed and controlled via **custom scripts**, making them flexible for user-defined behaviors.\ > In most cases, they are used by [**Behavior components**](/doc/unity/components-and-scripts/motion/drive-behavior/) which handle the connection between the Drive and external systems such as **PLC signals**.\ > This setup separates physical motion from control logic, allowing clean integration with automation environments. ### Limits [Section titled “Limits”](#limits) The **Limits** section allows you to define positional constraints for the Drive. These are useful for preventing movements beyond mechanical boundaries or for guiding logic in manual or automated scenarios. * **Use Limits**\ Enables or disables the use of movement boundaries. When enabled, the Drive will be restricted to the range defined by the **Lower Limit** and **Upper Limit**. * **Lower Limit / Upper Limit**\ Define the minimum and maximum allowed positions for the Drive.\ Values are in millimeters (for linear Drives) or degrees (for rotational Drives). * **Jump to Lower Limit on Upper Limit**\ If enabled, once the Drive reaches the **Upper Limit**, it immediately jumps to the **Lower Limit** and continues motion.\ This is useful for circular or rotary indexing systems, e.g., turntables. * **Limit Ray Cast**\ Optional field for assigning a **sensor GameObject** (typically a virtual proximity sensor).\ This allows detection of the limit not only by position but also via **raycast-based sensor feedback**. > **💡 Hint**\ > Avoid enabling **Limits** when the Drive is controlled by an external **motion or robot controller**.\ > The controller may send positions outside the defined range, and the limits could silently clip or block the motion—making it harder to detect misconfiguration or errors. ### Acceleration [Section titled “Acceleration”](#acceleration) The **Acceleration** section allows you to simulate smooth motion profiles by controlling how the Drive accelerates and decelerates. * **Use Acceleration**\ Enables acceleration-based motion. When disabled, the Drive moves at constant speed directly toward the target. * **Smooth Acceleration (only Professional Version)**\ Activates smoothing of acceleration and deceleration using a jerk-controlled motion profile.\ This results in more realistic movement, particularly for robotics and high-speed systems. * **Acceleration**\ Maximum allowed acceleration in mm/s² (linear) or deg/s² (rotational).\ This value defines how quickly the Drive can ramp up or down in speed. * **Jerk (only Professional Version)**\ Maximum rate of change in acceleration (mm/s³ or deg/s³).\ Helps to create **soft starts and stops** by avoiding abrupt changes in force or torque. > **💡 Hint**\ > Avoid using acceleration together with **Jogging**, as they are not compatible. ### Smooth Motion (only Professional Version) [Section titled “Smooth Motion (only Professional Version)”](#smooth-motion-only-professional-version) The **Smooth Motion** section is available exclusively in the **Professional edition** of realvirtual.io. It provides detailed visualization and control of the motion profile calculated for the Drive based on the configured **Acceleration** and **Jerk** settings. ![](/doc/unity/assets/Drive-SmoothMotion.png) Smooth Motion Inspector properties ![](/doc/unity/assets/E0784F5bYZ.png) Smooth motion - velocity detail view **Profile** This subsection visualizes the generated motion curves for the current move: * **Position** – The Drive’s motion over time. * **Velocity** – The rate of change of position. * **Acceleration** – The rate of change of velocity. * **Jerk** – The rate of change of acceleration. * **Duration** – Total time (in seconds) required to complete the current motion based on the active profile. These curves are generated in real time and give insights into how the Drive will behave during its movement. 🔗 For more information about **jerk** in physics, see: **State** * **Position / Velocity / Acceleration** – The current state of the Drive in simulation time. **Target State** * **Position / Velocity / Acceleration** – The values the Drive is targeting. These update based on user input or external control signals. ### Drive Status [Section titled “Drive Status”](#drive-status) The **Drive Status** section provides real-time diagnostic information about the current motion and condition of the Drive. These values are continuously updated during simulation and are useful for debugging, monitoring, and interfacing with automation systems. **Fields** * **Current Speed**\ Displays the Drive’s current speed in mm/s (linear) or deg/s (rotational). * **Current Position**\ The current absolute position of the Drive, including offset and any external overrides. * **Position Overwrite Value**\ Shows a temporary value applied when overriding the position manually or via external control logic. * **Is Position**\ Displays the final calculated position of the Drive after applying offset and override. This is the effective position used in simulation. * **Is Stopped**\ True if the Drive is currently not moving and not jogging. * **Is Running**\ True while the Drive is in motion, either toward a target position or while jogging. * **Is At Target Speed**\ Indicates whether the Drive has reached the defined **Target Speed**. * **Is At Target**\ True when the current position equals (within tolerance) the **Target Position**. * **Is At Lower Limit**\ True when the Drive has reached or exceeded the defined **Lower Limit** (if limits are enabled). * **Is Sub Drive**\ Marks whether this Drive is being controlled as a sub-drive in a more complex motion chain (e.g., a multi-axis system). ### Drive Events [Section titled “Drive Events”](#drive-events) The **Drive Events** section provides Unity Events that are triggered at specific points during the Drive’s simulation cycle. These are intended for **expert users** who want to attach **custom logic** directly to the Drive’s behavior. **Available Events** * **On Before Drive Calculation (Drive)**\ Called **before** the Drive calculates its movement each frame.\ This is useful for injecting custom control logic or modifying inputs before the Drive updates. * **On After Drive Calculation (Drive)**\ Called **after** the Drive completes its motion logic for the frame.\ Useful for monitoring state, triggering custom events, or applying additional logic. > **💡 Hint**\ > **Drive Events** are intended for advanced users who need **low-level access** to the Drive’s behavior.\ > For typical applications and PLC connections, it is recommended to use **Behavior components** such as `DriveBehavior`. > 🔗 For more information about the Drive update cycle, please refer to **Section: Motion for Developers** in this documentation. Please check the [Realvirtual.io Class Reference](https://realvirtual.io/apidoc/classrealvirtual_1_1_drive.html) for more information about the properties and methods of this component. © 2025 realvirtual GmbH [https://realvirtual.io](https://realvirtual.io/) - All rights reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or by any means, including printing, saving, photocopying, recording, or other electronic or mechanical methods, without the prior written permission of the publisher. # Drive behavior The Drive Behavior provides a detailed behavior to a [Drive](/doc/unity/components-and-scripts/motion/drive/). This gives the flexibility to model all variety of ways to move objects. In realvirtual.io a few standard Drive Behaviors are included and you can extend them based on the components you are using in real life.\ Here is a list of the included Drive Behaviors. All Drive Behaviors are named with a prefix *Drive\_* from better clarification. Note The generic drive behaviors (Cylinder, Simple, Destination Motor, Follow Position, Gear, Continuous Destination, Speed, …) are part of every realvirtual edition. The detailed drive-profile / fieldbus behavior models that mirror the exact control-word / status-word interface of a real drive - PROFIdrive (Speed / Pos), CiA 402, Festo FHPP, SEW MOVILINK, UniDrive and the proportional valve - are part of realvirtual **Professional**. ## Adding Drive Behaviors [Section titled “Adding Drive Behaviors”](#adding-drive-behaviors) Drive behaviors can be added to a GameObject with a Drive component in two ways: 1. **Add Component Menu**: Select the GameObject with the Drive component, then use *Component > realvirtual > Motion > Drive Behaviors* to choose the desired behavior 2. **QuickEdit Overlay** (Professional): Use the QuickEdit overlay buttons to quickly add drive behaviors directly in the Scene view ![](/doc/unity/assets/quickedit-drivebehaviors-2025.png) QuickEdit overlay showing drive behavior buttons for quick access This tutorial explains the relation between Signals and Behavior Models: [Video](https://www.youtube-nocookie.com/embed/sCKEi-6EKYQ) ### Drive\_Cylinder [Section titled “Drive\_Cylinder”](#drive_cylinder) This is the model of a simple cylinder movement. The cylinder is defined by a maximum (*MaxPos*) and minimum (*MinPos*) position in millimeters in relation to a zero position. The speed of the cylinder to move in and out is defined by the time in seconds *TimeOut* and *TimeIn*. **Settings:** * **One Bit Cylinder**: When enabled, uses single signal for control. Out=false moves cylinder in, Out=true moves cylinder out. * **Invert Output Logic** (new in 6.0.9-beta): Inverts the control logic. When enabled, Out=false extends the cylinder, Out=true retracts it. Useful for normally-closed valve configurations or inverted signal requirements. * **Min Pos / Max Pos**: Define the cylinder stroke in millimeters. * **Time Out / Time In**: Extension and retraction times in seconds. * **Stop When Driving To Min/Max**: Optional sensors to stop the cylinder before reaching end positions. The cylinder can be controlled manually by setting the booleans under *Behavior Signals*. Under *PLC IOs* PLC signals can be connected to the cylinder. ![](/doc/unity/assets/drive-cylinder-2025.png) ### Drive\_Simple[](#drive-simple) [Section titled “Drive\_Simple ”](#drive_simple) The Simple Drive is controlled by boolean values for forward and backward movement with configurable speed and acceleration. **Settings:** * **Scale Speed**: Scale factor for input/output speed and acceleration values * **Current Position Scale** (new in 6.0.9-beta): Scale factor for position feedback transformation * **Current Position Offset** (new in 6.0.9-beta): Offset in millimeters applied to position feedback * **Scale Feedback Position** (new in 6.0.9-beta): When enabled (default), applies scale and offset to position feedback. Disable to receive raw position values. The scale and offset enable symmetric transformations for proper closed-loop control: position feedback uses the inverse transformation of position commands. ![](/doc/unity/assets/drive-simple-2025.png) ### Drive\_DestinationMotor [Section titled “Drive\_DestinationMotor”](#drive_destinationmotor) The Destination Motor is a drive controlled by target positions and target speeds. After setting the target speed and target position, the movement can be started by a boolean Signal *StartDrive*. After the drive reaches its target position the Signal *IsAtDestination* is set high. This is a **generic** positioning model with simple boolean and value signals. If you need to mirror the exact control-word / status-word interface of a real positioning drive, use one of the dedicated behaviors instead - see [Drive\_UniDriveMotor](#drive-unidrivemotor) (generic control-word / status-word positioning controller), [Drive\_ProfidriveSpeed](#drive-profidrivespeed) and [Drive\_ProfidrivePos](#drive-profidrivepos) (Siemens PROFIdrive). **Scale/Offset Properties** (new in 6.0.9-beta): * **Current Position Scale**: Scale factor applied to both position commands and feedback * **Current Position Offset**: Offset in millimeters applied to both position commands and feedback * **Scale Feedback Position**: When enabled (default), applies symmetric scale/offset transformations for proper closed-loop control ![](/doc/unity/assets/drive-destinationmotor-2025.png) ### Drive\_FollowPosition[](#drive-followposition) [Section titled “Drive\_FollowPosition ”](#drive_followposition) This is the behavior model of a drive where the drive exactly follows the current provided position of the PLC. This is especially useful for connecting motion controllers and robot controllers to realvirtual. **Settings:** * **Offset**: Position offset in millimeters added to input signal * **Scale**: Scale factor applied to position input signal * **Current Position Scale** (new in 6.0.9-beta): Additional scale factor for position feedback * **Scale Feedback Position** (new in 6.0.9-beta): When enabled (default), applies symmetric transformation: feedback = ((CurrentPosition - Offset) / Scale) \* CurrentPositionScale The symmetric transformation ensures that the PLC receives properly scaled feedback values that match the coordinate system of the commanded positions. ![](/doc/unity/assets/drive-followposition-2025.png) ### Drive\_Gear[](#drive-gear) [Section titled “Drive\_Gear ”](#drive_gear) This behavior model is useful for connecting two drives together. The master drive will control the position of the drive that the gear is attached to. This is useful for two gripper fingers where only one is controlled by a pneumatic model and the second one follows correspondingly. The formula for the position of a gear controlled drive is: *CurrentPosition = MasterDrive.CurrentPosition x GearFactor + Offset*. ![](/doc/unity/assets/motion-gear.png) ### Drive\_ContinousDestination[](#drive-continousdestination) [Section titled “Drive\_ContinousDestination ”](#drive_continousdestination) This drive is continuously trying to follow the given destination with the given speed. Unlike *Drive\_FollowPosition*, this Drive is not following exactly the given position because it might need some time to reach the destination. You don’t need to set a start signal to start to drive like with *Drive\_DestinationMotor*. This drive is always starting to drive to a different destination as soon as the SignalDestination is changed. Please note, that you need to turn on *UseAccelearation* in the connected drive to use acceleration values.\ This Drive is specially useful for users who are reusing Simit models which are connected to NX Mechatronics Concept Designer. In NX Mechatronics Concept Designer this type of Drive is called *PositionControl*. **Scale/Offset Properties** (new in 6.0.9-beta): * **Current Position Scale**: Scale factor applied to both position commands and feedback * **Current Position Offset**: Offset in millimeters applied to both position commands and feedback * **Scale Feedback Position**: When enabled (default), applies symmetric scale/offset transformations ![](/doc/unity/assets/drive-continousdestination-2025.png) ### Drive\_Speed[](#drive-speed) [Section titled “Drive\_Speed ”](#drive_speed) Drive\_Speed is controlling a drive by a speed. You can’t control directly the position. The drive is always driving in the given speed. Positive speed values means forward direction. Negative speed values means backward direction. Please note, that the smooth acceleration is not working with this drive. If you want to stop the drive the speed needs to be set to zero.\ This Drive is specially useful for users who are reusing Simit models which are connected to NX Mechatronics Concept Designer. In NX Mechatronics Concept Designer this type of Drive is called *SpeedControl*. **Position Feedback Properties** (new in 6.0.9-beta): * **Current Position Scale**: Scale factor for position feedback transformation * **Current Position Offset**: Offset in millimeters applied to position feedback * **Scale Feedback Position**: When enabled (default), applies scale and offset to position feedback. Disable to receive raw position values. ![](/doc/unity/assets/drive-speed-2025.png) ### Drive\_ErraticPosition[](#drive-erraticposition) [Section titled “Drive\_ErraticPosition ”](#drive_erraticposition) This drive is only for test purposes. It is moves constantly to random positions between MinPos and MaxPos. ![](/doc/unity/assets/drive-erraticposition-2025.png) ### Drive\_Sequence[](#drive-sequence) [Section titled “Drive\_Sequence ”](#drive_sequence) We recommend to not use DriveSequence any more and to use the new LogicStep visual programming which is simpler and gives you more flexibility. Please check [LogicSteps](/doc/unity/components-and-scripts/defining-logic/logicsteps/). #### Starting a sequence step[](#starting-a-sequence-step) [Section titled “Starting a sequence step ”](#starting-a-sequence-step) The Drive\_Sequence behavior allows to define simple sequences of motions. Each step in the sequence can set the Drive speed and the Drive Destination.\ The step is starting automatically after the step before. If a PLCSignal is defined in *Wait For Signal* the Step is not started before the Signal is set to true. #### Ending a sequence step [Section titled “Ending a sequence step”](#ending-a-sequence-step) In *Wait After Step* a time in seconds can be defined which should be waited after the drive is at its destination and before the next step is started. The *Finished Signal* is optionally and can be used to start external processes or Drive\_Sequences. This signal is set to true as soon as the step is finished ![](/doc/unity/assets/drivebehavior_sequence.png) ### Drive\_UniDriveMotor (Pro, Beta)[](#drive-unidrivemotor) [Section titled “Drive\_UniDriveMotor (Pro, Beta) ”](#drive_unidrivemotor-pro-beta) Caution This behavior is part of realvirtual **Professional**, was added in realvirtual **6.3.4** and is currently in **beta**. The API and properties may still change. Drive\_UniDriveMotor maps a UniDrive-style positioning controller onto a Drive, mirroring the typical control-word / status-word signal set of a parameterizable positioning drive. It combines a general release, a positioning start with integer setpoints (position, speed, acceleration and deceleration ramp) and manual jog bits with a setup/manual speed selection. Drive feedback (ready, referenced, in-position, actual position and actual speed) is written back to the PLC. This behavior is useful when connecting realvirtual to PLC blocks that drive a positioning axis through integer setpoints rather than physical units. Setpoints are transferred as integers and converted to the Drive’s millimeter / degree units through the scaling properties. Signal directions follow the realvirtual PLC convention: PLC outputs are commands read by the behavior, PLC inputs are feedback written back to the PLC. **Scaling:** * **Position Scale**: Scale factor between integer position units (PLC) and millimeters / degrees (Drive). * **Position Offset**: Offset applied to position command and feedback in millimeters / degrees. * **Speed Scale**: Scale factor between integer speed units and mm/s. * **Acceleration Scale**: Scale factor between integer acceleration units and mm/s². **Jog:** * **Setup Speed**: Reduced jog speed in mm/s used when *Speed Selection* is false (setup / teach speed). **Status (Inspector controlled):** * **Ready**: Drive ready feedback (Betriebsbereit). Uncheck to simulate a not-ready drive. * **Referenced**: Encoder referenced feedback (Referenzieren OK). Uncheck to simulate a not-referenced drive. **PLC Outputs (commands from PLC):** * **Run**: General release of the drive. While low the drive is held stopped at its current position. * **Jog Plus / Jog Minus**: Manual jog forward / backward. Forward has priority if both bits are set. * **Speed Selection**: Jog speed selection - false uses *Setup Speed*, true uses the commanded *Set Speed*. * **Start Positioning**: Rising edge triggers a move to *Set Position* using *Set Speed* and *Set Acceleration*. * **Set Position / Set Speed / Set Acceleration / Set Deceleration**: Integer setpoints, converted with the scaling properties. * **Start Calibration / Reset Fault**: Present for interface completeness; signal only, no effect in the simulation. **PLC Inputs (feedback to PLC):** * **Is Ready / Is Referenced**: Driven by the *Ready* and *Referenced* settings. * **Is At Position 1**: True when the commanded position has been reached (and the drive is not jogging away from it). * **Actual Position / Actual Speed**: Current drive position and speed in integer units. Note The underlying Drive uses a single symmetric ramp for accelerating and braking. *Set Acceleration* drives the Drive acceleration; *Set Deceleration* is read and exposed (see the *Status* foldout) for transparency, but the drive brakes with the same ramp. Enable *Use Acceleration* on the Drive to apply the ramps. The screenshot below shows the behavior as an example of a concrete drive implementation, mapping the control-word / status-word signals of a real positioning controller onto a Drive. ![](/doc/unity/assets/drive-unidrivemotor-2025.png) Drive\_UniDriveMotor as an example of a concrete drive implementation ### Drive\_ProfidriveSpeed (Pro, Beta)[](#drive-profidrivespeed) [Section titled “Drive\_ProfidriveSpeed (Pro, Beta) ”](#drive_profidrivespeed-pro-beta) Caution This behavior is part of realvirtual **Professional**, was added in realvirtual **6.3.4** and is currently in **beta**. The API and properties may still change. Drive\_ProfidriveSpeed models a PROFIdrive speed-controlled drive (Siemens SINAMICS G120, S120, V90, …) using **standard telegram 1**. The PLC sends the control word **STW1** plus the normalized speed setpoint **NSOLL\_A**, and the drive returns the status word **ZSW1** plus the actual speed **NIST\_A**. The behavior runs the PROFIdrive state machine, so the drive only moves once the PLC has correctly enabled it - exactly like a real SINAMICS drive. This makes it possible to test the complete PLC enable sequence (ON/OFF1, OFF2, OFF3, enable operation, enable setpoint) against a realistic drive, without SIMIT or real hardware. **Setpoint normalization:** `NSOLL_A = 0x4000 (16384) = 100 %` of the reference speed (drive parameter p2000). Negative values reverse the direction. The actual speed is reported back with the same normalization. **Scaling:** * **Reference Speed**: Drive speed in mm/s (or °/s) at the full-scale setpoint (100 %). Corresponds to the drive reference speed p2000. * **Setpoint Scale**: Raw setpoint value that equals 100 %. Leave at 16384 (0x4000) for Siemens PROFIdrive NSOLL\_A. Set to 20000 to drive an **ABB** axis: the ABB Drives communication profile uses the same OFF1/OFF2/OFF3/Run/Reset state machine as PROFIdrive, only the reference REF1 is scaled to 20000 = 100 %. * **Acceleration**: Drive acceleration in mm/s² (or °/s²). Enable *Use Acceleration* on the Drive for a ramped speed follow. **Drive Status (Inspector controlled):** * **Simulate Fault**: Forces a drive fault (ZSW1.3). The PLC must acknowledge with STW1.7 (rising edge) to clear it. * **Simulate Warning**: Forces a drive warning (ZSW1.7). **PLC Outputs (commands from PLC):** * **Control Word**: PROFIdrive control word STW1. * **Speed Setpoint**: Normalized speed setpoint NSOLL\_A. **PLC Inputs (feedback to PLC):** * **Status Word**: PROFIdrive status word ZSW1. * **Speed Actual**: Normalized actual speed NIST\_A. The control word STW1 bits are interpreted as follows: bit 0 ON/OFF1, bit 1 OFF2 (1 = no coast stop), bit 2 OFF3 (1 = no quick stop), bit 3 enable operation, bit 4 enable ramp-function generator, bit 5 continue ramp-function generator, bit 6 enable setpoint, bit 7 acknowledge fault, bit 10 control by PLC, bit 11 setpoint inversion. The decoded bits and the current state machine state are shown read-only in the Inspector for transparent commissioning. ![](/doc/unity/assets/drive-profidrivespeed-2025.png) Drive\_ProfidriveSpeed with control word STW1 / status word ZSW1 and the decoded STW1 bits ### Drive\_ProfidrivePos (Pro, Beta)[](#drive-profidrivepos) [Section titled “Drive\_ProfidrivePos (Pro, Beta) ”](#drive_profidrivepos-pro-beta) Caution This behavior is part of realvirtual **Professional**, was added in realvirtual **6.3.4** and is currently in **beta**. The API and properties may still change. Drive\_ProfidrivePos models a PROFIdrive basic positioner (Siemens SINAMICS **EPOS**) controlled through the **raw telegram 111 process data**, exactly as it appears in the PLC I/O area when realvirtual stands in for the drive. The PLC sends the control words **STW1**, **POS\_STW1**, **POS\_STW2**, the velocity override and the MDI setpoints (target position, velocity); the drive returns the status words **ZSW1**, **POS\_ZSW1**, **POS\_ZSW2** plus the actual position **XIST\_A** and actual speed **NIST\_B**. The behavior decodes the control word bits, runs the PROFIdrive state machine and performs the MDI (direct setpoint) positioning - bit-for-bit identical to a real S120 / G120 / V90 axis. This is the I/O-level (E/A) counterpart of the Siemens **SINA\_POS (FB284)** function block: SINA\_POS runs inside the PLC and packs / unpacks these telegram words, while this component models the drive side of the same telegram. The exact bit layout follows the SINAMICS function manuals (S120 / G120 / V90) and the SIMIT EPOS behavior library. **Supported MDI operations** (MDI mode, POS\_STW1.15 = 1): * **Absolute / relative positioning** (POS\_STW1.8) started by the rising edge of STW1.6 (activate traversing task) * **Setup mode** / endless travel at velocity (POS\_STW1.14) in the selected direction (POS\_STW1.9 / .10) * **Jogging** via STW1.8 / STW1.9 (jog 1 / jog 2) * **Homing** via STW1.11 and **set reference point** via POS\_STW2.1 (both mark the axis as referenced) Traversing-block mode (POS\_STW1.15 = 0) is not modeled, since block coordinates are drive parameters and not part of the telegram. The STW2/ZSW2 sign-of-life, MELDW and the fault/warning code words are not modeled. **Scaling:** * **Position Scale**: Drive millimeters / degrees per length unit (LU), used for MDI\_TARPOS and XIST\_A. * **Position Offset**: Offset in millimeters / degrees applied to position command and feedback. * **Velocity Scale**: Drive speed in mm/s per MDI\_VELOCITY unit (MDI\_VELOCITY is given in 1000 LU/min). * **Reference Speed**: Drive speed at NIST\_B = 0x40000000 (100 %), corresponds to reference speed p2000. * **Jog Speed**: Drive speed in mm/s used for jog mode (STW1.8 / STW1.9). * **Acceleration**: Drive acceleration in mm/s² (or °/s²) at 100 % override. **Drive Status (Inspector controlled):** * **Simulate Fault**: Forces a drive fault (ZSW1.3). The PLC must acknowledge with STW1.7 (rising edge) to clear it. * **Simulate Warning**: Forces a drive warning (ZSW1.7). **PLC Outputs (telegram 111 send words - commands from PLC):** * **Control Word**: STW1 (PZD1) - ON/OFF1, OFF2, OFF3, enable operation, reject/intermediate-stop, activate traversing task (edge), acknowledge fault, jog 1/2, control by PLC, start homing. * **Pos Control Word 1**: POS\_STW1 (PZD2) - MDI mode select (.15), absolute/relative (.8), direction (.9/.10), setup (.14), transfer type (.12). * **Pos Control Word 2**: POS\_STW2 (PZD3) - set reference point (.1), incremental jog (.5). * **Override**: OVERRIDE (PZD5), velocity override with 0x4000 = 100 %. * **Mdi Target Position**: MDI\_TARPOS (PZD6+7), target position in length units (LU). * **Mdi Velocity**: MDI\_VELOCITY (PZD8+9), velocity in 1000 LU/min. **PLC Inputs (telegram 111 receive words - feedback to PLC):** * **Status Word**: ZSW1 (PZD1) - ready / operation / inhibit / fault / warning / target reached / reference set / standstill / accelerating / decelerating. * **Pos Status Word 1**: POS\_ZSW1 (PZD2). * **Pos Status Word 2**: POS\_ZSW2 (PZD3) - axis forward (.4) / backward (.5) / traversing command active (.15). * **Position Actual**: XIST\_A (PZD6+7), actual position in LU. * **Speed Actual**: NIST\_B (PZD8+9), actual speed with 0x40000000 = 100 % of reference speed. The decoded STW1 / POS\_STW1 / POS\_STW2 control bits and the ZSW1 status bits are shown read-only in the Inspector for transparent commissioning. ![](/doc/unity/assets/drive-profidrivepos-2025.png) Drive\_ProfidrivePos with the raw telegram 111 control / status words and decoded bits ### Drive\_ProportionalValve (Pro, Beta)[](#drive-proportionalvalve) [Section titled “Drive\_ProportionalValve (Pro, Beta) ”](#drive_proportionalvalve-pro-beta) Caution This behavior is part of realvirtual **Professional**, was added in realvirtual **6.3.4** and is currently in **beta**. The API and properties may still change. Drive\_ProportionalValve models a hydraulic (or electric) proportional directional valve that controls a Drive. It converts an analog command signal - the equivalent of a ±10 V, 4–20 mA or 0–100 % setpoint sent by a PLC through a valve amplifier - into a directional speed for the Drive. Unlike a plain speed setpoint, it reproduces the characteristics that make a real proportional valve behave differently from an ideal drive: a dead band around the neutral position, optional spool hysteresis, a configurable flow characteristic curve and a finite spool response time. The valve controls flow, which maps to the Drive speed; the motion direction follows the sign of the command, modelling a 4/3 directional valve with a neutral mid position. The signal chain per simulation step is: ```plaintext Setpoint (±10V / 4-20mA / %) → normalize (Setpoint Zero / Setpoint Full) → command -1..+1 → dead band (spool overlap) → hysteresis (optional spool sticking) → response time (amplifier ramp + spool dynamics) → spool position → flow curve (linear or progressive) → flow -1..+1 → Drive.TargetSpeed = |flow| × Max Speed, direction = sign ``` **Setpoint Scaling:** * **Setpoint**: Analog command setpoint in raw signal units, used when no PLC signal is connected. * **Setpoint Zero**: Raw signal value that corresponds to zero flow / neutral position. Use `0` for ±10 V, `12` for 4–20 mA, `0` for 0–100 %. * **Setpoint Full**: Raw signal value that corresponds to 100 % flow in forward direction. Use `10` for ±10 V, `20` for 4–20 mA, `100` for 0–100 %. **Valve Characteristic:** * **Deadband** (0–0.9): Dead band around the neutral position modelling spool overlap. Below this fraction of the command no flow occurs. * **Enable Hysteresis**: When enabled, the spool sticks until the command change exceeds the hysteresis band. * **Hysteresis** (0–0.5): Hysteresis band as a fraction of the command. Changes smaller than this are ignored. * **Flow Curve**: Flow characteristic curve mapping the normalized command (X 0–1) to normalized flow (Y 0–1). Linear by default; can be made progressive for valves with a non-linear flow gain. * **Response Time**: Time in seconds for the spool to travel from neutral to full deflection (amplifier ramp plus spool dynamics). Set to `0` for instant response. **Flow / Speed Mapping:** * **Max Speed**: Drive speed at 100 % flow in mm/s (linear) or °/s (rotational). * **Acceleration**: Drive acceleration in mm/s² (or °/s²). Enable *Use Acceleration* on the Drive for a smooth speed follow. **PLC IOs:** * **Signal Setpoint**: PLC output carrying the analog valve setpoint. * **Signal Spool Position**: PLC input with the actual spool position (-1..1, where 1 = full forward flow). Models the LVDT feedback of closed-loop control valves. * **Signal Current Speed**: PLC input with the current Drive speed. * **Signal Current Position**: PLC input with the current Drive position. The *Valve Status* section shows the live **Command**, **Spool Position** and **Flow** values, which is useful for tuning the dead band, response time and flow curve. ![](/doc/unity/assets/drive-proportionalvalve-2025.png) ### Drive\_CiA402 (Pro, Beta)[](#drive-cia402) [Section titled “Drive\_CiA402 (Pro, Beta) ”](#drive_cia402-pro-beta) Caution This behavior is part of realvirtual **Professional**, was added in realvirtual **6.3.4** and is currently in **beta**. The API and properties may still change. Drive\_CiA402 models a CiA 402 / DS402 drive (IEC 61800-7) - the EtherCAT (CoE) and CANopen drive profile, and the counterpart to the PROFIdrive behaviors for the non-Siemens servo world. The master writes the **controlword** (object 6040h) and the setpoints; the drive returns the **statusword** (object 6041h) and the actual values. It works with virtually every CoE / CANopen servo: Beckhoff AX5000/AX8000, Kollmorgen AKD, Omron, Yaskawa, Schneider Lexium, Lenze i700, SEW MOVI-C in CiA402 mode, Bosch Rexroth ctrlX DRIVE and many more. The behavior runs the CiA 402 power state machine (Switch-On-Disabled → Ready-To-Switch-On → Switched-On → Operation-Enabled, plus Quick-Stop-Active and Fault), so the drive only moves once the master has stepped it through the standard **0x06 → 0x07 → 0x0F** enable sequence. **Supported modes of operation (object 6060h):** * **1 – Profile Position (PP):** move to *Target Position* (607Ah) at *Profile Velocity* (6081h), started by the rising edge of controlword bit 4 (new set-point), acknowledged by statusword bit 12. * **3 – Profile Velocity (PV):** run at *Target Velocity* (60FFh), direction follows the sign. * **6 – Homing (HM):** rising edge of bit 4 marks the axis as referenced (simplified homing). Cyclic synchronous modes (CSP/CSV/CST) and torque mode are not modeled. **Scaling:** * **Position Scale / Position Offset**: Drive millimeters / degrees per position increment, for Target Position (607Ah) and Position Actual (6064h). * **Velocity Scale**: Drive speed in mm/s per velocity unit (Profile Velocity 6081h, Target Velocity 60FFh). * **Acceleration**: Drive acceleration in mm/s² (or °/s²). **Drive Status (Inspector controlled):** * **Simulate Fault**: Forces a drive fault (statusword bit 3), cleared by controlword bit 7 (rising edge). * **Simulate Warning**: Forces a drive warning (statusword bit 7). **PLC Outputs (commands from master):** * **Control Word** (6040h), **Mode Of Operation** (6060h), **Target Position** (607Ah), **Profile Velocity** (6081h), **Target Velocity** (60FFh). **PLC Inputs (feedback to master):** * **Status Word** (6041h), **Mode Display** (6061h), **Position Actual** (6064h), **Velocity Actual** (606Ch). Pitfalls reproduced faithfully: controlword bit 2 (Quick Stop) and statusword bit 5 (Quick Stop) are **active low**; controlword bit 4 (new set-point) and bit 7 (fault reset) are edge-triggered. The decoded controlword / statusword bits and the state machine state are shown read-only in the Inspector. ![](/doc/unity/assets/drive-cia402-2025.png) Drive\_CiA402 with the controlword 6040h / statusword 6041h interface and decoded bits ### Drive\_SEWMovilink (Pro, Beta)[](#drive-sewmovilink) [Section titled “Drive\_SEWMovilink (Pro, Beta) ”](#drive_sewmovilink-pro-beta) Caution This behavior is part of realvirtual **Professional**, was added in realvirtual **6.3.4** and is currently in **beta**. The API and properties may still change. Drive\_SEWMovilink models a SEW-EURODRIVE drive using the **MOVILINK** unit profile (MOVIDRIVE B / MOVITRAC B / MOVIMOT). The PLC writes control word 1 (PO1) and the speed setpoint (PO2); the drive returns status word 1 (PI1) and the actual speed (PI2). This is the native SEW process image used across conveyor and intralogistics applications and is different from PROFIdrive, so it is modeled separately. Note MOVILINK is the legacy SEW unit profile. **MOVI-C** does not use MOVILINK - it uses the MOVIKIT process data profile or PROFIdrive / CiA 402. For a MOVI-C drive in CiA402 mode use [Drive\_CiA402](#drive-cia402) instead. MOVILINK uses three priority-ordered low-byte command bits instead of a numbered state machine: **controller inhibit > rapid stop > stop > enable**. The enable path requires the control word low byte to be **0x06**. Note Key pitfall: control word bit 0 is the **inverted** controller inhibit (1 = inhibit / hold, 0 = released), and bits 1/2 are active low (0 = rapid stop / stop). The enable byte is **0x06, not 0x07** - 0x07 sets bit 0 = inhibit. A zeroed control word (0x0000) is the fail-safe “no enable” state. **Scaling:** * **Max Speed**: Drive speed in mm/s (or °/s) at 100 % / maximum speed. * **Encoding**: Speed setpoint encoding - *SPEED\[%]* (0x4000 = 100 %) or *SPEED* (0.2 rpm per bit). * **Max Speed Rpm**: Maximum speed in rpm (nmax), used to convert the 0.2 rpm/bit encoding. * **Acceleration**: Drive acceleration in mm/s² (or °/s²). **Drive Status (Inspector controlled):** * **Simulate Fault**: Forces a fault (status word bit 5), cleared by control word bit 6 (rising edge). * **Fault Code**: Code reported in the status word high byte while a fault is active. **PLC Outputs (process output data):** * **Control Word 1** (PO1), **Speed Setpoint** (PO2). **PLC Inputs (process input data):** * **Status Word 1** (PI1, with the device-status digit / fault code in the high byte), **Speed Actual** (PI2). ![](/doc/unity/assets/drive-sewmovilink-2025.png) Drive\_SEWMovilink with the MOVILINK control word 1 / status word 1 interface and decoded bits ### Drive\_FestoFHPP (Pro, Beta)[](#drive-festofhpp) [Section titled “Drive\_FestoFHPP (Pro, Beta) ”](#drive_festofhpp-pro-beta) Caution This behavior is part of realvirtual **Professional**, was added in realvirtual **6.3.4** and is currently in **beta**. The API and properties may still change. Drive\_FestoFHPP models a Festo drive using the **FHPP** (Festo Handling and Positioning Profile), the native profile of the Festo electric-handling family (CMMP-AS, CMMS-ST/AS, CMMD, CMMO-ST, CPX, CMMT in Festo-profile mode). FHPP is byte-oriented: the PLC writes the control bytes **CCON / CPOS** plus the setpoints, and the drive returns the status bytes **SCON / SPOS** plus the actual values. **Two operating modes** (selected via CCON bits 6/7): * **Record Select:** byte 2 selects a stored traversing record from the *Records* table (position, velocity, absolute/relative configured in the Inspector). * **Direct Mode:** the target position (bytes 4-7) and velocity (byte 3, 0-100 %) are sent inline. The positioning handshake follows the FHPP standard **START → ACK → MC**: the rising edge of CPOS.START latches the setpoints and begins the move, the drive answers with SPOS.ACK, and SPOS.MC (Motion Complete) goes high when the target is reached. Homing via CPOS.HOM marks the axis as referenced. Note Pitfalls reproduced faithfully: CCON.STOP (bit 1) and CPOS.HALT (bit 0) are **active low** (0 = stop / halt); CPOS.START / HOM and CCON.RESET are rising-edge; CPOS.TEACH is falling-edge; the velocity byte is unsigned %. **Scaling:** * **Position Scale / Position Offset**: Drive millimeters / degrees per position increment (Direct mode target / actual position). * **Base Velocity**: Drive speed in mm/s at 100 % velocity (Direct mode velocity byte = 0-100 %). * **Jog Speed**: Drive speed in mm/s for CPOS.JOGP / CPOS.JOGN. * **Acceleration**: Drive acceleration in mm/s² (or °/s²). * **Records**: Traversing record table (position, velocity, absolute/relative) for Record Select mode. **PLC Outputs (FHPP output bytes):** * **Ccon** (byte 0), **Cpos** (byte 1), **Record Or Cdir** (byte 2), **Velocity Percent** (byte 3), **Target Position** (bytes 4-7). **PLC Inputs (FHPP input bytes):** * **Scon** (byte 0), **Spos** (byte 1), **Record Or Sdir** (byte 2), **Position Actual** (bytes 4-7). Force / torque mode and the FPC parameter channel are not modeled. ![](/doc/unity/assets/drive-festofhpp-2025.png) Drive\_FestoFHPP with the FHPP CCON/CPOS and SCON/SPOS byte interface © 2025 realvirtual GmbH [https://realvirtual.io](https://realvirtual.io/) - All rights reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or by any means, including printing, saving, photocopying, recording, or other electronic or mechanical methods, without the prior written permission of the publisher. # Drive Position Switch Note This feature was added in realvirtual **6.0.9 beta** ## Overview [Section titled “Overview”](#overview) The **Drive Position Switch** component controls a boolean PLC signal based on the drive’s position. It monitors one or more position ranges and activates an output signal when the drive enters any of these areas. The component fully supports both linear and rotational drives, including drives with wrap-around behavior (e.g., 0-360° rotational drives). This component is particularly useful for creating position-dependent logic in automation systems, such as activating sensors, triggering actions at specific zones, or creating safe areas on linear or rotational axes. ## Key Features [Section titled “Key Features”](#key-features) * **Multiple Position Areas** - Define multiple ranges where the signal should be active * **OR Logic** - Signal activates when drive is in ANY defined area * **Area Inversion** - Optionally define areas as “false zones” instead of “true zones” * **Position Offset** - Apply a global offset to the drive position before checking areas * **Wrap-Around Support** - Automatic detection and handling of rotational drives with position wrapping * **Wrapped Areas** - Support for areas that wrap around limits (e.g., 350-10° on a 0-360° drive) ## Properties [Section titled “Properties”](#properties) ![](/doc/unity/assets/drive-position-switch-inspector.png) Drive Position Switch Inspector ### Position Areas [Section titled “Position Areas”](#position-areas) **Areas** (list) A list of position ranges that control the output signal. Each area has: * **Name** - Descriptive name for the area * **Start Position** - Beginning of the range in millimeters or degrees * **End Position** - End of the range in millimeters or degrees When the drive position is within ANY of these areas, the output signal is set to true (OR logic). For rotational drives with wrapping enabled, areas can wrap around the limits by setting Start Position > End Position (e.g., 350-10 on a 0-360° drive). ### Settings [Section titled “Settings”](#settings) **Invert Areas** (boolean) When enabled, the defined areas become “false zones” instead of “true zones”. The output signal is false when inside areas and true when outside all areas. This is useful for defining exclusion zones or safe areas. **Position Offset** (float) A global offset in millimeters or degrees applied to the drive’s current position before checking areas. For drives with wrapping enabled, the offset is automatically normalized to stay within the drive’s limits. This allows you to shift all areas without modifying each individual area range. ### PLC IOs [Section titled “PLC IOs”](#plc-ios) **Output Signal** (PLCInputBool) The boolean signal sent to the PLC. This signal is true when the drive position (after applying offset) is within any defined area, or inverted if Invert Areas is enabled. Connect this to your PLC logic or other components that need position-based triggering. ## Usage [Section titled “Usage”](#usage) ### Basic Position Switch [Section titled “Basic Position Switch”](#basic-position-switch) To create a simple position switch that activates in specific zones: 1. Add a **Drive** component to a GameObject 2. Add the **Drive Position Switch** component to the same GameObject 3. In the Inspector, expand the **Areas** list and click the + button 4. Set **Start Position** and **End Position** for your desired activation zone 5. Add a **PLCInputBool** signal or connect the **Output Signal** to your logic 6. The signal will be true when the drive is within the defined range ### Multiple Zones [Section titled “Multiple Zones”](#multiple-zones) To activate the signal in multiple separate zones: 1. Add multiple elements to the **Areas** list 2. Configure each area with different Start and End positions 3. The output will be true if the drive is in ANY of the defined areas (OR logic) Example: Activate signal at positions 100-150mm and 300-350mm: * Area 1: Start=100, End=150 * Area 2: Start=300, End=350 ### Rotational Drives with Wrap-Around [Section titled “Rotational Drives with Wrap-Around”](#rotational-drives-with-wrap-around) For rotational drives that jump from upper to lower limit (e.g., 360° to 0°): 1. Ensure your Drive has **Use Limits** enabled and **Jump To Lower Limit On Upper Limit** enabled 2. Create areas that can wrap around limits by setting Start Position > End Position 3. The component automatically detects and handles wrapped areas Example: Activate between 350° and 10° on a 0-360° drive: * Area: Start=350, End=10 * Signal will be true from 350° to 360° AND from 0° to 10° ### Safe Zones with Area Inversion [Section titled “Safe Zones with Area Inversion”](#safe-zones-with-area-inversion) To define safe zones where the signal is false (and true everywhere else): 1. Enable **Invert Areas** checkbox 2. Define areas where you want the signal to be FALSE 3. The output will be true when OUTSIDE all defined areas Example: Create a safe zone from 100-200mm where output is false: * Enable Invert Areas * Area: Start=100, End=200 * Result: Signal is false from 100-200mm, true everywhere else ### Position Offset [Section titled “Position Offset”](#position-offset) Use position offset to shift the coordinate system without modifying all areas: 1. Set **Position Offset** to your desired offset value 2. The drive’s position is adjusted before checking areas 3. For wrapping drives, the offset is automatically normalized Example: Check if drive is at position 0-50mm with 100mm offset: * Area: Start=0, End=50 * Position Offset: 100 * Result: Signal is true when drive is at -100 to -50mm (adjusted to 0-50mm) ## See Also [Section titled “See Also”](#see-also) * [Drive](/doc/unity/components-and-scripts/motion/drive/) - The main Drive component * [Drive Behaviors](/doc/unity/components-and-scripts/motion/drive-behavior/) - Overview of all Drive Behavior components * [PLCInputBool](/doc/unity/components-and-scripts/plc-signals/#plcinputbool) - Boolean signals to PLC * [Sensor](/doc/unity/components-and-scripts/sensors/sensor/) - Alternative for proximity-based detection # Group The Group script is assigning a defined group to the component where the group is attached to. ![](/doc/unity/assets/group.png) The Group is named by a GroupName. For Prefabs you can also define a reference to another object which will create a Prefix for the group name. This is especially useful if you would like to generate reusable prefabs that are using the Group function. The Group scritp is specially used by the [Kinematic](/doc/unity/components-and-scripts/motion/kinematic/) script. The [Selection Window](/doc/unity/basics/selection-window/) (available in Pro only) allows you to easily hide and show Groups. © 2025 realvirtual GmbH [https://realvirtual.io](https://realvirtual.io/) - All rights reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or by any means, including printing, saving, photocopying, recording, or other electronic or mechanical methods, without the prior written permission of the publisher. # Guided Transport > realvirtual.io 2022.03 and above TransportSurfaces are ideal for modeling standard conveyor systems. However, for rail-based systems or systems with numerous colliders for making curves, stable modeling may not be achievable using TransportSurfaces. As an example, please check the following system, where the MUs are moving in a stable manner on the conveyor system. MUs can also be stopped by physical stoppers (based on colliders). > 💡 **Note**:\ > If your transport surface is **position-controlled** (e.g., updated by a PLC), using standard `GuidedMU` may lead to physics instability.\ > In such cases, switch to a **kinematic approach** using `KinematicMU` for smooth and reliable transport.\ > See [KinematicMU ](/doc/unity/components-and-scripts/motion/kinematicmu-pro/)for setup and usage details. [](/doc/unity/assets/vlc_ninZK3Lt2c.mp4) In such cases, Guided Transports come to the rescue. They offer limited transport direction and position, following guide lines that can be linear or circular. There are two options for using Guided Transports. First, you can make Guided Transports children of TransportSurfaces by adding GuideLines or GuideCircles. This allows you to retain the standard animation features of the surface itself. Alternatively, you can use the TransportGuided Prefab, which combines a drive, the necessary GuideLine or GuideCircle, and all required colliders in a single component. This is especially useful for overlaying on an existing imported CAD Design. You can find a tutorial about Guided Transports on Youtube: [Guilded Transport Tutorial](https://www.youtube-nocookie.com/embed/9xlYGXN2AEA) Guilded Transport Tutorial ## Demo Scene [Section titled “Demo Scene”](#demo-scene) [](/doc/unity/assets/GuidedTransportDemo.mp4) Demo Scene A special demo scene showcases various demonstrations of guided transports, including lifting objects using Guide Transports, such as chain systems. You can access this demo scene through the main menu by navigating to `Tools > realvirtual > Additional Demos > Guided Transport`. Explore the different scenarios to see the capabilities and applications of Guided Transports in action. ## Prerequisites - GuidedMU [Section titled “Prerequisites - GuidedMU”](#prerequisites---guidedmu) ![](/doc/unity/assets/GuidedTransportMU.png) GuidedMU To utilize Guided Transport, you must ensure that all [MUs ](/doc/unity/components-and-scripts/mu-movable-unit/)(Moving Units) have a `GuideMU` script attached to them. The recommended approach is to add this script to the [Source](/doc/unity/components-and-scripts/mu-movable-unit/source/), as shown in the picture. Guided Transports rely on colliders and raycasts to detect the Guide Lines. Therefore, it’s necessary to define the raycast length and layers appropriately to ensure proper functionality. Note The raycast in the Guided Transport system will always be performed downwards in the Global Z direction. This ensures that even Moving Units (MUs) that may be tumbling or moving erratically will still be able to detect the colliders accurately and be snapped to the Guide Lines. The standard components used in Guided Transport are `rvTransport`, which combines Guide Lines with [TransportSurfaces](/doc/unity/components-and-scripts/motion/transportsurface/), and `rvSimStatic`, which is utilized for TransportGuided Components. The `rvSimStatic` component is especially useful when you want to avoid collisions with the [MUs ](/doc/unity/components-and-scripts/mu-movable-unit/)detected by the detection collider. ## Guided Transport with TransportSurface [Section titled “Guided Transport with TransportSurface”](#guided-transport-with-transportsurface) `TransportSurfaces` can be extended by GuideLines. This will snap MUs as soon as the `GuidedMU` raycast are detecting the `TransportSurface`. The MU is always aligned and snapped to the nearest point on the `TransportSurface`. The speed is taken from the `TransportSurface`. You need just to add an empty Gameobject underneath the `TransportSurface` and add the `GuideLine` or `GuideCircle` component to it. Alternatively you can use the overlay menu or the main menu (e.g. `Tools > realvirtual > Add Object > GuideLine`) ![](/doc/unity/assets/GuidedTransportGuideLine.png) GuideLine as children under a TransportSurface Besides the GuideLine also GuideCircle is available for circular movements. ![](/doc/unity/assets/GuidedTransportGuideCircle.png) GuideLine as children under a TransportSurface ## TransportGuided [Section titled “TransportGuided ”](#transportguided) A convenient alternative for implementing Guided Transport is to use the `TransportGuided` Component. This single Prefab component simplifies the process by combining a Drive and the `TransportGuided` script into one entity. Additionally, it automatically creates the necessary colliders and either a `GuideCircle` or *GuideLine*, depending on the configuration. To add a TransportGuided component: 1. Drag and drop the prefab into the scene, or 2. Use the main menu: Tools > realvirtual > Add Object > TransportGuided, or 3. Use the overlay menu. ![](/doc/unity/assets/TransportGuided.png) TransportGuided Circular ### Properties [Section titled “Properties”](#properties) #### Circular [Section titled “Circular”](#circular) True for circular guide lines. #### Radius (Circular) [Section titled “Radius (Circular)”](#radius-circular) The radius of the guide line. #### Angle (Circular) [Section titled “Angle (Circular)”](#angle-circular) The angle of the guide line. #### Collider Border Z (Circular) [Section titled “Collider Border Z (Circular)”](#collider-border-z-circular) The border in Z direction to the side on the entry of the guide line. #### Collider Border X (Circular) [Section titled “Collider Border X (Circular)”](#collider-border-x-circular) The border in X direction to the side on the exit of the guide line. #### Length (Linear) [Section titled “Length (Linear)”](#length-linear) The length of the linear guide line. #### Height [Section titled “Height”](#height) The height of the component. Zero Point of the component is always the start of the guide line or guide circle. #### Width (Linear) [Section titled “Width (Linear)”](#width-linear) The width of the collider for linear guide lines. #### DistanceCollider [Section titled “DistanceCollider”](#distancecollider) The distance between the collider and the guide line. The collider should be always a little bit underneath the guide line. #### ShowGizmos [Section titled “ShowGizmos”](#showgizmos) True if the Gizmos for the collider and guide lines should be shown. ![](/doc/unity/assets/TransportGuidedLine.png) TransportGuidedLinear # Joint ### Introduction PhysiX Joints and realvirtual.io forward kinematics[](#introduction-physix-joints-and-realvirtual-io-forward-kinematics) [Section titled “Introduction PhysiX Joints and realvirtual.io forward kinematics ”](#introduction-physix-joints-and-realvirtualio-forward-kinematics) > Joints use the Unity PhysX system. Due to some limitations of physics joints, you should only use this joint if you really need it for backward kinematics and you should not use it for normal forward kinematics. The default concept for moving axes in realvirtual.io is to move the position of the gameobjects themselves by using “Kinematic Rigidbodies”. This means that the gameobject hierarchy defines the kinematic chain and that these positions are not controlled by the Unitys physics engine. We took this approach, because pure PhysX-controlled movements have some disadvantages. PhysX joints always have some elastic behavior due to the physics solvers, and very accurate positioning of the axes is very difficult to achieve. For example, it is important that the TCP of a robot is exactly at the desired position after all robot axes are set to the angle calculated by the robot controller. If you need backward kinematics, which means that a kinematic chain should follow a component that is controlled by a drive, you can use PhysX joints. But you should always keep in mind that these positions are calculated by the PhysX engine and that the position can be inaccurate. Note It is only possible to combine Drive-controlled axes with PhysX joints if the PhysX axes follow the Drive. Due to Unity PhysX limitations, it is not possible to put a Drive controlled axis in the middle of a PhyxX Joint controlled kinematic chain. The realvirtual.io Drive MUST always be at the end or beginning of the PhysX kinematic chain. The PhysX kinematic chain will only follow the axis that is fully controlled by a realvirtual.io Drive. ![](/doc/unity/assets/joint.png) Sometimes the standard Unity Joints (e.g. Configurable Joint) are very hard to understand and overloaded with properties. This is why we implemented a simple Joint script. This Joint script will create a standard Unity joint automatically when the simulation starts. ### Joint [Section titled “Joint”](#joint) With the Joint component you can define cylindrical and linear joints with the same kind of axis and direction definition you already know form realvirtual.io drives. Additionally the connected Rigidbodies will be automatically shown as a Mesh Gizmo in yellow (see picture above). ![](/doc/unity/assets/joint-inspector.png) **Connected To** is the Rigidody which is connected to this component by this joint. **Delta Center** you can move the center of the Joint axis by the defined values. If the value is zero the center point of this joint is in the pivot point of the gameobject the Joint script is attached to. **Center On Object 1 / Center On Object 2** It is possible to define external gameobjects which are defining the rotation point of the axis. If to gameobjects are defined the center between the two gameobjects is the center point of this joint. **Show Gizmo** if set to true the axis of the joint is shown by a red line and the connected Rigidody is shown by a yellow mesh. © 2025 realvirtual GmbH [https://realvirtual.io](https://realvirtual.io/) - All rights reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or by any means, including printing, saving, photocopying, recording, or other electronic or mechanical methods, without the prior written permission of the publisher. # Kinematic Very often when importing 3D parts from external sources like CAD systems the 3D data is not structured in a kinematic manner.\ The realvirtual.io kinematic is based on the hierarchy of Gameobjects. This means, that the hierarchy defines also the kinematic chain.\ For creating a kinematic chain there are multiple ways. You could restructure the Gameobject hierarchy manually in realvirtual.io or the CAD system before exporting to Unity. But normally, it is better to leave the imported structure as it is. This facilitates the update workflow, if you reimport the 3D data again, in the case of design changes. The Kinematic component is for restructuring the Kinematic chain and for repositioning objects without manually changing the imported 3D data (and without changing the structure of the data in the CAD system). In this Youtube tutorial you can get an insight about defining Kinematics with realvirtual.io:\\ [Tutorial CAD independent Kinematic definition](https://www.youtube-nocookie.com/embed/u80SeJKJP1Q) Tutorial CAD independent Kinematic definition The Kinematic component offers these 4 functions. All functions are started on simulation start:\ **Repositioning and aligning the origin** to another Gameobject origin. This will also move the children of the Kinematic component. **Move the pivot center** and keep the position of the child Gameobjects for defining a rotation point. **Integrate parts from a defined Group** into this Kinematic component. **Define a Kinematic parent** to move the Kinematic Gameobject and its children underneath another GameObject. ![](/doc/unity/assets/kinematic.png) ### Gizmo[](#gizmo) [Section titled “Gizmo ”](#gizmo) In large CAD designs you work very often with a lot of Kinematic Groups based on the function *Integrate Group*. Because usually the Gameobjects with the *Kinematic* script attached to it are empty you can enable *Show Group Gizmo*. This will highlight all the meshes which are part of the defined group like shown in this picture. ![](/doc/unity/assets/kinematic-gizmo.png) ### Reposition[](#reposition) [Section titled “Reposition ”](#reposition) A part might be not placed on simulation start as it should. You can reposition any GameObject if you select this option. You need to assign another reference GameObject where this part will be placed to. The Pivot origins of the part will be aligned to the defined Gameobjects pivot. The operation will be performed uppon simulation start. ### Move Center [Section titled “Move Center”](#move-center) You can move the center of a part without moving the positions of the underlying parts itself. To do this you can define a vector (in millimeters) and a rotation (in the local coordinate system) where the center of the part should be moved to. The operation will be performed uppon simulation start. ### Integrate Group [Section titled “Integrate Group”](#integrate-group) You can integrate a group into this kinematic part. To do this you need to assign the Group script to any other GameObject and give the group a name. Integrate Group will move all parts with the defined group underneath this kinematic part on the simulation start. This is the most important function. With this method you can define CAD design structure independent Kinematic groups in parallel to the imported CAD data. For the reuse of components you can assign in *Group Name Prefix* a part whose name is used as prefix of the group name. Please check for example the Demo model *Assets/game4automation/Scenes/DemoGripping* for an example how to use this function. ### New Kinematic Parent [Section titled “New Kinematic Parent”](#new-kinematic-parent) With New Kinematic Parent, you are moving this part underneath another part upon simulation start. © 2025 realvirtual GmbH [https://realvirtual.io](https://realvirtual.io/) - All rights reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or by any means, including printing, saving, photocopying, recording, or other electronic or mechanical methods, without the prior written permission of the publisher. # Kinematic Joints Note This feature was added in realvirtual **6.3.x** (Professional). ## Overview [Section titled “Overview”](#overview) Kinematic Joints add a purely kinematic, position-based constraint solver to realvirtual. They solve **closed kinematic chains** — Delta robots, four-bar linkages, scissor lifts, parallel grippers — without using Unity’s physics engine at all. A `KinematicMechanism` collects every `KinematicJoint` in its hierarchy and, once per FixedUpdate, moves every passive link so that all joint constraints are satisfied, given the current position of your `Drive` components. There is no jitter, no drift, and no PhysX involved: the same Drive input always produces the exact same result. This is a different, fourth path alongside realvirtual’s existing motion systems (kinematic hierarchy Drives, `Joint`/PhysX joints, `Kinematic`/CAD pivot correction — see [Joint](/doc/unity/components-and-scripts/motion/joint/) and [Kinematic](/doc/unity/components-and-scripts/motion/kinematic/)). Use Kinematic Joints specifically when a mechanism cannot be expressed as a simple parent/child hierarchy because one link has to satisfy more than one constraint at the same time — the defining trait of a closed loop. Tip **Accuracy, not physics.** A PhysX `Joint` solves a closed loop with iterative, force-driven physics, so it tends to jitter, sag and drift, needs spring/damper tuning to stay stable, and is not exactly repeatable. Kinematic Joints satisfy the geometry *exactly* every FixedUpdate — no jitter, no drift, fully deterministic. Whenever the mechanism’s pose has to be *correct* (a Delta picking to a precise point, a linkage indexing to a fixed stop, a gripper closing to an exact width), use Kinematic Joints; reach for a physics joint only when the dynamics themselves are what you want to simulate. Drives keep working exactly as you already know them. A Drive still owns its own axis and moves it with speed, acceleration and limits. The only difference is that a `KinematicJoint` references that Drive as its **Driven By** field — the joint becomes the active boundary condition the solver treats as fixed for that step, and everything downstream (the passive links) is calculated from it. [](/doc/unity/assets/autonox-delta-kinematics.mp4) A real Autonox delta robot (CAD import) running purely on Kinematic Joints: three driven arms close a Universal–Spherical parallelogram onto the floating platform, plus a telescope axis and a driven TCP rotation. This is the **DemoKinematicsSolver** sample scene (menu **realvirtual/Kinematics** demos). Note The Autonox robot in the demo scene was reconstructed from the manufacturer’s public connecting-dimensions drawing, not from exact internal CAD. The joint positions are plausible and the mechanism solves cleanly, but the arm/rod geometry is approximate — treat the demo as a showcase of the solver, not as a dimensionally accurate Autonox model. ## Key Concepts [Section titled “Key Concepts”](#key-concepts) **Floating links.** Links that form part of a closed loop do not need to be parented to each other. A coupler link in a four-bar linkage, for example, sits directly under the mechanism root and is positioned purely by its `KinematicJoint` connections — this is what makes closed loops possible in the first place. **Four joint types.** Revolute (hinge), Prismatic (slider), Spherical (ball joint) and Universal (cardan) cover the vast majority of mechanical joints. A Universal joint is required wherever a rod would otherwise be held only by two Spherical joints — that configuration has a free spin degree of freedom around the rod’s own axis, which realvirtual detects and flags with a console warning. **Active vs. passive joints.** A joint becomes “active” the moment you assign a Drive to its **Driven By** field. Active joints are the boundary conditions of the solve; every other joint is passive and gets its value calculated by the solver every FixedUpdate. **Diagnosis, not silent failure.** If a mechanism is pushed to or beyond a joint limit, or into a configuration it cannot exactly reach, the solver converges to the closest achievable pose instead of tearing the chain apart. `Converged` and `Residual Error` on the `KinematicMechanism` make this visible at a glance, and an optional `Signal Converged` PLC signal exposes it to your automation logic. ## Joint Types [Section titled “Joint Types”](#joint-types) Every `KinematicJoint` is one of four types. The type decides how many degrees of freedom the joint leaves open, which anchor/axis fields you need to fill in, and how the joint is drawn in the Scene View. When you select a joint (or its `KinematicMechanism`), each joint draws a type-specific, color-coded gizmo; selecting a single joint additionally highlights its two connected links as a wireframe — **Body A in blue, Body B in orange** — so you can see at a glance which two parts a joint ties together. ![](/doc/unity/assets/kinematic-joint-gizmos.png) Scene View joint gizmos on the Autonox delta: the green/pink Cardan crosses are Universal joints, each with a live 90° angle label between its two axes; the orange outline marks the selected link. **Revolute — 1 rotational DOF (hinge).** Rotates about a single axis. Fill in **Anchor A** (the hinge point) and **Axis A** (the rotation axis, in Body A’s local space). This is the only joint type besides Prismatic that carries a single scalar value, so it is the type you normally make *active* by assigning a **Driven By** Drive, and the only type (with Prismatic) that supports **Use Limits**. Gizmo: a blue disc in the rotation plane with an axis arrow, plus a green limit arc that turns red as the joint approaches a limit. Typical use: robot arm axes, four-bar cranks and rockers, the driven arms of a Delta robot. **Prismatic — 1 translational DOF (slider).** Slides along a single axis. Anchor A and Axis A define the slide line; **Use Limits** clamps the travel in millimeters. Gizmo: an orange slide line with end markers and a cube marker at the current position. Typical use: scissor-lift strokes, linear actuators, the telescope axis of the Autonox demo. **Spherical — 3 rotational DOF (ball joint).** A free ball joint with no single axis — only **Anchor A** and **Anchor B** matter, Axis A and limits are hidden. Gizmo: three orthogonal wireframe rings (a wire sphere) at the anchor. Typical use: the lower end of parallelogram rods, ball-jointed linkages. A rod held by *two* Spherical joints has a free idle-spin degree of freedom around its own axis, which the solver flags as a warning — use a Universal joint at one end instead (see below). **Universal — 2 rotational DOF (Cardan / U-joint).** Transmits rotation while allowing a bend, like a cardan/universal joint. It needs **two** axes: **Axis A** in Body A’s space and **Secondary Axis B** in Body B’s space, which should be perpendicular at the assembled pose. Gizmo: a stylized Cardan cross (two perpendicular yoke forks) with a live angle label — green at 90°, orange as the two axes drift away from square. This is the required upper-joint type of a Delta parallelogram: pairing one Universal with one Spherical per rod removes the idle-spin freedom that two Spherical joints would leave. ![](/doc/unity/assets/kinematic-joint-universal-inspector.png) A Universal joint of the delta parallelogram selected: the Inspector shows Body A (ArmPivot0) and Body B (rod), the connected-link wireframe highlight (blue = Body A, orange = Body B), and the Transform-authoring section. ## Properties [Section titled “Properties”](#properties) ### KinematicJoint [Section titled “KinematicJoint”](#kinematicjoint) **Joint Type** (enum) Selects the constraint: Revolute (1 rotational DOF), Prismatic (1 translational DOF), Spherical (3 rotational DOF, no single axis) or Universal (2 rotational DOF, cardan-style). **Body A** / **Body B** (Transform) The two links this joint connects. Body A may be left empty to anchor the joint against world/static space; Body B is always required. **Anchor A** / **Anchor B** (Vector3, millimeters) The joint’s pivot point, given in each body’s own local space. **Axis A** (Vector3) The joint axis in Body A’s local space. Used by Revolute, Prismatic and Universal; not shown for Spherical, which has no single axis. **Secondary Axis B** (Vector3) The second joint axis, in Body B’s local space — Universal joints only. **Use Limits** (boolean) Clamps the joint’s value between Lower Limit and Upper Limit. Available for Revolute and Prismatic joints, which have a single scalar value a limit can clamp. **Lower Limit** / **Upper Limit** (float) The clamping range, in degrees (Revolute) or millimeters (Prismatic). **Driven By** (Drive) The Drive that actively controls this joint. Leave empty for a passive joint the solver calculates. **Current Value** (float, read-only) The joint’s current value in degrees or millimeters, written by the solver every FixedUpdate for diagnosis. ### KinematicMechanism [Section titled “KinematicMechanism”](#kinematicmechanism) **Solver Iterations** (int) The fixed number of Newton-Raphson iterations run every FixedUpdate. Four is enough for most mechanisms; a Delta robot with several floating links benefits from a higher value (the demo scene uses twelve). **Damping** (float) The damped-least-squares factor that keeps the solver stable near singular configurations. The default works well for typical mechanisms. **Tolerance** (float, millimeters) The residual error below which the mechanism reports `Converged = true`. **Converged** (boolean, read-only) Whether the last solve met Tolerance. **Residual Error** (float, read-only) The largest remaining constraint error of the last solve, in millimeters — visible directly in the Inspector’s Diagnosis panel with a green check or red cross. **Signal Converged** (PLCOutputBool) Optional PLC signal mirroring Converged, so your control logic can react to a mechanism that has run into a limit. ## Quick Start [Section titled “Quick Start”](#quick-start) 1. Create an empty GameObject for your mechanism and add a **Kinematic Mechanism** component (`realvirtual/Kinematics/Kinematic Mechanism`). 2. Add the links as children — the fixed frame, any Drive-controlled links, and any floating (loop) links. 3. Add one **Kinematic Joint** component (`realvirtual/Kinematics/Kinematic Joint`) per connection between two links, and set Body A, Body B, Anchor A/B and Axis A. 4. For every joint a Drive should control, assign that Drive to **Driven By**. 5. Press **Validate Mechanism** in the `KinematicMechanism` Inspector to check the topology (link/joint count, independent loops, an estimated degree-of-freedom count) before pressing Play. 6. In Edit Mode, use **Solve Now** to preview a single solve pass without entering Play Mode — the change is fully undoable. 7. Enter Play Mode and drive your Drives as usual. The mechanism solves automatically every FixedUpdate. ![](/doc/unity/assets/kinematic-mechanism-inspector.png) The KinematicMechanism Inspector: live Diagnosis (Converged, Residual Error, Solve Time), the Validation panel (here *19 joints OK · DOF 4*), and per-joint Edit-Mode Jog sliders that drive the mechanism without entering Play Mode. ## Editor Tools [Section titled “Editor Tools”](#editor-tools) Anchor A and Axis A can be dragged directly in the Scene View when a `KinematicJoint` is selected — a position handle for the anchor and a free-move handle for the axis direction. Gizmos color-code every joint by type (blue disc for Revolute, orange for Prismatic, purple sphere for Spherical, two colored arrows for Universal) and show a limit arc that turns red once a Revolute or Prismatic joint approaches its limit. Selecting the `KinematicMechanism` additionally draws a connector line between every joint’s Body A/B anchors — this line turns into a dashed yellow warning line if the mechanism’s residual error exceeds Tolerance, making an unreachable configuration visible at a glance. The **Kinematic Joint** section in the [Kinematic Tool](/doc/unity/basics/user-interface/kinematic-tool-pro/) window reuses the tool’s existing pivot/bounding-box axis definition to quickly place joint anchors on CAD meshes. ### Drive Axis Validation [Section titled “Drive Axis Validation”](#drive-axis-validation) Note Drive axis validation was added in realvirtual **6.3.6** (Professional). The most common setup mistake in a kinematic mechanism is a **Driven By** Drive that moves its link about a different axis than the joint it drives. The solver cannot detect this on its own: it only reads the Drive’s position value and converges cleanly, while the Drive itself moves the link the wrong way — the mechanism looks correctly configured but moves wrongly. The **Validation** panel of the `KinematicMechanism` Inspector (and the MCP tool `kinematic_doctor`) therefore compares every Drive with its joint before the first Play start and reports two warnings: * **Drive Axis Mismatch** – The Drive rotates about or moves along a world axis that deviates by more than 1° from the joint’s **Axis A**. The sign counts: an anti-parallel axis on a driven joint displaces every downstream passive link by twice the angle. **Reverse Direction** of the Drive is taken into account. * **Drive Type Mismatch** – A linear Drive (`Linear*` direction) drives a Revolute joint, or a rotational Drive (`Rotation*` direction) drives a Prismatic joint. Both warnings have a one-click **Fix** button. It sets the Drive’s **Direction** and **Reverse Direction** so that the Drive moves exactly along the joint’s Axis A. The fix is not possible when Axis A is skew to all local axes of the Drive’s GameObject — re-orient the link or the joint axis first. Spherical and Universal joints are not checked, because they have no single axis a Drive could represent. ## Inverse Mode / Kinematic Target [Section titled “Inverse Mode / Kinematic Target”](#inverse-mode--kinematic-target) Note This feature was added in realvirtual **6.3.x** (Professional). Everything above describes the **forward** direction: Drives in, passive link poses out. `KinematicTarget` adds the reverse direction to the same solver — a Cartesian world-space position in, driven-joint values out. Attach it to any GameObject, set **Mechanism** and **Target Link** (the mechanism’s own link that should follow this GameObject, e.g. a Delta robot’s platform), and enable **Tracking Active**: every FixedUpdate the mechanism’s Drives are solved so Target Link converges towards the GameObject’s own position. This is the generic replacement for a per-mechanism analytical inverse kinematics implementation — any mechanism this system can already solve forward, it can now also solve inverse, using the same damped-least-squares approach and the same “closest achievable pose” behavior for unreachable targets. Position only — there is deliberately no orientation target. The parallel-kinematic platforms this system targets (Delta robots above all) have no independent orientation degree of freedom at all; their platform orientation is a byproduct of the parallelogram-arm geometry, not a controllable input, so an orientation constraint would simply over-constrain a solve that position alone already fully determines. **Mechanism** (KinematicMechanism) The mechanism whose actively-driven joints are solved for this target. **Target Link** (Transform) The mechanism’s own link that should track this GameObject’s world position — typically the same link a forward-mode setup would read for diagnosis (a Delta robot’s platform, a scissor lift’s top stage). **Tracking Active** (boolean) Enables continuous inverse-mode tracking. While active, the driven Drives are released from their normal Jog/Drive To/speed-ramp behavior (`Drive.IsExternallyControlled`) so this component’s writes are authoritative — the same convention `RobotIK` uses for its own IK solutions. Disabling it hands the Drives back to their usual behavior. **Reachable** (boolean, read-only) Whether the last inverse solve converged exactly on the target position. `false` means the target sits outside the mechanism’s workspace or a Drive limit was hit — the mechanism still moves to the closest achievable pose instead of freezing, exactly like the forward solver’s own diagnosis. A small crosshair marks the target position in the Scene View, with a dotted line to Target Link’s current position — green while reachable, red when the target is outside the workspace. For scripted or programmatic use without a live-tracking GameObject, `KinematicMechanism` exposes the underlying solve directly: ```csharp // Pure calculation, does not move the scene: float[] jointValues = new float[mechanism.GetActiveJointCount()]; bool reachable = mechanism.SolveInverse(targetWorldPosition, platformLink, jointValues); // Solves AND writes the result into the driven Drives: bool reachable = mechanism.DriveToPosition(targetWorldPosition, platformLink); ``` ## Performance [Section titled “Performance”](#performance) The constraint solver runs in a high-performance **native core**, not in managed script code. Even a demanding closed-loop mechanism like the Autonox delta — 19 joints, ten floating bodies, roughly 66 generalized coordinates — solves in well under a tenth of a millisecond per FixedUpdate. The live **Solve Time Ms** field on the `KinematicMechanism` Diagnosis panel shows this directly (about 0.07 ms for the Autonox demo). Mechanisms are also solved **in parallel**. When a scene contains many independent mechanisms, realvirtual gathers them into one batch each FixedUpdate and solves them across worker threads, then writes every result back on the main thread in a deterministic order. In a stress-test scene of **100 full Autonox delta robots** (1900 joints in total) the entire batch solves in roughly **8 ms per FixedUpdate** — comfortably real-time — where a naive one-after-another approach would need hundreds of milliseconds. The result stays fully deterministic: identical Drive inputs always produce identical poses, whether one mechanism runs or a hundred. You never configure any of this. Build your mechanism, press Play, and the solver picks the fast path automatically. ## Common Use Cases [Section titled “Common Use Cases”](#common-use-cases) **Delta robots** – Three Drive-controlled arms, each closing a Universal-Spherical parallelogram onto a floating platform. This is the reference mechanism the solver was validated against — the platform stays purely translational (no rotation) as the arms move, exactly like a physical Delta robot. ![](/doc/unity/assets/kinematic-mechanism-fourbar-delta.png) The primitive four-bar linkage and Delta robot from the demo scene. The four-bar's Validation panel shows the expected *DOF −2* note: the generic Grübler/Kutzbach formula routinely flags parallel-axis mechanisms as over-constrained even though they move freely — informational only. **Scissor lifts** – A single Drive-controlled Prismatic joint pushes the base of a scissor stage; the platform height follows automatically from the geometry. **Four-bar / coupler linkages** – A Drive-controlled crank moves a coupler and rocker link through a closed loop, useful for cams, indexing mechanisms and toggle clamps. **Parallel grippers** – Two or more jaws that must open/close symmetrically from a single Drive, connected through a shared coupler link. ## Limitations (V1) [Section titled “Limitations (V1)”](#limitations-v1) **Joint types.** The four types cover the vast majority of industrial mechanisms, but three multibody joint types are not yet built in: * **Cylindrical** — rotation *and* translation about the *same* axis at once (2 DOF), as in a rotating telescopic shaft. Model it today as a **Revolute + Prismatic** pair on a shared intermediate link (one dummy link between the two joints, both using the same axis). The Autonox demo’s telescope is built this way. * **Planar** — two translations plus one rotation in a plane (3 DOF). * **Screw / helical** — rotation and translation rigidly coupled by a lead (a threaded spindle). A separate `Drive` gear/ratio coupling is the current workaround. There is deliberately no fixed/weld joint — two links that never move relative to each other are simply parented in the hierarchy. **Other V1 limits.** * Kinematic Joints solve only in **Play Mode**, because the solve runs on Unity’s `FixedUpdate` step, which Unity itself only executes while playing. Use **Solve Now** (or the Jog sliders) in the `KinematicMechanism` Inspector for a fully-undoable Edit Mode preview. * **Nested mechanisms** (a `KinematicMechanism` inside another one) are not supported and are flagged as a configuration error — each mechanism is solved as one self-contained constraint graph. * A mechanism has **one grounding reference** (its fixed frame, or world). Any number of joints may anchor to that same ground — a four-bar linkage’s two ground pivots, for example, both anchor to the frame link. What is not supported is *two independent* static bases in a single mechanism (flagged as a configuration error); model the two pivots against a shared frame link, or split them into separate mechanisms. * The solver runs in a native core; the **Windows** Editor and Standalone player are supported out of the box. ## See Also [Section titled “See Also”](#see-also) * [Drive](/doc/unity/components-and-scripts/motion/drive/) — the active axis every driven Kinematic Joint references * [Joint](/doc/unity/components-and-scripts/motion/joint/) — the PhysX-based alternative for backward kinematics * [Kinematic](/doc/unity/components-and-scripts/motion/kinematic/) — CAD hierarchy/pivot correction (unrelated despite the similar name) * [Kinematic Tool](/doc/unity/basics/user-interface/kinematic-tool-pro/) — editor workflow for building mechanisms on CAD meshes © 2026 realvirtual GmbH [https://realvirtual.io](https://realvirtual.io/) - All rights reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or by any means, including printing, saving, photocopying, recording, or other electronic or mechanical methods, without the prior written permission of the publisher. # KinematicMU (Pro) > Included since realvirtual.io Professional 6.2.2 beta The `KinematicMU` component enables **purely kinematic movement** of [Moving Unity (MUs) ](/doc/unity/components-and-scripts/mu-movable-unit/)along a [`GuidedTransport`](/doc/unity/components-and-scripts/motion/guided-transport/). This is essential in scenarios where **position-controlled transport surfaces** are used (e.g., from a PLC), and traditional physics-based transport would violate physical constraints due to rapid or unpredictable position updates. `KinematicMU` allows sensor interaction but **disables collisions** with other colliders or MUs during guided motion. This makes it ideal for precision transport systems or integration with external control systems like PLCs. ## Use Case [Section titled “Use Case”](#use-case) Standard [`GuidedMU`](/doc/unity/components-and-scripts/motion/guided-transport/) movement applies forces and obeys Unity physics. This works well in most guided transport scenarios but fails for **position-driven conveyor belts** that update positions in cycles. In these cases, using physics-based motion can lead to instability or incorrect behavior. [](/doc/unity/assets/kinematicmu.mp4) KinematicMU demo model #### Setup Instructions [Section titled “Setup Instructions”](#setup-instructions) 1. **Prefab**: Use the standard `TransportGuided` prefab\ Path: `Assets/realvirtual/TransportGuided.prefab` 2. **Scene**: Try the demo scene to see it in action\ Path: `Assets/realvirtual/Professional/KinematicMU/DemoKinematicMU.unity` 3. **Material Unit (MU) Setup**: * Add the `KinematicMU` script to your MU GameObject. * Remove the `GuidedMU` script (if present). * Keep the `MU` and `Source` components. * Ensure a `Rigidbody` is present (used for switching modes). * Assign appropriate layers to the **Raycast Layer** (typically `rvTransport`, `rvSimStatic`). ![](/doc/unity/assets/kinematicmu-inspector.png) #### Inspector Properties [Section titled “Inspector Properties”](#inspector-properties) | Property | Description | | ------------------ | ------------------------------------------------------------------------------------------ | | **Active** | Controls whether the MU should behave kinematically (`Always`, `Never`, or conditionally). | | **Raycast Length** | Distance for downward raycast to detect the transport surface. Default is `0.3`. | | **Raycast Layer** | Layers that are considered for detecting transport surfaces. | | **Debug Mode** | Enables debug visualization of raycasts. | # Motion for developers ## **Sequence of FixedUpdates** [Section titled “Sequence of FixedUpdates”](#sequence-of-fixedupdates) When developing custom behavior models for drives, understanding the sequence of FixedUpdates is crucial for ensuring correct behavior and performance. * **Physics Update Cycle**: All [drive behavior](/doc/unity/components-and-scripts/motion/drive-behavior/) calculations and setting of new drive positions occur within Unity’s physics update cycle. By default, this cycle is set to 20ms, but it can be adjusted in the Unity settings based on performance and calculation requirements. * **FixedUpdate Sequence**: Unity executes FixedUpdate methods for all scripts within each physics cycle. However, the execution order of these FixedUpdates is not guaranteed. This means FixedUpdate in one script (Script1) could be called before or after FixedUpdate in another script (Script2). * **Dependency Management**: For behavior models that depend on other components—such as Gears or [CAMs](/doc/unity/components-and-scripts/motion/cam/)—it is essential that dependencies are calculated in a specific order. For instance, the master Drive should be calculated before its dependent slave Drive. Moreover, behavior models of the master Drive need to be processed before the master Drive’s position is updated. To ensure the correct sequence each Drive is implementing the following behavior: 1. **Drive Behavior Execution**: Each Drive calls `CalcFixedUpdate`of all attached drive behaviors that implement the`IDriveBehavior` interface. 2. **Behavior Model Calculation**: The attached behavior model may modify public properties of the Drive to control its status or directly set the `CurrentPosition` of the Drive. 3. **Position Update**: The Drive then updates its position to the `CurrentPosition`. 4. **Subdrive Calculations**: All subdrives of the Drive will have called their CalcFixedUpdate (see below). ## **Subdrives** [Section titled “Subdrives”](#subdrives) Some Drives function as subdrives of a master Drive, such as in the case of Gears or CAMs. To ensure proper behavior, these drives need to implement the `IDriveBehavior` interface. Additionally, during the `Start` method, the subdrive must call `MasterDrive.AddSubDrive(thisDrive)`. This setup ensures that the subdrive does not run its own FixedUpdate but instead waits for the master Drive to invoke CalcFixedUpdate like explained above. ## Setting a Drive Position [Section titled “Setting a Drive Position”](#setting-a-drive-position) As previously discussed, within the Drive and Drive Behavior Execution cycle, a Drive Behavior can set the public property `CurrentPositio`. Due to the described sequence, this approach ensures that the position is updated correctly. There is also a public method `SetPosition(float position)` available on Drives. When this method is called, the Drive will set its position once again, even if the sequence described above for that Drive has already been completed in the same FixedUpdate cycle. **Important Note:** Calling `SetPosition` directly is not the recommended approach. It is better to implement your logic by using the `IDriveBehavior` interface within your behavior model attached to the Drive. This approach ensures that the Drive position updates occur in a controlled and predictable manner, adhering to the established sequence of FixedUpdates. ## Drive Events [Section titled “Drive Events”](#drive-events) The Drive has two key events that you can utilize to hook into its update sequence: * **OnBeforeDriveCalculation:** This event is triggered before the Drive begins calculating its behavior models and updating its position. It’s an ideal point to inject custom logic or make adjustments before the Drive’s primary calculations occur. * **OnAfterDriveCalculation:** This event is called after the Drive has completed all behavior model calculations and updated its position, but before any SubDrives are calculated. This allows you to make further modifications or perform actions right after the main Drive update but still within the overall update sequence. By using these events, you can effectively integrate custom behavior or adjustments into the Drive’s update process. ![](/doc/unity/assets/drive-events.png) Drive Events # MU Behavior Switcher # PathTracer Note This feature was added in realvirtual **6.0.7** (Professional) **PathTracer** visualizes object movement paths with speed-based coloring, creating colorful trails behind moving objects like robot arms to help analyze and validate motion patterns. ![](/doc/unity/assets/pathtracer-robots.jpg) PathTracer showing robot arm movements with speed-based colors ## Overview [Section titled “Overview”](#overview) Add the PathTracer component to any moving object (robot TCP, conveyor parts, etc.) to see its path visualized in real-time during play mode. The trail color changes based on movement speed, making it easy to identify acceleration, deceleration, and constant-speed phases. ## Key Settings [Section titled “Key Settings”](#key-settings) ![](/doc/unity/assets/pathtracer-inspector.png) PathTracer Inspector showing configuration options **Trail Configuration** * **Enable Trail** – Turn trail visualization on/off * **Trail Time** – How long trail remains visible (60 seconds shown in example) * **Start/End Width** – Trail thickness in millimeters (20mm in example) * **Trail Material** – Material for rendering (TCPTrailMaterial in example) **Speed-Based Coloring** * **Slow Color** – Color for minimum speed (yellow in example) * **Fast Color** – Color for maximum speed (magenta in example) * **Min/Max Speed** – Speed range in mm/s for color mapping (0-2000 mm/s in example) **Performance** * **Minimum Vertex Distance** – Distance before adding new trail point (10mm reduces complexity) * **Play Mode Only** – Trail only visible during play mode ## Quick Start [Section titled “Quick Start”](#quick-start) 1. Add PathTracer component to robot TCP or moving object 2. Enable “Speed Based Coloring” 3. Set Slow Color (e.g., yellow) and Fast Color (e.g., magenta) 4. Configure Max Speed based on your robot/object (e.g., 2000 mm/s) 5. Press Play to see motion trails ## Common Use Cases [Section titled “Common Use Cases”](#common-use-cases) * **Robot Path Validation** – Verify arm movements follow expected trajectories * **Speed Analysis** – Identify acceleration/deceleration phases by color * **Cycle Time Optimization** – Compare different motion profiles visually * **Safety Review** – Check for unexpected movements or collision paths ## See Also [Section titled “See Also”](#see-also) * [Drive](/doc/unity/components-and-scripts/motion/drive/) - Motion control component * [TransportSurface](/doc/unity/components-and-scripts/motion/transportsurface/) - Conveyor and transport systems * [Runtime UI](/doc/unity/basics/runtime-ui/) - Runtime user interface features # Ribbon (Web) Handling (Pro) Note Ribbon handling was added in realvirtual **6.3.1** (Professional). The same components exist in realvirtual WEB, so a machine built here runs unchanged in the browser after a GLB export. ## Overview [Section titled “Overview”](#overview) Ribbon handling simulates **endless material running over rollers** — paper, film, foil, textile, nonwoven, or sheet metal off a coil. You place rollers, list them in running order, and realvirtual solves the taut web between them: the straight runs, the wrap arcs, the growing and shrinking rolls of the winders, and the material stored in a dancer. ![Ribbon Slitter sample scene with unwinder, idlers, nip, two dancers and two rewinders running a printed web](/doc/unity/assets/ribbon-slitter-demo.png) The Ribbon Slitter sample: one unwinder feeds a nip, the web is slit and two rewinders wind the strips Four components do the work: | Component | What it is | | ----------------- | --------------------------------------------------------------------------------------------- | | **Ribbon Roller** | One roller the web runs over: a contact radius, a rotation axis, and the side the web lies on | | **Ribbon Winder** | An unwinder or rewinder at one end of a path, whose radius follows the wound length | | **Ribbon Dancer** | A roller that also travels and thereby stores web between two sections | | **Ribbon Path** | One taut web over an ordered, open chain of rollers | A fifth component, **Ribbon Manager**, is a single scene object that ticks everything in the right order. One is created automatically when the simulation starts. The web is moved **only** by a rotational **Drive** on a roller. There is no separate speed setting: you drive the nip roller (or the rewinder) exactly as you would in the real machine, and the web follows. ## Quick Start [Section titled “Quick Start”](#quick-start) 1. Add a **Ribbon Roller** to the mesh node of every roller of your machine. Set **Axis** to the roller’s rotation axis and leave **Radius Mm** at 0 to have it measured from the mesh. 2. Make the two ends **Ribbon Winder** instead, and give them a **Core Radius Mm** and a **Ribbon Thickness Mm** (the caliper of your material). 3. Put a rotational **Drive** on the roller that pulls the web — usually the nip — with its **Direction** on the same axis as the roller. Set its **Target Speed** in degrees per second. 4. Create an empty GameObject, add a **Ribbon Path**, and drag the rollers into **Rollers** in running order. The first and last entry are the ends of the web. 5. Set **Ribbon Width Mm** and **Ribbon Thickness Mm** (the same caliper as the winders). 6. Press Play. The band appears, the followers turn at `v / r`, and the roll diameters migrate. While you are still placing rollers, the Scene view shows a live **preview**: both band edges, the wrap arcs, the slit mark and the wrap side of every roller. It updates as you drag, and it uses the same mathematics the simulation does — so what you see while authoring is what the web will do. ## Ribbon Roller [Section titled “Ribbon Roller”](#ribbon-roller) **Radius Mm** (float, millimeters) Contact radius of the roller. 0 measures it from the mesh bounds in the plane perpendicular to **Axis**, in the node’s own local frame, so a scaled parent does not distort it. Set it by hand for a roller whose mesh is a rough placeholder. **Axis** (X / Y / Z) Local rotation axis of the roller, and the common axis of the whole path. Every roller of one path must be parallel within 2 degrees; a path with a turn bar is not one path. **Ribbon Side** (Auto / Left / Right) Which side of the roller the web runs on. Leave it on **Auto**: for every normal machine Auto picks the short wrap, the only one a real web can take. Set Left or Right by hand only for an S-wrap or a wrap of more than 180 degrees. Left and Right are the turning sense seen looking along +Axis — Left counter-clockwise, Right clockwise. **Rotation Direction** (1 / -1) Which way the roller is *drawn* turning. Set it to -1 when the roller visibly turns against the web, which happens when the imported CAD axis points the other way. It changes the picture only, never the web speed. **Spin Mode** (Transform / Texture) How the roller shows that it is turning. **Transform** turns the roller object itself. **Texture** leaves the object standing still and scrolls the pattern on its barrel instead — it looks the same at a glance and costs no per-frame work, which is worth having on a machine with many idlers. Texture works only on a roller **without** a drive; a driven roller is always turned by its drive. **Mantle Mesh** (Transform) Which part scrolls in Spin Mode Texture — normally the barrel of the roller. Leave it empty to use the roller’s own mesh. **Override Materials** (boolean) Replaces the CAD materials of the barrel and of the end faces with the two library materials below while the simulation runs, and puts the CAD materials back when it stops. Switch it on when an imported roller is plain grey and you want a pattern that shows it turning, without editing the CAD materials. **Mantle Material Name** (string, dropdown) Name of a material of the ribbon material library for the barrel. Leave it empty to leave the barrel unchanged. **Face Material Name** (string, dropdown) Name of a material of the ribbon material library for every renderer under a child called `Faces`. Leave it empty to leave the end faces unchanged. **Preview materials** (button) Shows the two materials in the scene view without starting the simulation, and takes them back when pressed again. The preview is never saved: it is taken back before a scene or prefab is written and before a script reload, so it can never become a scene change. ## Materials [Section titled “Materials”](#materials) Every ribbon material is picked by **name** from the **ribbon material library**, so the same name means the same look in Unity and in realvirtual WEB. The library ships with the package as `Packages/io.realvirtual.professional/Runtime/Ribbon/Resources/realvirtual/RibbonMaterialLibrary.Default` and carries ten entries: `Paper`, `Steel`, `Core`, `Frame`, `Stripes`, `Helix`, `IndexMark`, `Spokes`, `Arrows` and `HubCross`. ### Adding your own materials [Section titled “Adding your own materials”](#adding-your-own-materials) Create a **Ribbon Material Library** asset (`Assets > Create > realvirtual > Ribbon Material Library`), name it `RibbonMaterialLibrary` and put it in any `Assets/.../Resources/realvirtual/` folder. Its entries are merged **over** the default, by name: * a new name adds a material, * an existing name replaces it — case does not matter, so `paper` replaces `Paper`. Do not name your asset `RibbonMaterialLibrary.Default`: two equally named assets in two Resources folders are undefined in Unity, and which one wins would be a coin toss. Names resolve exactly first, then ignoring case. There is no partial match, so `Core` never matches `CoreSteel`. An unknown name is reported in the console together with the names that do exist, and that part simply keeps its CAD material. Use the URP **Lit** shader for your own materials unless you know your shader survives build-time shader stripping. ### What reaches realvirtual WEB [Section titled “What reaches realvirtual WEB”](#what-reaches-realvirtual-web) The browser has no ribbon texture library of its own, so the names are resolved against the materials of the **loaded document**. The GLB export makes sure they are in it: * a roller with **Override Materials** is exported with the library materials on its renderers; * the web material of a **Ribbon Path** is exported through a temporary one-millimetre donor node, because a band mesh does not exist while authoring and a material without a renderer is not exported at all. The donor is deleted again right after the export, and the browser drops it while loading — it costs no draw call and cannot be clicked. In the GLB the materials are named like the **library names**, not like the material assets. Your scene keeps its own asset names; nothing is renamed and nothing is modified by the export. ## Ribbon Winder [Section titled “Ribbon Winder”](#ribbon-winder) A winder **must be the first or the last entry** of its path’s Rollers list; in the middle it makes the path inert with a warning. Its radius follows the wound length: ```plaintext R(L) = sqrt(CoreRadiusMm² + L · RibbonThicknessMm / π) ``` The **length** is the state and the radius is derived from it, which makes the roll exactly reversible: a rewinder driven forward and back returns to its authored diameter instead of drifting. **Wrap Deg** (float, degrees) How far the web is shown wrapping the roll **before** it reaches the running tangent (an unwinder) or **after** it leaves it (a rewinder). A web path is open, so without it the band starts and ends exactly at a tangent point — geometrically right, but the strip appears to hang in mid-air beside the reel. Set 270 to see the material come off the parent roll and be taken up on the reel, which is what the ribbon slitter demo does on all three of its winders. 0 (the default) keeps the earlier behaviour. The arc follows the growing or shrinking roll on its own, and values above 360 are honoured — 450 really is a lap and a quarter. The value is read only on a winder that is the first or last entry of a path. Note **Wrap Deg** was added in realvirtual **6.3.6** (Professional). **Core Radius Mm** (float, millimeters) Radius of the bare core (sleeve); must be greater than 0. 76.2 mm is the 3 inch core of the converting industry. **Ribbon Thickness Mm** (float, millimeters) Thickness of one wound layer — the caliper. It must be the **same** value as the path’s **Ribbon Thickness Mm**; it is the same material. **Initial Wound Length Mm** (float, millimeters) How much material is on the roll at the start and after a restart. **-1** means a full roll exactly as modelled — the length is derived from the modelled outer radius, so a full parent reel needs no number typed in. **0** means an empty core, which is what a rewinder starts at. **Max Diameter Mm** (float, millimeters) Diameter at which the roll counts as full: the whole web group stops and the **Full** signal goes true. 0 = no limit. **Roll Mesh** (Transform) Which part grows and shrinks with the roll. Leave it empty and the winder object itself is scaled, which is the normal case. **Model the core as a SIBLING next to it, never as a child** — a child would scale with the paper and the core would visibly grow. ### Speed Control [Section titled “Speed Control”](#speed-control) A winder is the one roller of a line whose radius moves, so a drive turning at a constant angular speed changes its surface speed as the roll builds or empties — which runs a dancer into a stop within a minute. **Speed Control** lets the winder rewrite its own drive set-point every tick instead. Note Winder speed control was added in realvirtual **6.3.6** (Professional). **Speed Control** (None / Line Speed / Dancer) How the winder decides its drive speed. **None** (the default) leaves the authored drive completely alone. **Line Speed** holds the winder’s surface speed at the line speed: `omega = line speed / current radius`. **Dancer** does the same and adds a proportional trim from the carriage position of the dancer next to it, which is what actually holds a carriage near its home position while the roll grows. **Dancer Gain Per Mm** (float, percent per millimeter) How hard the trim reacts to a carriage that left home. 2 means one millimeter of deviation changes the winder speed by two percent. Raise it for a faster line, lower it if the carriage starts to oscillate. Only read in **Dancer** mode. **Max Trim Percent** (float, percent) Cap on the trim, symmetric around the line speed. 20 means the winder is never asked for less than 80 or more than 120 percent of the line speed, whatever the carriage does. The **line speed** is the group’s master: the fastest surface speed of all driven rollers of the web group that are not themselves speed-controlled — in a web line that is the nip or pull roll. A winder whose **Speed Control** is **None** is a perfectly good master. Without a master nothing is written. The control also **stands down** and writes nothing while the drive is commanded by somebody else (**Is Externally Controlled**, **Position Overwrite**, **Is Sub Drive**, or a second drive behaviour such as Drive\_Speed on the same GameObject), and while the web group is stopped. The status value **Is Speed Control Overridden** says so in the Inspector, and the drive keeps whatever the other writer left it at; releasing the drive resumes the control on the next tick. The **Dancer** trim is used only where it means something: the winder must be the single driven roller of its section and the dancer must bound that same section. Otherwise the trim is zero and **Dancer** behaves exactly like **Line Speed** — which is why the unwinder of a slitter gets no trim from a carriage sitting behind the nip. ### Signals [Section titled “Signals”](#signals) **Diameter Mm** (PLCInputFloat) Current roll diameter in millimeters; written only when it changed by more than 0.1 mm. **Wound Length Mm** (PLCInputFloat) Currently wound web length in millimeters. **Empty** (PLCInputBool) True while the roll is down to its bare core. An empty winder clamps the web speed of its whole path group to zero. **Full** (PLCInputBool) True once **Max Diameter Mm** is reached; it clamps the group the same way. ## Ribbon Dancer [Section titled “Ribbon Dancer”](#ribbon-dancer) A dancer is an **accumulator**, not a spring. It stores whatever length the upstream section delivers over what the downstream section takes, `L += (v_up − v_down) · dt`, and its carriage sits at `Home Mm + L / Strands` along the travel axis. Exactly one dancer per path is supported. At its stops the limit is **directional** and never stops a drive: at **Travel Max Mm** only further filling is prevented, at **Travel Min Mm** only further emptying — so the opposite delta always frees it again. The PLC is expected to regulate on **Position Mm** / **At Min** / **At Max**. **Travel Axis** (X / Y / Z) The direction the carriage runs in, in the frame of the object the dancer hangs under. Place the dancer so that moving along the **positive** axis lengthens the web path. **Travel Min Mm** (float, millimeters) Lower stop relative to Home Mm; must be ≤ 0. **Travel Max Mm** (float, millimeters) Upper stop relative to Home Mm; must be ≥ 0. **Home Mm** (float, millimeters) Rest position along the travel axis, relative to the authored node position. 0 means the carriage starts and resets exactly where it was modelled. **Strands** (int) How many runs of web pass through the carriage. 1 is a single pass over the roller; 2 is the usual loop that goes down to the carriage and back up again. One millimeter of carriage travel then stores that many millimeters of web. ### Signals [Section titled “Signals”](#signals-1) **Position Mm** (PLCInputFloat) The carriage position in millimeters — the regulated variable a web tension controller reads. Written only when it changed by more than 0.1 mm. **At Min** / **At Max** (PLCInputBool) True while the carriage sits at its lower / upper stop. ## Ribbon Path [Section titled “Ribbon Path”](#ribbon-path) **Rollers** (list of Ribbon Roller) Rollers in running order. The first and last entry are the ends of the open path and are usually winders. **Ribbon Width Mm** (float, millimeters) Width of the web, extruded along the common roller axis. **Ribbon Thickness Mm** (float, millimeters) Thickness of the material. Half of it lifts the web off the roller surface so the two do not intersect. It must be the **same** value as the winders of this path. **Texture Length Mm** (float, millimeters) How much web one repetition of the surface pattern covers. This is what makes a running web look like it is running: the pattern scrolls by the distance the web has travelled. A larger value gives a coarser pattern that appears to move more slowly. **Samples Per Meter** (int) How finely the strip is subdivided. Raise it when a tight wrap looks angular; lower it on a very long run to save geometry. Give every strip slit at the same roller the **same** value. **Material Name** (string, dropdown) Name of a material of the ribbon material library for the web itself. It takes precedence over **Material** below. See [Materials](#materials). **Material** (Transform) Optional, and superseded by **Material Name**. A **node** whose material the web copies — a printed pattern, a coloured film. Leave both empty and the web gets a paper-white surface with a running-direction arrow, so its motion is always visible. **Slit At Roller** (Ribbon Roller) Optional **inner** roller (the cutter) at which the full web is slit into this strip. Requires **Full Width Mm** greater than 0. **Full Width Mm** (float, millimeters) Width of the full web before the slit; 0 = this path is not a slit strip. ## Web Tension [Section titled “Web Tension”](#web-tension) On top of the kinematics a Ribbon Path can carry the **web tension** as a state. The line is cut into **tension zones** between the rollers the web cannot slip on — the two ends, every driven roller, the slit roller and the dancer — and every zone carries one signed strain. A zone whose downstream roller runs faster than its upstream one is stretched, the opposite case goes slack, and the force follows from the strain. ![Ribbon Tension sample scene with three nips, a dancer and the tension readouts above each zone](/doc/unity/assets/ribbon-tension-demo.png) The Ribbon Tension sample: every zone between two driven rollers shows its tension, sag and strain Note Web tension was added in realvirtual **6.3.6** (Professional). Tension is **off** until you give the path a stiffness: with **Tensile Stiffness N Per Mm Width** at 0 the path behaves exactly as it did before. Slit strips carry no tension (they warn once and stay kinematic), so model the tension on the unslit path. **Basis Weight Gsm** (float, g/m²) Basis weight of the material — the number on the material data sheet, and what turns a tension into a specific tenacity. **Tensile Stiffness N Per Mm Width** (float, N per mm of width) Secant tensile stiffness at 100 percent strain: the stiffness that turns a strain into a force. **0 switches tension off entirely.** 10 is a usable starting value for a light film or paper web. **Min Strain Percent** (float, percent) Strain below which the web counts as **slack**: it no longer carries, it hangs through, and it is coloured as a fault. **Max Strain Percent** (float, percent) Strain above which the web counts as **overstretched**. **Break Force N Per 50 Mm** (float, newtons per 50 mm of width) The MD strip tensile force at break, the standard lab figure. The strain it implies tears the web: the zone freezes, **Is Broken** goes true and the whole web group stops until the path is reset. 0 disables breaking. **Target Tension N Per M** (float, N per meter of width) The set-point tension per unit width. Every zone starts, resets and enters the line at exactly this value, so a line left alone runs at its set point. **Tolerance Band Percent** (float, percent) Half-width of the good band around the target. Inside it the web is **not tinted at all**, so your own material is untouched in normal operation. ### Tension Visuals [Section titled “Tension Visuals”](#tension-visuals) **Enable Sag** (boolean) Whether a slack web visibly hangs through. The excess length of a slack zone is spread over its straight runs and drawn as a hanging curve in the direction of gravity, so a span that has gone slack is visible without reading a number. **Tension Coloring** (boolean) Whether the band is tinted by its zone state. Under the band the web turns blue and over it orange, with the saturation following the deviation; a slack web is cyan, and an overstretched or torn one pulses magenta. **Tint Strength** (float, 0 to 1) How strongly the tint is mixed into the band material. 0.7 keeps a printed pattern readable underneath it. **Deformation Scale** (float) Visual exaggeration of the sag depth. 1 draws the physical depth; raise it to make a small slack readable on a long line. **Show Tension Labels** (boolean) Draws one world-space readout per zone, in the middle of the span it describes: `142 N/m | 0.81 PLI | eps 0.42 % v`, with a trend arrow, a `~` when the sag left the range the closed form is exact in, and the name of the fault (LOW, HIGH, SLACK, OVERSTRETCHED, TORN) when there is one. A healthy web shows the numbers and nothing else. The labels refresh five times a second and cost nothing at all while the option is off. ### Tension Signals [Section titled “Tension Signals”](#tension-signals) **Tension N** (PLCInputFloat) Web tension of the **last** zone in newtons — the span running into the rewinder, which is where a machine puts its load cell. **Specific Tension N Per M** (PLCInputFloat) The same tension per unit width. **Strain Percent** (PLCInputFloat) Strain of the last zone in percent. **Is Slack** / **Is Overstretched** (PLCInputBool) True while **any** zone of the path is below **Min Strain Percent** / above **Max Strain Percent**. **Is Broken** (PLCInputBool) True once any zone reached the break strain. It latches: only a reset clears it, and the web group stays stopped meanwhile. ### The Dancer as a Tension Source [Section titled “The Dancer as a Tension Source”](#the-dancer-as-a-tension-source) A carriage that carries a **load** does not only store web, it sets the tension of both spans next to it. **Load N** (float, newtons) Force the loaded carriage presses into the web. 0 (the default) means the dancer only stores web. With a load, both neighbouring zones are held at `Load N / Strands` — holding a 400 mm strip at 100 N/m over two strands therefore takes 80 N. **Show Travel** (boolean) Draws the track the carriage runs on: the two end stops, the bar between them and a marker on the carriage. The stop that has been reached turns red, so “out of travel” is readable without comparing numbers. **Show Values** (boolean) Draws the carriage’s own readout next to it — the force it presses into the web, the tension that makes and where it stands — plus a force arrow of capped length. It needs a **Load N** greater than 0. **Tension N** (PLCInputFloat) Signal carrying the tension this dancer imposes, `Load N / Strands`. ### Trying It Out [Section titled “Trying It Out”](#trying-it-out) The sample scene **DemoRibbonTension** (Professional samples, *Ribbon Slitter*) is an unslit line — unwinder, idler, Nip 1, idler, Nip 2, loaded dancer, idler, Nip 3, rewinder — with the labels on. Press Play, then set Nip 2 two percent slower than the other nips: the middle span goes cyan, hangs through, and its label reports a negative strain. Two percent faster turns it magenta. You can build the same line yourself from `realvirtual DEV/Samples/Build Ribbon Tension Line (Axis X)`. ## Common Use Cases [Section titled “Common Use Cases”](#common-use-cases) **Converting line** – Unwinder, idlers, a driven nip and a rewinder. One Ribbon Path, two winders, one Drive on the nip. The unwinder is dragged by the web and reports its diameter to the PLC. **Slitter** – One unwinder feeding several rewinders. Model it as **N Ribbon Paths sharing the unwinder** and set **Slit At Roller** to the cutting roller on every strip. Paths that share a roller form one web group with one speed, so an empty parent roll stops every strip in the same tick, and the shared full-width web is drawn exactly once. **Tension control** – Put a Ribbon Dancer between the nip and the rewinder and wire **Position Mm** to the PLC. The rewinder turns at a constant angular speed, so its surface speed rises as the roll grows; the dancer absorbs the difference and the PLC regulates on its position. **Coil handling** – The same components with a 0.8 mm caliper and a steel material on the band. **Many idlers** – Set **Spin Mode** to Texture on the idlers. They stand still and their barrel texture scrolls, which looks the same and costs nothing per frame. ## Signals and the PLC [Section titled “Signals and the PLC”](#signals-and-the-plc) Every feedback value is a **PLC input** — the simulation writes it, the PLC reads it. There is no PLC output on a ribbon component: you drive the web through the **Drive** components on the rollers, exactly as the real machine does. Float signals are written only when the value moved by more than 0.1 mm and bool signals only on a real edge, so a running line does not flood the interface. ## Exporting to realvirtual WEB [Section titled “Exporting to realvirtual WEB”](#exporting-to-realvirtual-web) The ribbon components export into the GLB without any special handling: the browser components have the same names, the same fields and the same units, and the reader resolves the roller, signal and material references the same way it resolves a Drive’s. Two rules make that work, and both are already satisfied by the components: * The kinematics runs in the **glTF coordinate frame**. Axis letters, **Ribbon Side**, **Rotation Direction** and **Travel Axis** all mean the same thing in Unity and in the browser, so nothing has to be flipped by hand after an export. * The runtime state (surface speed, wound length, dancer position) is never exported; only the authored configuration is. The browser recomputes the state itself. Use the normal realvirtual GLB export. Nothing about the path geometry is exported — the browser solves the tangents and the wrap arcs from the roller poses, exactly as Unity does. ## Performance [Section titled “Performance”](#performance) The kinematics runs after all drives, once per fixed tick, and allocates nothing. The band mesh is rewritten only when a roller actually moved or a roll changed size, and only once per rendered frame. A slitter with two strips and nine rollers costs well under 0.1 ms per tick. If a very long strip outgrows its sample buffer, its sample density is halved automatically and the console says so. When that happens on one strip of a slitter and not on its sibling, the cut lands on a slightly different point for each of them; the console names both webs. The fix is a lower **Samples Per Meter** for the whole slitter, or a shorter longest strip. ## Troubleshooting [Section titled “Troubleshooting”](#troubleshooting) **The web is built but stands still.** No roller of the path carries a rotational Drive. Put one on the roller that pulls the web, with its **Direction** on the roller’s axis. **A roller stays a follower although it has a Drive.** The drive is linear, or its axis is not parallel to the roller axis. The console names the roller and the deviation. **The path is inert.** The console gives the reason: fewer than two rollers, a winder in the middle, a roller whose axis deviates by more than 2 degrees, or two rollers whose circles have no tangent (one swallows the other, or two opposite-side rollers overlap). **The two strips of a slitter split before the cut.** They resolved **Ribbon Side** differently on a shared roller, which is physically impossible for one web. The console names the roller. Move the offending roller, or pin **Ribbon Side** explicitly on the shared rollers. **A roller stands still after combining meshes.** It should not: ribbon rollers, winder roll meshes and dancers get their own combine buckets. If you see it, check that the roller component is on the node that actually moves. ## See Also [Section titled “See Also”](#see-also) * [Drive](/doc/unity/components-and-scripts/motion/drive/) — the rotational drive that moves the web * [Chain](/doc/unity/components-and-scripts/motion/chain/) — closed chains and their elements * [TransportSurface](/doc/unity/components-and-scripts/motion/transportsurface/) — the moving-surface counterpart for discrete parts # TransportSurface The TransportSurface component simulates conveyor belts and transport systems for moving objects through industrial automation processes. It provides physics-based movement of objects along defined transport paths, supporting both linear conveyors and rotational systems like turntables. For modeling conveyor systems with [MU](/doc/unity/components-and-scripts/mu-movable-unit/) (Movable Units), TransportSurface provides the essential physics foundation. > ⚠️ **Note**:\ > For **standard speed-controlled accumulation conveyor systems**, you should use the **purely physics-based approach** with `TransportSurface`. > > However, if this approach becomes unstable or imprecise—especially in **position-controlled systems** (e.g., driven by PLCs)—consider switching to a **guided transport** setup: > > * Use [`GuidedTransport`](/doc/unity/components-and-scripts/motion/guided-transport/) for force-based control. > * Use [`KinematicMU`](/doc/unity/components-and-scripts/motion/kinematicmu-pro/) for fully position-controlled, kinematic movement without violating physics constraints. A Transport Surface is always connected to a [Drive](/doc/unity/components-and-scripts/motion/drive/) which controls the speed and position. The TransportSurface automatically detects and connects to Drive components in the parent hierarchy. Note If you are seeing instability with drives please check [#physic-solver-settings](/doc/unity/basics/physics/#physic-solver-settings "mention") as well as [#stability-of-transportsurfaces](/doc/unity/basics/physics/#stability-of-transportsurfaces "mention")in Section [physics.md](/doc/unity/basics/physics/ "mention"). ## Setup [Section titled “Setup”](#setup) ### Basic Configuration [Section titled “Basic Configuration”](#basic-configuration) 1. Add your conveyor GameObject with geometry (mesh or simple box) 2. Add a [`Drive`](/doc/unity/components-and-scripts/motion/drive/) component to control movement direction and speed 3. Add `TransportSurface` component - it automatically connects to the Drive The TransportSurface automatically detects and connects to [`Drive`](/doc/unity/components-and-scripts/motion/drive/) components in parent objects. [Video](https://www.youtube-nocookie.com/embed/9tHzIFpkDnI) ## Properties [Section titled “Properties”](#properties) ### Core Properties [Section titled “Core Properties”](#core-properties) **Drive Reference** ([`Drive`](/doc/unity/components-and-scripts/motion/drive/)): Optional override for automatic drive detection. Leave empty (null) for standard usage - the system automatically finds parent [`Drive`](/doc/unity/components-and-scripts/motion/drive/) components. Use for special cases requiring specific drive connections. **Layer** (string): Physics layer assignment (default: “rvTransport”) for transport simulation physics calculations. **Use Mesh Collider** (boolean): Controls collision precision vs performance. BoxCollider (default) provides better performance. MeshCollider enables precise collision for complex geometry. Changes apply immediately in Unity Inspector. ### Visual Properties [Section titled “Visual Properties”](#visual-properties) **Advanced Surface** (boolean): Enables belt visualization with animated textures. Works with all geometry configurations including kinematic groups. **Animate Surface** (boolean): Enables texture animation synchronized with transport speed. **Texture Scale** (float): Texture animation speed multiplier in texture units per meter. ### Constraint Management [Section titled “Constraint Management”](#constraint-management) **Change Constraints On Enter/Exit** (boolean): Modifies rigidbody constraints when objects enter/leave the transport surface. ### Hierarchical Systems [Section titled “Hierarchical Systems”](#hierarchical-systems) **Parent Drive** ([`Drive`](/doc/unity/components-and-scripts/motion/drive/)): For multi-axis systems where the transport surface moves relative to a parent drive (turntables, lifting conveyors). ## Collider Handling [Section titled “Collider Handling”](#collider-handling) TransportSurface handles collision detection automatically - it uses existing colliders when available, or creates them automatically when needed. ### Collider Management [Section titled “Collider Management”](#collider-management) **Existing Colliders**: If the TransportSurface GameObject already has colliders (BoxCollider or MeshCollider), they are used directly. **Kinematic Group Integration**: If the TransportSurface has a [`Kinematic`](/doc/unity/components-and-scripts/motion/kinematic/) component with group integration enabled: * First searches for existing colliders within the kinematic group * If existing group colliders are found, they are reused for optimal performance * If no group colliders exist, creates a combined MeshCollider based on all meshes in the entire kinematic group **Automatic Creation**: If no colliders exist and no kinematic groups are configured, TransportSurface automatically creates them at runtime using this system: 1. **Standard Collision** * **BoxCollider** (Default): Fast, reliable collision for most conveyors * **MeshCollider** (Precise): Accurate collision matching for complex shapes * Automatically calculates the right size from your geometry 2. **Fallback** * Creates basic collision even when geometry is missing * Keeps your simulation running with warnings * Prevents common “objects fall through” issues Note **Collider Strategy**: TransportSurface respects your existing collider setup. If you’ve manually added colliders to the GameObject, they will be used as-is. Automatic creation only happens when no colliders are found. ### Editor-Time Collider Switching [Section titled “Editor-Time Collider Switching”](#editor-time-collider-switching) When you toggle the **Use Mesh Collider** property in the Unity Inspector, the collider type switches immediately: * Provides visual feedback during development * Only affects the TransportSurface GameObject * Automatically handles component cleanup and creation ### Layer Management [Section titled “Layer Management”](#layer-management) All transport surface colliders are automatically assigned to the **rvTransport** layer for physics calculations. The system validates layer assignments and warns about configuration issues that could affect performance. Tip **Best Practice**: For complex CAD-imported conveyor systems, use the [`Kinematic`](/doc/unity/components-and-scripts/motion/kinematic/) component with group integration. This improves performance by sharing colliders across grouped objects. ## Advanced Surface [Section titled “Advanced Surface”](#advanced-surface) The **Advanced Surface** option enables enhanced visual representation that now works with all geometry configurations: **Universal Geometry Support:** * **Simple Objects**: Uses direct MeshRenderer/MeshFilter components * **Kinematic Groups**: Automatically handles distributed geometry across grouped objects using [`Kinematic`](/doc/unity/components-and-scripts/motion/kinematic/) components * **Complex Hierarchies**: Works with any renderer configuration in child objects When **Advanced Surface** is enabled, a child GameObject named **Belt** is created under the `TransportSurface`. This includes the `ConveyorBelt` component with animated texture effects that accurately follow surface geometry—including curves. The system automatically: * Calculates bounds from any geometry configuration (direct mesh, kinematic groups, or child renderers) * Hides original renderers appropriately based on the geometry setup * Provides error recovery if the ConveyorBelt prefab is missing * Handles both editor and runtime scenarios safely [](/doc/unity/assets/TransportSurface-Advanced.mp4) Advanced Surface with enhanced geometry support [](/doc/unity/assets/TextrueTransportSurface.mp4) Advanced Surface texture animation ## Connecting Drives to Transport Surfaces [Section titled “Connecting Drives to Transport Surfaces”](#connecting-drives-to-transport-surfaces) TransportSurface features **automatic Drive detection** that makes setup effortless and intuitive: ### Automatic Drive Connection [Section titled “Automatic Drive Connection”](#automatic-drive-connection) When you add a TransportSurface component: 1. **Flexible Drive Placement**: [`Drive`](/doc/unity/components-and-scripts/motion/drive/) component can be on the same GameObject as TransportSurface or on any parent GameObject in the hierarchy 2. **Automatic Discovery**: The system automatically searches the current GameObject and then up the hierarchy for [`Drive`](/doc/unity/components-and-scripts/motion/drive/) components 3. **Connection**: Found [`Drive`](/doc/unity/components-and-scripts/motion/drive/) components are linked to the TransportSurface 4. **Visual Feedback**: The connection is visible in the Unity Inspector 5. **Automatic Setup**: Works for standard conveyor configurations Note **Drive Placement Options**: * **Same Level**: [`Drive`](/doc/unity/components-and-scripts/motion/drive/) and TransportSurface on the same GameObject (simplest setup) * **Hierarchical**: [`Drive`](/doc/unity/components-and-scripts/motion/drive/) on parent GameObject, TransportSurface on child GameObject (common for complex systems) ![](/doc/unity/assets/Unity_bGxeoD3LEf.png) Automatic Drive connection shown in Unity Inspector ### Drives above the TransportSurface Drive - using parent Drives[](#transport-surfaces-and-unity-physics) [Section titled “Drives above the TransportSurface Drive - using parent Drives ”](#drives-above-the-transportsurface-drive---using-parent-drives) Note *ParentDrives* is only needed if *IsKinematic* Drives are moving *TransportSurfaces* in a linear direction or rotational direction, e.g. for turn tables or lifting devices. Sometimes Unity Physics is very difficult and the solution to master it is a little bit weird. As described in [Physics](/doc/unity/basics/physics/) normal movements of a linear or rotational axis are not done based *IsKinematic* Rigidbodies. The transformation is done based on the Unity hierarchy and the position of [Unity’s Transform](https://docs.unity3d.com/ScriptReference/Transform.html) because this is usually much more stable. Note The Transport Surface is different from normal linear or rotational movements of an axis. It is using pure Unity physics functions for transporting the [MUs](/doc/unity/components-and-scripts/mu-movable-unit/). This causes one problem. If it is for example necessary to combine a linear or rotational movement with the Transport Surface itself this will cause problems. Unity will not move the Transport Surface [Collider](https://docs.unity3d.com/ScriptReference/Collider.html) as expected. To prevent this the option *ParentDrive* is available on the Transport Surface: ![](/doc/unity/assets/TransportSurfaceParent.png) This option will automatically decouple the Transport Surface upon simulation start and will make a function as expected possible. During simulation, the Transportsurface will be without a parent in the top level of the hierarchy. You can see an example in the Demo model TurningAndLiftingTransportSurface which can be found under *realvirtual.io > Scenes*: ![](/doc/unity/assets/transportsurface-decoupled.png) When you build up more complex kinematic structures, make sure to always keep the gameobject with the component transport surface parallel to the kinematic structure of the other drive belonging to the surface. An further expample model is MovingTransportSurface which can also be found under *realvirtual.io > Scenes.* The picture below shows how to define such a structure. The parent drive of the transport surface is the one which is the lowest in the kinematic structure. ![](/doc/unity/assets/TransportSurfaceParent2.png) Note If the parent drive of the transport surface is rotating, the pivot points (centre of rotation) of both objects must be in the same position for the movement to be transmitted correctly. If necessary, an empty GameObject must be inserted to achieve this. ### Constraints of transported Objects [Section titled “Constraints of transported Objects”](#constraints-of-transported-objects) You can choose if the constraints of objects which enter the transportsurface have to be changed or not. Setting the boolean *ChangeConstraintsOnEnter* or *ChangeConstraintsOnExit* to true will give the possibility to that. ![](/doc/unity/assets/TransportSurfaceConstraint.png) Caution *When you change the constraints they will not be set back automatically to the former settings when the object leaves the transport surface. There you have to set ChangeConstraintsOnExit* true and define the values. Choosing *“None”* all contraints will be removed from the object. ## Troubleshooting [Section titled “Troubleshooting”](#troubleshooting) ### Objects Fall Through Transport Surface [Section titled “Objects Fall Through Transport Surface”](#objects-fall-through-transport-surface) **Symptoms**: [MUs](/doc/unity/components-and-scripts/mu-movable-unit/) pass through the conveyor instead of being transported **Solution**: Check the layer assignment in the Inspector - should be “rvTransport” **Causes and Solutions**: * **Layer Mismatch**: Click on the TransportSurface GameObject, check Layer dropdown in Inspector * **Missing Collider**: Enable “Use Mesh Collider” for complex geometry, or verify BoxCollider exists * **Kinematic Group Issues**: Ensure all CAD parts use the same `GroupName` in their [`Group`](/doc/unity/components-and-scripts/motion/group/) components **Note**: Use automatic setup to avoid manual collider creation which can cause layer issues ### Poor Performance with Complex CAD Models [Section titled “Poor Performance with Complex CAD Models”](#poor-performance-with-complex-cad-models) **Symptoms**: Frame drops, sluggish physics, or slow conveyor response **Solution**: Add [`Kinematic`](/doc/unity/components-and-scripts/motion/kinematic/) component and enable `IntegrateGroupEnable` **Performance Optimization Steps**: 1. Add [`Kinematic`](/doc/unity/components-and-scripts/motion/kinematic/) component to the TransportSurface GameObject 2. Set `IntegrateGroupEnable = true` 3. Assign the same `GroupName` to all related CAD objects 4. Switch to BoxCollider if MeshCollider isn’t essential **Performance Impact**: Can improve simulation speed by 10x for complex CAD assemblies ### AdvancedSurface Not Working [Section titled “AdvancedSurface Not Working”](#advancedsurface-not-working) **Symptoms**: Enhanced belt visuals don’t appear or have wrong dimensions **Diagnosis**: Check Console for “ConveyorBelt prefab not found” errors **Solutions by Cause**: * **Missing Prefab**: ConveyorBelt prefab must exist in Resources folder * **No Geometry Bounds**: Add Renderer components or verify kinematic group setup * **Kinematic Group Issues**: Check that group names match across all [`Group`](/doc/unity/components-and-scripts/motion/group/) components **Note**: Test AdvancedSurface with simple geometry first, then apply to complex models ### Drive Connection Issues [Section titled “Drive Connection Issues”](#drive-connection-issues) **Symptoms**: Conveyor doesn’t move, speed not synchronized, or no movement response **Solution**: Check that [`Drive`](/doc/unity/components-and-scripts/motion/drive/) component exists on the same GameObject or parent GameObjects **Connection Troubleshooting**: 1. **Drive Placement**: [`Drive`](/doc/unity/components-and-scripts/motion/drive/) must be on the same GameObject as TransportSurface OR on a parent GameObject (not sibling objects) 2. **Multiple Drives**: Set **Drive Reference** property to specify which [`Drive`](/doc/unity/components-and-scripts/motion/drive/) to use 3. **Drive Configuration**: Verify [`Drive`](/doc/unity/components-and-scripts/motion/drive/) component is enabled and properly configured 4. **Hierarchy Check**: Ensure TransportSurface can “see” the [`Drive`](/doc/unity/components-and-scripts/motion/drive/) in its hierarchy path **Note**: Use supported hierarchy structures: * **Simple**: [`Drive`](/doc/unity/components-and-scripts/motion/drive/) + TransportSurface on same GameObject * **Hierarchical**: [`Drive`](/doc/unity/components-and-scripts/motion/drive/) (parent) → TransportSurface (child or descendant) Tip **Performance Tip**: For large-scale transport systems, group related CAD objects using the [`Kinematic`](/doc/unity/components-and-scripts/motion/kinematic/) component. This eliminates individual colliders and can improve performance by 10x. © 2025 realvirtual [https://realvirtual.io](https://realvirtual.io/) - All rights reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or by any means, including printing, saving, photocopying, recording, or other electronic or mechanical methods, without the prior written permission of the publisher. # MU, Source and Sink > (Movable Unit) Movable Units (MUs) are objects that move freely around in the scene. They can be picked or loaded and they can be placed on Transport Surfaces.[ MUs](https://game4automation.com/documentation/current/mu.html) are created by a [Source](/doc/unity/components-and-scripts/mu-movable-unit/source/) and deleted by a [Sink](/doc/unity/components-and-scripts/mu-movable-unit/sink/). The MU script is automatically attached to all objects created by a [Source](/doc/unity/components-and-scripts/mu-movable-unit/source/). As a user, you don’t need to interact with the MU script at all, except when the script itself publishes information or requests some input. This is the Inspector Window for an MU script: ![](/doc/unity/assets/mu-inspector.png) ### Properties[](#properties) [Section titled “Properties ”](#properties) **ID, GlobalID (Readonly)** Each MU automatically receives a global ID (this is globally unique) and a source ID (this is only unique to the Source). **MU Appearance** List of differnt MU appearances, used by the [Part Changer](/doc/unity/components-and-scripts/changing-mus/partchanger/). **Fixed By (Readonly)** Fixer/Gripper which is currently fixing the MU. **Last Fixed By (Readonly)** Fixer/Gripper which has been fixing the MU last time. **Loaded On (Readonly)** MU where this MU is loaded on. **Standard Parent (Readonly)** Parent Gameobject before MU has been loaded. **Parent before Fix (Readonly)** Parent Gameobject before MU has been Gripped / Fixed. **Collided with Sensors (Readonly)** Current Sensors which are colliding with this MU. **Loaded MUs (Readonly)** Current loaded MUs on this MU. **Surface Align Smoothment** Smoothment parameter for aligning MU with Transport Surface - only used by realvirtual.io Simulation. **Unfix Speed Interpolate** Normally, if a Gripper is opening, an MU will directly fall down without a horizontal movement, even if the Gripper has a speed when opening. With this speed interpolate, the speed of movement before opening the Gripper is interpolated and transfered to the MU when opening the Gripper. With this it is possible to “throw” objects. ### Events [Section titled “Events”](#events) Events can be used if your are programming your own scripts and you want to be notified about certain events. **Event MU Deleted** Event when the MU is going to be deleted. **Event MU Is Loaded** Event when the MU is loaded on another MU. **Event MU Gets Load** Event when an MU is loaded on this MU. **Event MU Sensor** Event if the MU is colliding with a Sensor. © 2025 realvirtual GmbH [https://realvirtual.io](https://realvirtual.io/) - All rights reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or by any means, including printing, saving, photocopying, recording, or other electronic or mechanical methods, without the prior written permission of the publisher. # Sink A Sink is responsible for deleting [MUs](/doc/unity/components-and-scripts/mu-movable-unit/). Using a Box Collider, the Sink deletes all colliding ([MUs](/doc/unity/components-and-scripts/mu-movable-unit/)): ![](/doc/unity/assets/sink.png) If needed, the Sink can be controlled by a Signal *Delete*. This will activate and deactivate the Sink. The same can be done with the setting *Delete Mus*. If you define a Tag under *Delete Only Tag* only [MUs](/doc/unity/components-and-scripts/mu-movable-unit/) with the specific Tag will be deleted. > Please take care that the Sink is situated on the correct layer, to enable collision detection. Usually the sink should be placed on the rvSensor Layer (before 2022 g4aSensor Layer). Please check the [Realvirtual.io Class Reference](https://realvirtual.io/apidoc/classrealvirtual_1_1_sink.html) for more information about the properties and methods of this component. © 2025 realvirtual GmbH [https://realvirtual.io](https://realvirtual.io/) - All rights reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or by any means, including printing, saving, photocopying, recording, or other electronic or mechanical methods, without the prior written permission of the publisher.\\ # Source ![](/doc/unity/assets/Source_2.png) By using a Source script, new movable units [(MUs)](/doc/unity/components-and-scripts/mu-movable-unit/) can be generated. MUs can be generated in intervals or automatically generated once the last generated [MU](/doc/unity/components-and-scripts/mu-movable-unit/) has travelled a certain distance away from the source. This is useful to automatically generate[ MUs](/doc/unity/components-and-scripts/mu-movable-unit/) on a conveyor. The object with the Source script attached to, is like a template. Each time a [MU](/doc/unity/components-and-scripts/mu-movable-unit/) is created, the Source creates a new instance of the object under the defined root `Destination` in the scene hierarchy. This tutorial shows how to create a custom source: [Tutorial custom sources](https://www.youtube-nocookie.com/embed/3bquTLyGx3k) Tutorial custom sources The source can also manually create [(MUs)](/doc/unity/components-and-scripts/mu-movable-unit/) when you press “C”. The source will delete all generated [(MUs)](/doc/unity/components-and-scripts/mu-movable-unit/) when you press “D” on the keyboard. This is the property window of the source: ![](/doc/unity/assets/source-inspector.png) ### Properties[](#properties) [Section titled “Properties ”](#properties) #### This Object as MU [Section titled “This Object as MU”](#this-object-as-mu) Defines which part should be generated. Should normally point to the same GameObject where the source component itself is attached to. This is also the standard setting. **Note:** Collider enabled/disabled states are preserved from this template when generating MUs. To disable specific colliders on generated MUs, simply disable them in the template prefab before starting the simulation. #### Destination [Section titled “Destination”](#destination) When the source is generating a new MU it can be placed as a sub Gameobject under the defined Destination Gameobject. #### Enabled [Section titled “Enabled”](#enabled) Must be set to true for the source to work. #### Freeze Source Position [Section titled “Freeze Source Position”](#freeze-source-position) Should be usually set to true - the source will not change its position. #### Don’t Visualize [Section titled “Don’t Visualize”](#dont-visualize) Hides the source so that only the created MUs are visible. #### Mass [Section titled “Mass”](#mass) Sets the Mass of the created MUs. #### Set Center of Mass [Section titled “Set Center of Mass”](#set-center-of-mass) Sets the Center of Mass of the created MUs. #### Center of Mass [Section titled “Center of Mass”](#center-of-mass) The Center of Mass. #### Generate on Layer [Section titled “Generate on Layer”](#generate-on-layer) Unity Layer where the MU should be placed to after creation. #### On Create Destroy Components [Section titled “On Create Destroy Components”](#on-create-destroy-components) Maybe some scripts on the MU, which is a copy of the source, should be destroyed when the MU is created. You can define here the components to be destroyed. #### Create in Interval [Section titled “Create in Interval”](#create-in-interval) Creates MUs in a constant interval in seconds. If the value is 0 this option is not used. #### Automatic Generate On Distance [Section titled “Automatic Generate On Distance”](#automatic-generate-on-distance) Automatically creates new MUs when the distance of the last created MU is greater than the defined value. Optionally the distance can be also randomly (equally distributed) between the defined Distance (“Generate if Distance”) plus / minus the “Range Distance”. #### Number of MUs [Section titled “Number of MUs”](#number-of-mus) Limits the number of generated MUs. #### SourceIOs [Section titled “SourceIOs”](#sourceios) Gernarate MU - should be turned on for making the source work. #### Source Signals [Section titled “Source Signals”](#source-signals) PLCOutputBool Signal (e.g. from a PLC) for generating MUs. #### Events [Section titled “Events”](#events) Unity Event which can be used for custom scripts which are called when an MU is created. ### Template Behavior [Section titled “Template Behavior”](#template-behavior) The Source GameObject acts as a non-physical template during simulation: **Collider Handling:** * All colliders on the template are automatically disabled when the simulation starts * The initial enabled/disabled state of each collider is preserved from your prefab configuration * When MUs are generated, each collider’s original state is restored * This includes colliders on inactive child GameObjects **Practical Use:** * To have a collider disabled on generated MUs, simply disable it in the template prefab before simulation starts * To have a collider enabled on generated MUs, ensure it’s enabled in the template prefab * Inactive child GameObjects maintain their hierarchy state and collider configurations **Visibility:** * The template’s visual representation can be hidden using the **Don’t Visualize** property * Even when hidden, the template remains in the scene as the blueprint for MU generation **Physics:** * The template does not participate in physics simulation * Generated MUs have full physics interaction (collisions, rigidbodies, etc.) * Use **Freeze Source Position** to prevent the template from moving #### Public Interfaces [Section titled “Public Interfaces”](#public-interfaces) If script is attached to the Gameobject of the MU, which implements the Interface “ISourceCreated” a Method “OnSourceCreated” is called on the MU when it has been created by the MU. #### Public properties and methods [Section titled “Public properties and methods”](#public-properties-and-methods) Please check the [Realvirtual.io Class Reference](https://realvirtual.io/apidoc/classrealvirtual_1_1_source.html) for more information about the properties and methods of this component. © 2025 realvirtual GmbH [https://realvirtual.io](https://realvirtual.io/) - All rights reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or by any means, including printing, saving, photocopying, recording, or other electronic or mechanical methods, without the prior written permission of the publisher. # Performance Tools # Combine Meshes (Pro) > >- ## Combine Meshes [Section titled “Combine Meshes”](#combine-meshes) ### Introduction [Section titled “Introduction”](#introduction) After importing CAD data into a Unity scene, you often end up with a deeply nested and complex GameObject hierarchy. Meshes may be stored directly in the scene or as assets in your project, depending on the import method. To prepare the scene for real-time applications and ensure optimal performance, it’s often beneficial to **reduce the number of GameObjects** and **minimize draw calls**. This can be achieved using the `Combine Meshes` utility—especially when meshes share a **limited and unified set of materials** that already exist as assets. ### Overview [Section titled “Overview”](#overview) The `Combine Meshes` utility enables you to **combine multiple meshes into a single mesh**, significantly reducing draw calls and improving rendering performance. > ℹ️ **Note:** This is particularly useful for: > > * **Reusable prefabs**, where a simplified internal structure is desired. > * **Final optimization at the end of a project**, where rendering performance is critical. > > ⚠️ **Warning:** After combining, **you will no longer have access to the individual mesh parts**. Consider creating a backup or duplicating the original GameObjects before using this function. Here is an example of an unoptimized scene: ![](/doc/unity/assets/mesh-unoptimized.png) Unoptimized structure after CAD Import ### Kinematic and Drive Group Awareness [Section titled “Kinematic and Drive Group Awareness”](#kinematic-and-drive-group-awareness) The `Combine Meshes` utility **automatically respects kinematic groupings and drive mechanisms** defined in the scene. This means: * Only **non-moving parts** or parts that move **together as a single unit** are combined. * Meshes involved in **kinematics or driven motions** (e.g., robotic arms, sliding doors) are **not combined across movement boundaries**, preserving functionality. This ensures that performance optimizations do not interfere with the behavior of simulated machinery or driven components. ### How to Use [Section titled “How to Use”](#how-to-use) 1. **Select GameObjects**\ In the Unity Hierarchy, select the GameObjects whose meshes you want to combine. 2. **Run Combine Meshes**\ Right-click on the selection and choose:\ \&#xNAN;**`realvirtual/Combine Meshes`** ![](/doc/unity/assets/mesh-combinemeshes.png) Combine meshes in the Gameobject context menu 3. **Result**\ The selected GameObjects will have their meshes merged into a single optimized mesh, improving rendering performance. ![](/doc/unity/assets/meshcombined.png) Simplified structure after mesh combine > 💡 **Tip:** For best results, ensure that all selected meshes use shared materials that are already available as assets in your project. ### Next Step: Create Prefab [Section titled “Next Step: Create Prefab”](#next-step-create-prefab) If you intend to **reuse the combined mesh** as a component in other scenes or projects, continue with the [Create Prefab](/doc/unity/components-and-scripts/performance-tools/create-prefab-pro/) section. This will guide you through turning the optimized GameObject into a reusable, self-contained prefab. # Create Prefab (Pro) ### Introduction [Section titled “Introduction”](#introduction) While Unity provides a standard prefab workflow, **realvirtual goes a step further** with its own **Create Prefab** function. This tool is designed specifically for **industrial simulation workflows**, allowing you to generate **self-contained, reusable assets** that include not only meshes and hierarchy but also the logic components that define behavior—such as drives, signals, sensors, and automation interfaces. > 💡 **Hint:** You should typically use this function **after preparing and optimizing your GameObject**—for example, after using Combine Meshes—to turn it into a **lightweight, modular component**. ### Overview [Section titled “Overview”](#overview) The `Create Prefab` function in realvirtual creates a prefab asset that includes: * The complete **GameObject hierarchy** * All associated **meshes** (combined or separate) * All attached **realvirtual components**, such as: * Drives * Signals * Sensors * Kinematic groups * Custom logic or automation interfaces This ensures the prefab is fully portable and ready for use in any simulation context built with realvirtual. ### Scene Mesh Handling [Section titled “Scene Mesh Handling”](#scene-mesh-handling) Unlike Unity’s standard workflow, realvirtual’s `Create Prefab` works seamlessly even when: * Meshes are still **embedded in the scene**, for example after a **CADLink import** * Meshes have been **combined** using the Combine Meshes utility It acts similarly to an **FBX export**, but instead of creating an external file, it generates a single prefab **containing all geometry, hierarchy, and logic in one asset**—ready for reuse and versioning in your simulation workflows. ### When to Use [Section titled “When to Use”](#when-to-use) * After optimizing an imported CAD structure * When creating **reusable standard components** * When preparing modular assets for **parts libraries or versioned assets** * Before exporting or distributing simulation-ready components ### How to Use [Section titled “How to Use”](#how-to-use) 1. **Select the root GameObject**\ Choose the GameObject that includes all child objects and components you want to include in the prefab. 2. **Run Create Prefab**\ Right-click on the selection in the Hierarchy and choose:\ \&#xNAN;**`realvirtual/Create Prefab`** ![](/doc/unity/assets/mesh-createprefab.png) Create prefab in Gameobject context menu 3. **Result**\ The prefab will be automatically created under the **`Assets/`** folder of your project. ![](/doc/unity/assets/mesh-exportedprefab.png) Exported prefab 3. **Organize**\ If needed, manually **move the prefab** to your desired location within the Unity project (e.g., `Assets/Prefabs/[ExportedPrefab]`). > 📦 The resulting `.prefab` file contains the full structure, geometry, and behavior. It’s fully reusable across scenes and projects and supports realvirtual’s simulation features out of the box. # Hierarchy Cleanup (Pro) # Mesh Optimizer > The Mesh Optimizer is only included in Professional Version Note Use only if reimporting the STEP file with correct settings is not possible. This optimizer reduces quality. When importing CAD data, even with low import quality settings, a significant number of polygons can be present, resulting in unnecessary level of detail in certain areas. To address this, the Mesh Optimizer can be utilized to optimize the imported meshes without altering their individual characteristics. ![](/doc/unity/assets/MeshOptimizerDialog.png) To access the Mesh Optimizer, navigate to the game4automation main menu and select “Mesh Optimizer.” Open the tool and choose the mesh that requires optimization. Adjust the desired quality level using the “Quality” slider. It is advisable to test the settings using the “Optimize” button before proceeding. Once satisfied, save the optimized mesh by selecting “Finalize Mesh.” At this point, only the optimized mesh will be available in the scene. The optimization process offers the following adjustable parameters: | attribute | function | | ------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Loss less | simplifies the mesh without losing too much quality. Definied quality won't be taken into consideration. | | Quality | simplifies the mesh to the set quality | | Enable SmartLink | If smart linking is enabled, it means that when two edges of triangles in a mesh are not directly connected through mesh indices, but are located at the same 3D position, a process called smart linking can identify and connect these edges to avoid creating holes in the mesh. Enabling smart linking increases the computational cost of the simplification process, but it is generally recommended for most meshes. | | Preserve BorderEdges | If preserving border edges is desired, it means that edges that are not shared by two triangles (essentially the outer edges of the mesh) should be kept intact during the simplification process. Enabling this feature prevents the simplification algorithm from modifying these edges. However, preserving border edges may lead to suboptimal mesh simplification results and could potentially introduce holes or strange artifacts along the borders. It is generally recommended to prioritize enabling smart linking instead of preserving border edges. | | Preserve UV SeamEdges | If preserving UV seam edges is desired, it means that edges that have differences in their UV coordinates and are connected through smart linking should be kept intact during the simplification process. Enabling this feature prevents the simplification algorithm from modifying these edges. While it may result in suboptimal mesh simplification, preserving UV seam edges can help prevent issues related to UV seams and improve the visual quality of the result. It is important to note that this feature only works when smart linking is enabled. | | Preserve UV FoldoverEdges | If preserving UV foldover edges is desired, it means that edges with identical UV coordinates that are connected through smart linking should be kept intact during the simplification process. Enabling this feature prevents the simplification algorithm from modifying these edges. While it may result in suboptimal mesh simplification, preserving UV foldover edges can help prevent issues related to UV seams and improve the visual quality of the result. It is important to note that this feature only works when smart linking is enabled. | | Agressivness | The agressiveness of the mesh simplification. You could experiment with this value if you find your simplification being very ineffective. | # Performance Optimizer > Performance Optimizer is only included in Professional Version The excessive use of separate meshes in Unity can significantly affect performance. To mitigate this impact, it is possible to combine these meshes into a single mesh as long as they are part of a common kinematic group and are not moving independently. Note Combining meshes is a powerful feature that can significantly improve performance in large models. This can result in up to 4 times faster performance. However, it is not recommended for smaller models. The Performance Optimizer can be applied to any Gameobject, typically at the top level of the imported CAD data. All its child meshes are taken into account during the optimization process. The optimizer considers whether a Gameobject is part of a [Group ](/doc/unity/components-and-scripts/motion/group/)and if that group is assigned to a [Kinematic](/doc/unity/components-and-scripts/motion/kinematic/). For each “Kinematic Group,” a single optimized mesh is generated and named after the group. The optimized mesh is automatically set as non-Static. ![](/doc/unity/assets/performanceoptimizer.png) If a Gameobject is part of a group that is not used in a [Kinematic ](/doc/unity/components-and-scripts/motion/kinematic/)and the “Combine Non-Kinematic Groups” option is turned on, a separate optimized mesh is generated. This mesh is set as Static. Optimization is initiated by clicking the `Optimize` button. The combined meshes resulting from the optimization process can be found as children of the `OptimizedMeshes` Gameobject. Please note that after optimization, the original meshes are deactivated but the corresponding Gameobjects remain in the hierarchy. All previously defined colliders will remain active. The optimization process can be undone by clicking the `Undo Optimize` button. ## Properties [Section titled “Properties”](#properties) #### IsOptimized (readonly) [Section titled “IsOptimized (readonly)”](#isoptimized-readonly) This property indicates whether the meshes have been optimized or not. #### NumOptimziedMeshes (readonly) [Section titled “NumOptimziedMeshes (readonly)”](#numoptimziedmeshes-readonly) This property provides the number of meshes that have been optimized as a result of the optimization process. #### NumUnOptimziedMeshes (readonly) [Section titled “NumUnOptimziedMeshes (readonly)”](#numunoptimziedmeshes--readonly) This property provides the number of meshes that have not been optimized. #### Ignore Groups [Section titled “Ignore Groups”](#ignore-groups) This property allows you to specify the groups that should be ignored during the optimization process. By default, all groups are considered during the optimization process. #### Ignore Hidden Object [Section titled “Ignore Hidden Object”](#ignore-hidden-object) This property allows you to ignore hidden objects during the optimization process. By default, hidden objects are considered during the optimization process. If Hidden Objects are ignored, they are not part of the resulting combined mesh. #### Combine Non Kinematic Groups [Section titled “Combine Non Kinematic Groups”](#combine-non-kinematic-groups) This property allows you to combine the meshes of groups that are not assigned to a Kinematic. By default, only the meshes of groups assigned to a Kinematic are combined. #### Ignored Groups [Section titled “Ignored Groups”](#ignored-groups) In this list you can define groups which should be totally ignored and not be part of the combined mesh. These Groups remain fully active inside the structure. ## Keeping Meshes Out of the Optimization [Section titled “Keeping Meshes Out of the Optimization”](#keeping-meshes-out-of-the-optimization) Note The Performance Optimizer Exclude component and the protection of selectable and interactable parts were added in realvirtual **6.3.6** (Professional). Some parts must keep their own mesh in an optimized scene - for example because their material or visibility changes at runtime, or because a script, a highlight or a selection refers to them. The optimizer takes care of this in three ways. **Performance Optimizer Exclude** (component menu **realvirtual → Tools → Performance Optimizer Exclude**) Add this component to every GameObject whose mesh must not be combined. The marked meshes are not baked into a combined mesh, stay visible as they are and survive **Finalize Optimization**. Everything else below the Performance Optimizer is combined as usual. * **Include Children** (boolean) If set to true, all meshes below this GameObject are excluded as well. If set to false, only the mesh on this GameObject is excluded. **Scene Selectables** The renderers a [Scene Selectable](/doc/unity/components-and-scripts/scene-interaction/scene-selectables-pro/) refers to are excluded automatically. Selecting and highlighting these parts keeps working after the optimization and after **Finalize Optimization** - you do not need to add an Exclude component. **Runtime Interactables** The meshes below a **Runtime Interactable** (for example from [Runtime Metadata](/doc/unity/components-and-scripts/scene-interaction/runtime-metadata/)) are still combined, but into a separate mesh that stays below the interactable instead of being merged into the large group mesh. Highlighting and picking these parts therefore keeps working in the optimized scene. # Picking and Placing MUs Components for handling, gripping, and manipulating MUs (Movable Units) in automation systems. ## Available Components [Section titled “Available Components”](#available-components) ### Gripping Systems [Section titled “Gripping Systems”](#gripping-systems) * **[Grip](/doc/unity/components-and-scripts/picking-and-placing-mus/grip/)** - Primary component for individual grip points (recommended for most use cases) * **[Gripper](/doc/unity/components-and-scripts/picking-and-placing-mus/gripper/)** - Advanced gripper system for complex multi-point gripping ### Positioning and Fixturing [Section titled “Positioning and Fixturing”](#positioning-and-fixturing) * **[Fixer](/doc/unity/components-and-scripts/picking-and-placing-mus/fixer/)** - Primary component for temporarily fixing MUs in positions (recommended for most use cases) * **[Pattern](/doc/unity/components-and-scripts/picking-and-placing-mus/pattern/)** - Defines positioning patterns for organized placement of multiple MUs ## Key Features [Section titled “Key Features”](#key-features) * **Physics Integration**: Realistic gripping with collision detection and weight handling * **PLC Integration**: Full integration with PLCInputBool/PLCOutputBool signals for industrial control * **Sensor Integration**: Works with sensors for grip confirmation and positioning feedback * **Logic Integration**: Seamless connection with Logic Steps and automation sequences ## See Also [Section titled “See Also”](#see-also) * [MU (Movable Unit)](/doc/unity/components-and-scripts/mu-movable-unit/) - Base MU functionality * [Motion](/doc/unity/components-and-scripts/motion/) - Drive systems for gripper movement * [Sensors](/doc/unity/components-and-scripts/sensors/) - Sensor integration for feedback * [Logic Steps](/doc/unity/components-and-scripts/defining-logic/logicsteps/) - Automation sequence programming # Fixer The fixer is a component that is normally not controlled by a PLC signal. With a fixer you can fix [MUs](/doc/unity/components-and-scripts/mu-movable-unit/) (as subcomponents) at any location. When [MUs](/doc/unity/components-and-scripts/mu-movable-unit/) are fixed the Physics and Gravity for the MUs is turned of and the MUs will stay at the current location. This can be used if you would like for example to place parts on other moving parts. If a MU which is currently fixed by a gripper is entering the Fixer detection area nothing will happen as long as the Gripper ([Grip script](/doc/unity/components-and-scripts/picking-and-placing-mus/grip/)) is still holding the MU. As soon as the Gripper will release the MU, the MU will be fixed by the Fixer. If a MU is fixed by a fixer and another fixer collides with the MU, the MU is handed over to the last collided fixer. This handover behavior can be prevented by setting *Block Handing Over* or the signal *Signal Block Handing Over* to true. MU tags and the restriction to certain tags can also be used to realize more advanced functions. The Fixer can work with a Box Collider or with a Raycast to detect components that need to be fixed. ### Grip-Fixer Handover Pattern [Section titled “Grip-Fixer Handover Pattern”](#grip-fixer-handover-pattern) Fixer automatically receives MUs released by Grip components, enabling precise final positioning: 1. **Grip** (active) - Picks and transports MU to the target location 2. **Grip releases** - Opens and releases the MU (PlaceObjects = true) 3. **Fixer** (passive) - Automatically catches and positions MU with exact alignment Use **Align MU**, **Delta Align**, and **Delta Rot** properties to control the precise final position of the MU. This pattern combines dynamic transport (Grip) with stationary precision positioning (Fixer). ### Multi-Part Holding [Section titled “Multi-Part Holding”](#multi-part-holding) Fixer can hold **multiple MUs simultaneously**, making it ideal for: * **Tool wheels** - Multiple tools fixed in circular arrangement around the fixer * **Magazines** - Stacked parts or buffer positions * **Pallets** - Multiple products positioned on a single pallet Each fixed MU is positioned according to the Fixer’s alignment settings (Delta Align and Delta Rot). Note You need to take care, that the Layer is set to the correct value. If you use a Box Collider it is usually “rvSensor” (before 2022”*g4A Sensor*”). If you use a Raycast it is usually “rvMU” (before 2022 “g4A MU”) or “rvMUSensor” (before 2022 “g4A SensorMU”). Open the [Demo Scenes Browser](/doc/unity/basics/user-interface/demo-scenes-browser/) and look under **Object Handling** for gripping and fixing demos. ![](/doc/unity/assets/fixer.png) ### Properties[](#properties) [Section titled “Properties ”](#properties) ![](/doc/unity/assets/fixer-properties.png) #### Use Raycast [Section titled “Use Raycast”](#use-raycast) If set to true a Raycast is used to detect the MUs. **Limit to Tags**\ The fixer can be restricted to react only to certain MUs. In this list all MU tags can be defined that should be considered. **Fix MU**\ Needs to be set to true for fixing the MUs. **Align and fix on min distance**\ If set to true, the parts which are entering are only fixed, when the distance to the fixer pivot point is not decreasing anymore. This can be used, for example, to align parts exactly on a Transport Surface. **Release on collision non MU**\ Will release the Fixer when a collider that is not an MU is entering the Fixer area. **Align MU**\ Will align the MU pivot point with the Fixer pivot point when the MUs are fixed. **Delta Align**\ Defines a Delta position on the pivot points for Alignment. **Delta Rot**\ Defines a Delta rotation on the pivot points for Alignment. **Set Tag after Fix**\ Automatically sets the MU tag to a certain name after the MU is fixed. Keep it empty if nothing should happen. **Show Status**\ Shows the status of the Fixer by changing the color between red (not fixed) and green (fixed). **Block Handing Over** Blocks the Fixer to hand over the MU to another Fixer (does not affects grippers). **One Bit fix**\ If set to true, the Input Signals are limited to one Input - Fixer Fix, which will Fix on true and unfix on false. **Fixer Release**\ If this PLC signal is connected and if it is true, the Fixer will release all MUs and MUs which are entering will not be fixed. **Fixer Fix**\ Contrary to Fixer Release. **Signal Block Handing Over** PLC Signal for blocking the handing over to another Fixer. © 2025 realvirtual GmbH [https://realvirtual.io](https://realvirtual.io/) - All rights reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or by any means, including printing, saving, photocopying, recording, or other electronic or mechanical methods, without the prior written permission of the publisher. # Grip Note The Grip component was redesigned in realvirtual **6.3** with a new Simple Mode / Advanced Mode interface. If you are upgrading from 6.0, enable **Advanced Mode** to access the legacy properties you are familiar with. ## Overview [Section titled “Overview”](#overview) The Grip component picks and places [MUs (Movable Units)](/doc/unity/components-and-scripts/mu-movable-unit/) using automation signals or [LogicSteps](/doc/unity/components-and-scripts/defining-logic/logicsteps/). It is essential for attaching MUs to grippers, robot end-effectors, or any moving component driven by a drive system. Grip offers two Inspector modes: * **Simple Mode** (default) — streamlined interface for the most common pick-and-place scenarios * **Advanced Mode** — reveals all properties for sensor-based detection, cylinder-based picking, and fine-grained placement control ## Simple Mode [Section titled “Simple Mode”](#simple-mode) ![](/doc/unity/assets/grip-simple-inspector.png) Grip in Simple Mode In Simple Mode, Grip uses an **OverlapSphere** with the configured **Grip Range** to automatically find the nearest MU. No sensor is required — just position the Grip near the MU and trigger a pick. ### How Picking Works [Section titled “How Picking Works”](#how-picking-works) When **Pick Objects** changes from `false` to `true` (or **Signal Pick** receives a positive flank), the Grip performs an OverlapSphere at its position with the **Grip Range** radius. Only objects on the `rvMU` physics layer are detected. The nearest free MU (not already held by another Grip or Fixer) is selected. The picked MU becomes a **child of the Grip GameObject** in the hierarchy. Its Rigidbody is set to kinematic — physics and gravity are turned off so the MU moves rigidly with the gripper. The MU appears in the **Picked MUs** list. ### How Placing Works [Section titled “How Placing Works”](#how-placing-works) When **Pick Objects** changes back to `false` (or **Signal Pick** receives a negative flank), the Grip releases all held MUs. In Simple Mode, the **Auto** placement cascade runs automatically: 1. **GripTarget** — Searches for a free [GripTarget](/doc/unity/components-and-scripts/picking-and-placing-mus/griptarget/) within 500 mm. If found, the MU snaps to the target’s position/rotation and becomes its child. Physics stays off. 2. **MU below** — Raycasts downward (up to 1000 mm). If another MU is hit, the released MU is loaded onto it as a child. Physics stays off. 3. **TransportSurface below** — If the raycast hits a transport surface (conveyor), the MU is released with **physics enabled** — it falls onto the conveyor and is transported. 4. **Nothing found** — The MU stays frozen at its current position (kinematic, no physics). This cascade means Simple Mode handles the most common scenarios automatically — placing on a GripTarget, stacking parts on other MUs, dropping onto conveyors, or holding in position. Note In Simple Mode, the **Place Mode** is always **Auto** and the search/raycast distances use their defaults (500 mm / 1000 mm). Switch to **Advanced Mode** to change the placement behavior or adjust these distances. ### Properties [Section titled “Properties”](#properties) **Active** (enum) Controls when this component is active in the simulation (Always, Edit Mode only, etc.). **Advanced Mode** (boolean) Toggle to reveal all properties. When unchecked, only the essential Simple Mode properties are shown. **Grip Range** (float) The detection radius in millimeters. Grip uses a sphere overlap to find the nearest MU within this range. Default: 10 mm. **Pick Objects** (boolean) Set to `true` to pick the nearest MU within the Grip Range. Reacts on the rising edge only (false → true). **Place Objects** (boolean) Set to `true` to release all currently picked MUs. In Simple Mode this is automatically toggled when Pick Objects changes. **Signal Pick** (PLCOutputBool) PLC signal to control picking. A positive flank (false → true) picks, a negative flank (true → false) places. **Show Gizmo** (boolean) Displays the Grip Range sphere in the Scene view for visual debugging. **Picked MUs** (list, read-only) Shows all MUs currently held by this Grip. ## Advanced Mode [Section titled “Advanced Mode”](#advanced-mode) ![](/doc/unity/assets/grip-advanced-inspector.png) Grip in Advanced Mode Enable **Advanced Mode** to access the full set of properties. This includes all Simple Mode properties plus the sections below. ### Pick Detection [Section titled “Pick Detection”](#pick-detection) **Part To Grip** (Sensor) Optional sensor to identify which MU to grip. When assigned, only MUs detected by this sensor are considered. **Directly Grip** (boolean) If `true`, the MU is gripped immediately when the sensor detects it. **Pick Align With Object** (GameObject) Aligns the MU pivot to this object’s position and rotation before picking. **Align Rotation** (boolean) Also aligns the rotation when picking (used with Pick Align With Object). **Pick Based On Sensor** (Sensor) Picking starts when this additional sensor is occupied. **Pick Based On Cylinder** (Drive\_Cylinder) Picking starts based on the position of a cylinder drive. **Pick On Cylinder Max** (boolean) If `true`, picking starts when the cylinder reaches maximum position. If `false`, at minimum position. ### Place Mode [Section titled “Place Mode”](#place-mode) **Place Mode** (enum) Controls how MUs are placed when released: * **Auto** — Runs the placement cascade described above (GripTarget → MU below → TransportSurface → kinematic fallback). Physics is only enabled when placing on a TransportSurface; all other placements keep the MU kinematic. * **Static** — MU stays exactly where the gripper leaves it. Physics and gravity remain off (kinematic). The raycast cascade is skipped entirely. * **Physics** — MU gets gravity and physics enabled on release and falls naturally. Velocities are reset to zero first so the MU does not fly away with the gripper’s motion. The raycast cascade is skipped entirely. **Grip Target Search Radius** (float) Detection range in millimeters for finding nearby [GripTargets](/doc/unity/components-and-scripts/picking-and-placing-mus/griptarget/) during Auto placement. Default: 500 mm. **Raycast Distance** (float) Distance in millimeters for the downward raycast used to detect surfaces and MUs below during Auto placement. Default: 1000 mm. **No Physics When Placed** (boolean) Legacy property. If `true`, bypasses the Auto placement cascade and releases the MU with physics re-enabled at its current position. **Place Align With Object** (GameObject) Aligns MU pivot to this object’s position and rotation before releasing. **Place Load On MU** (boolean) If `true`, the placed MU becomes a child of the MU it is placed on, creating a load-on-MU relationship. **Connect To Joint** (Joint) Optional Unity Joint for physical joint-based gripping instead of hierarchy parenting. ### Pick & Place Control [Section titled “Pick & Place Control”](#pick--place-control) **Pick Objects** (boolean) Set to `true` to pick MUs. **Place Objects** (boolean) Set to `true` to place MUs. **One Bit Control** (boolean) If `true`, a single signal toggles between pick and place. If `false`, separate signals for pick and place are used. **Signal Pick** (PLCOutputBool) Signal to control picking (positive flank = pick). **Signal Place** (PLCOutputBool) Signal to control placing (positive flank = place). Only used when One Bit Control is `false`. ### Events [Section titled “Events”](#events) **Event MU Grip** (UnityEvent) Triggered when an MU is gripped or released. Passes the MU and `true` for grip, `false` for release. ## GripTarget Integration [Section titled “GripTarget Integration”](#griptarget-integration) When **Place Mode** is set to **Auto**, the Grip automatically searches for [GripTarget](/doc/unity/components-and-scripts/picking-and-placing-mus/griptarget/) components within the **Grip Target Search Radius**. If a free GripTarget is found, the MU snaps to the target’s position and rotation and becomes a child of the GripTarget. See [GripTarget](/doc/unity/components-and-scripts/picking-and-placing-mus/griptarget/) for details on setting up placement slots. ## GripTarget vs Fixer [Section titled “GripTarget vs Fixer”](#griptarget-vs-fixer) Both components handle MU placement, but serve different purposes: | | GripTarget | Fixer | | --------------------- | --------------------------------------- | ------------------------------------------------------------------ | | **Purpose** | Passive placement slot (“parking spot”) | Active station lock (“parking gate with lock”) | | **Needs Grip?** | Yes, always — only works with Grip | No — works standalone | | **MU arrives how?** | Grip places it | Conveyor, AGV, or robot delivers it | | **Controlled by** | Grip component logic | PLC signals (FixerFix/FixerRelease) or auto-mode | | **Detection** | None — found by Grip’s OverlapSphere | Own BoxCollider trigger or Raycast | | **MU parenting** | MU becomes child of GripTarget | MU becomes child of Fixer (restored to previous parent on release) | | **Multi-MU** | One MU per target | Multiple MUs via MUSFixed list | | **Handover blocking** | No | Yes — prevents double-fixing between stations | | **Tag filtering** | No | Yes — only fix specific part types | **Use GripTarget** when a Grip (robot gripper) places MUs at predefined positions. **Use [Fixer](/doc/unity/components-and-scripts/picking-and-placing-mus/fixer/)** when MUs arrive on their own (conveyor) and need to be stopped/held by PLC control. ## Demo Scenes [Section titled “Demo Scenes”](#demo-scenes) ![](/doc/unity/assets/grip-demo-scenes.png) Grip demo scenes Open the [Demo Scenes Browser](/doc/unity/basics/user-interface/demo-scenes-browser/) and look under **Object Handling** for gripping demos: * **DemoGrippingSimple** — three demos: simple pick/place with OverlapSphere, GripTarget placement, and physics-based placement * **DemoGrippingAdvanced** — sensor-based detection, cylinder-based picking, and PLC signal control ## See Also [Section titled “See Also”](#see-also) * [GripTarget](/doc/unity/components-and-scripts/picking-and-placing-mus/griptarget/) * [Gripper](/doc/unity/components-and-scripts/picking-and-placing-mus/gripper/) * [Fixer](/doc/unity/components-and-scripts/picking-and-placing-mus/fixer/) * [LogicSteps — GripPick & GripPlace](/doc/unity/components-and-scripts/defining-logic/logicsteps/) * [MU (Movable Unit)](/doc/unity/components-and-scripts/mu-movable-unit/) # Gripper The Gripper combines functions of [Drives](/doc/unity/components-and-scripts/motion/drive/) for the fingers, [Sensors](/doc/unity/components-and-scripts/sensors/sensor/) for detecting [MUs](/doc/unity/components-and-scripts/mu-movable-unit/) and [Grip](/doc/unity/components-and-scripts/picking-and-placing-mus/grip/) in one single component. It is usefull for modelling standard grippers like you find the usually in automation systems in a comfortable way. During simulation start, the Gripper component will automatically create the needed Grip and Sensor Scripts. Note If you are using Fingers a sensor for detecting the parts to grip will be automatically created. The sensor will also detect the length which is needed to close until the part is touched. The signal *Is fully closed* will only be set to true if the Gripper is fully closed what means that no part is gripped. ![](/doc/unity/assets/gripper.png) ### Properties[](#properties) [Section titled “Properties ”](#properties) **Left Finger / Right Finger**\ It is optional to define fingers or not (by setting the Properties *LeftFinger*, *RightFinger*). If no fingers are defined there will be no movement visible. The closing time of the fingers needs to be passed before the parts are gripped. Note You need to place the left finger component pivot point to the point where the sensor for detecting the parts is placed. **Time closing / Time opening**\ Time for closing and opening the Gripper in seconds. Parts are gripped when closing time is passed. Parts are released directly after opening is started. **Gripper Width**\ The Width of the Gripper in millimeters, when it is opened. **Open Pos Offset**\ Offset between the current scene view position and the open position of the Gripper in millimeters. **Direction Finger**\ The direction of the fingers in the local coordinate system of the Gripper. **Direction Closing**\ The closing direction of the fingers in the local coordinate system of the Gripper. **Close Grippper / Open Gripper**\ PLC signals for closing or opening the gripper **Is Closing / Is Opening**\ Signals are true during the opening or closing process\\ © 2025 realvirtual GmbH [https://realvirtual.io](https://realvirtual.io/) - All rights reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or by any means, including printing, saving, photocopying, recording, or other electronic or mechanical methods, without the prior written permission of the publisher. # GripTarget Note This component was added in realvirtual **6.3**. ## Overview [Section titled “Overview”](#overview) GripTarget marks a precise placement position for the [Grip](/doc/unity/components-and-scripts/picking-and-placing-mus/grip/) component’s Auto-Place system. When a Grip releases an MU near a GripTarget, the MU aligns to the target’s position and rotation and becomes a child of the GripTarget. GripTarget is a **passive marker** — it does not detect MUs on its own. The Grip component finds it using an OverlapSphere search within the configured **Grip Target Search Radius**. ## Properties [Section titled “Properties”](#properties) ![](/doc/unity/assets/griptarget-inspector.png) GripTarget Inspector **Align Position** (boolean) Snaps the MU position to the GripTarget’s world position on placement. Default: `true`. **Align Rotation** (boolean) Snaps the MU rotation to the GripTarget’s rotation on placement. Default: `false`. **Occupied By** (MU, read-only) Shows which MU is currently placed at this target. Empty means the target is free and available for placement. ## Usage [Section titled “Usage”](#usage) 1. Add a **GripTarget** component to a GameObject at the desired placement position 2. Position and rotate the GameObject to define where and how the MU should land 3. Configure the [Grip](/doc/unity/components-and-scripts/picking-and-placing-mus/grip/) component with **Place Mode = Auto** 4. Set **Grip Target Search Radius** on the Grip to control the detection range (default: 500 mm) 5. When the Grip places an MU within range, it automatically snaps to the nearest free GripTarget The MU becomes a **child** of the GripTarget transform, so if the GripTarget moves (e.g., on a conveyor or robot), the placed MU moves with it. ## GripTarget vs Fixer [Section titled “GripTarget vs Fixer”](#griptarget-vs-fixer) Both components handle MU placement, but serve different purposes: | | GripTarget | Fixer | | --------------------- | -------------------------------------------- | ------------------------------------------------------------------ | | **Purpose** | Passive placement slot (“parking spot”) | Active station lock (“parking gate with lock”) | | **Needs Grip?** | Yes, always — only works with Grip component | No — works standalone | | **MU arrives how?** | Grip places it | Conveyor, AGV, or robot delivers it | | **Controlled by** | Grip component logic | PLC signals (FixerFix/FixerRelease) or auto-mode | | **Detection** | None — found by Grip’s OverlapSphere | Own BoxCollider trigger or Raycast | | **MU parenting** | MU becomes child of GripTarget | MU becomes child of Fixer (restored to previous parent on release) | | **Multi-MU** | One MU per target | Multiple MUs via MUSFixed list | | **Handover blocking** | No | Yes — prevents double-fixing between stations | | **Tag filtering** | No | Yes — only fix specific part types | **Use GripTarget** when a Grip (robot gripper) places MUs at predefined positions. **Use [Fixer](/doc/unity/components-and-scripts/picking-and-placing-mus/fixer/)** when MUs arrive on their own (conveyor) and need to be stopped/held by PLC control. ## See Also [Section titled “See Also”](#see-also) * [Grip](/doc/unity/components-and-scripts/picking-and-placing-mus/grip/) * [Fixer](/doc/unity/components-and-scripts/picking-and-placing-mus/fixer/) # Pattern Pattern is an auxiliary component for creating circular matrix patterns. This can be used for example when you need to place many realvirtual.io components in a certain way (e.g. you need many fixers on a wheel with vacuum grippers). The pattern game objects are created based on a template and some geometric information about the spacing of the pattern components. The pattern can be created in the editor mode or when starting the simulation. ![](/doc/unity/assets/pattern.png) ## Properties[](#properties) [Section titled “Properties ”](#properties) ### Circular pattern [Section titled “Circular pattern”](#circular-pattern) Creates a circular pattern. The center of rotation is always the center of rotation of the transformation to which the pattern component is attached. #### Detla angle [Section titled “Detla angle”](#detla-angle) The angle between the individual circular pattern components. #### Rotation vector [Section titled “Rotation vector”](#rotation-vector) The direction vector of the rotation. #### Start angle [Section titled “Start angle”](#start-angle) The start angle of the pattern. #### Number [Section titled “Number”](#number) The number of the created pattern components. ### Matrix Pattern [Section titled “Matrix Pattern”](#matrix-pattern) Creates a matrix pattern. #### Number X,Y,Z [Section titled “Number X,Y,Z”](#number-xyz) The number of components of the pattern in the X, Y and Z directions. #### Spacing X,Y,Z [Section titled “Spacing X,Y,Z”](#spacing-xyz) The spacing of the pattern components in the x, y, and z directions. ### Settings [Section titled “Settings”](#settings) #### Template [Section titled “Template”](#template) If no template is defined, the component to which the pattern component is attached will be copied. It is recommended to define a template (referenced by this property) and disable the template itself (the pattern components are automatically enabled when they are created). #### Parent [Section titled “Parent”](#parent) If no parent is defined, the pattern components are automatically created below the game object to which the pattern component is attached. #### Create at startup [Section titled “Create at startup”](#create-at-startup) If true, the pattern components will be created when the simulation is started. #### Delete pattern [Section titled “Delete pattern”](#delete-pattern) Manually delete the pattern in editor mode. #### Generate pattern [Section titled “Generate pattern”](#generate-pattern) Generates the pattern in editor mode. © 2025 realvirtual GmbH [https://realvirtual.io](https://realvirtual.io/) - All rights reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or by any means, including printing, saving, photocopying, recording, or other electronic or mechanical methods, without the prior written permission of the publisher. # PLC Logics ## Overview [Section titled “Overview”](#overview) PLC Logics are pre-built automation control components that implement common industrial automation patterns. These components bridge the gap between traditional PLC programming logic and Unity-based digital twin simulations, providing ready-to-use control logic for typical automation scenarios. PLC Logic components are designed to work seamlessly with realvirtual’s drive system, sensors, and PLC signal interfaces, enabling rapid prototyping and implementation of automation sequences without custom scripting. ## Key Features [Section titled “Key Features”](#key-features) * **Pre-built Control Logic**: Common automation patterns ready for immediate use * **PLC Signal Integration**: Direct connection to PLCInput and PLCOutput signals for external system integration * **Drive System Integration**: Native support for realvirtual Drive components * **Sensor Integration**: Automatic response to sensor states and conditions * **State Management**: Built-in status tracking and sequence management ## Available Components [Section titled “Available Components”](#available-components) ### [LogicStopDriveOnSensor](/doc/unity/components-and-scripts/plc-logics/logic-stop-drive-on-sensor/) [Section titled “LogicStopDriveOnSensor”](#logicstopdriveonsensor) Automatically stops a drive when a sensor detects an object, commonly used for conveyor systems and material handling applications. ### [LogicMove3AxisPickAndPlace](/doc/unity/components-and-scripts/plc-logics/logic-move-3axis-pick-and-place/) [Section titled “LogicMove3AxisPickAndPlace”](#logicmove3axispickandplace) Coordinates synchronized movement between three axes to perform automated pick and place operations with configurable positions and timing. ## Usage Guidelines [Section titled “Usage Guidelines”](#usage-guidelines) 1. **Component Setup**: Add PLC Logic components to empty GameObjects in your scene hierarchy 2. **Reference Assignment**: Connect drives, sensors, and PLC signals through the Inspector 3. **Position Configuration**: Set target positions and operational parameters as needed 4. **Integration Testing**: Verify component behavior with your external PLC or control system ## Integration with External Systems [Section titled “Integration with External Systems”](#integration-with-external-systems) PLC Logic components are designed to integrate with external control systems through realvirtual’s interface system: * **OPC-UA**: Industrial standard communication protocol * **S7 TCP**: Direct connection to Siemens PLCs * **Modbus**: Serial and TCP communication support * **Custom Interfaces**: Extensible architecture for proprietary systems ## See Also [Section titled “See Also”](#see-also) * [Defining Logic](/doc/unity/components-and-scripts/defining-logic/) - Custom logic implementation approaches * [Interfaces](/doc/unity/components-and-scripts/interfaces/) - External system communication * [Motion and Kinematic](/doc/unity/components-and-scripts/motion/) - Drive system fundamentals * [Sensors](/doc/unity/components-and-scripts/sensors/) - Sensor integration and configuration *** © 2025 realvirtual GmbH - All rights reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or by any means, including printing, saving, photocopying, recording, or other electronic or mechanical methods, without the prior written permission of the publisher. # LogicMove3AxisPickAndPlace ## Overview [Section titled “Overview”](#overview) The **LogicMove3AxisPickAndPlace** component coordinates synchronized movement between three axes to perform automated pick and place operations. This component implements a complete pick and place sequence, moving between two positions while managing gripper control and providing status feedback to external systems. The component executes a predefined sequence: move to pick position, lower axis, activate gripper, raise axis, move to place position, lower axis, deactivate gripper, raise axis, and return to standard position. Each phase is synchronized and monitored for completion before proceeding to the next step. \[Screenshot: LogicMove3AxisPickAndPlace component in Inspector showing axis assignments and position settings] ## Properties [Section titled “Properties”](#properties) ### Axis Configuration [Section titled “Axis Configuration”](#axis-configuration) **Axis1** (Drive) First axis drive component, typically the X-axis for horizontal movement. This axis handles primary horizontal positioning for both pick and place locations. Ensure the drive is configured with appropriate speed and acceleration values for smooth operation. **Axis2** (Drive) Second axis drive component, typically the Y-axis for horizontal movement. This axis provides secondary horizontal positioning, allowing the system to reach any XY coordinate within the workspace. Coordinate with Axis1 for synchronized horizontal movement. **Axis3** (Drive) Third axis drive component, typically the Z-axis for vertical movement. This axis controls the vertical approach and retraction movements during pick and place operations. Configure with appropriate speed for safe approach and rapid retraction. ### PLC Signal Integration [Section titled “PLC Signal Integration”](#plc-signal-integration) **StartPickAndPlace** (PLCInputBool) Input signal to initiate the pick and place sequence. The component monitors this signal for a positive edge (false to true transition) to begin the automation cycle. Connect to external PLC outputs or manual control buttons. **Pick** (PLCOutputBool) Output signal to control the gripper or pick mechanism. This signal becomes true when the system reaches the pick position and needs to activate the gripper, and becomes false when releasing the object at the place position. **PlacePositionReached** (PLCInputBool) Input signal that confirms the place position has been reached and the object has been successfully placed. This allows external systems to provide confirmation before continuing the sequence, useful for quality control or external sensors. **ContinueAfterPlace** (PLCOutputBool) Output signal to control sequence continuation after placing. When this signal becomes true, the system continues with gripper release and return to standard position. If not connected, the system automatically continues without waiting. ### Position Settings [Section titled “Position Settings”](#position-settings) **Position1** (Vector3) Pick position coordinates in millimeters for all three axes. Set the X, Y, and Z values to define where the system should pick up objects. These coordinates are relative to the drive’s zero positions and should be within the workspace limits. **Position2** (Vector3) Place position coordinates in millimeters for all three axes. Set the X, Y, and Z values to define where the system should place objects. Ensure adequate clearance from obstacles and proper alignment with receiving fixtures or conveyors. **StandardPos** (Vector3) Standard home position coordinates in millimeters for all three axes. This is the safe position where the system starts and returns after each complete cycle. Position should provide clearance from all workspace obstacles and allow easy access for maintenance. ### Status Information [Section titled “Status Information”](#status-information) **Status** (string, read-only) Current status of the pick and place sequence for debugging and monitoring. Displays the current phase of operation such as “waiting”, “moving to pos1”, “moving down on pos1”, etc. Use this for troubleshooting sequence timing and progression. ## Usage Examples [Section titled “Usage Examples”](#usage-examples) ### Basic Pick and Place Setup [Section titled “Basic Pick and Place Setup”](#basic-pick-and-place-setup) 1. **Component Setup**: Add LogicMove3AxisPickAndPlace to an empty GameObject 2. **Assign Axes**: Connect three drive components to Axis1, Axis2, and Axis3 fields 3. **Configure Positions**: Set Position1 (pick), Position2 (place), and StandardPos coordinates 4. **Connect Start Signal**: Assign a PLCInputBool to StartPickAndPlace 5. **Connect Gripper**: Assign a PLCOutputBool to Pick for gripper control ### PLC Integration Example [Section titled “PLC Integration Example”](#plc-integration-example) 1. **External Control**: Connect StartPickAndPlace to PLC output for cycle initiation 2. **Gripper Interface**: Connect Pick signal to pneumatic valve or electric gripper 3. **Position Feedback**: Use PlacePositionReached for external confirmation sensors 4. **Sequence Control**: Configure ContinueAfterPlace for external timing control ### Production Line Integration [Section titled “Production Line Integration”](#production-line-integration) 1. **Conveyor Coordination**: Synchronize with conveyor systems using position signals 2. **Quality Control**: Use PlacePositionReached for vision system integration 3. **Safety Integration**: Connect to safety systems through external PLC interfaces 4. **Status Monitoring**: Monitor Status property for production line dashboards ## Sequence Details [Section titled “Sequence Details”](#sequence-details) ### Complete Cycle Phases [Section titled “Complete Cycle Phases”](#complete-cycle-phases) 1. **Initialization**: System moves to StandardPos on startup 2. **Waiting**: System waits for StartPickAndPlace signal 3. **Move to Position1**: Axis1 and Axis2 move to pick XY coordinates 4. **Lower at Position1**: Axis3 moves down to pick Z coordinate 5. **Activate Gripper**: Pick signal becomes true, gripper activates 6. **Raise at Position1**: Axis3 returns to standard Z coordinate 7. **Move to Position2**: Axis1 and Axis2 move to place XY coordinates 8. **Lower at Position2**: Axis3 moves down to place Z coordinate 9. **Wait for Confirmation**: Optional wait for PlacePositionReached signal 10. **Release Gripper**: Pick signal becomes false, gripper releases 11. **Raise at Position2**: Axis3 returns to standard Z coordinate 12. **Return to Standard**: All axes return to StandardPos coordinates ### Timing and Synchronization [Section titled “Timing and Synchronization”](#timing-and-synchronization) * Horizontal axes (Axis1, Axis2) move simultaneously for efficiency * Vertical axis (Axis3) moves only after horizontal positioning is complete * Each phase waits for IsAtTarget confirmation before proceeding * Status updates occur immediately when phase transitions happen ## Integration Notes [Section titled “Integration Notes”](#integration-notes) ### Drive Requirements [Section titled “Drive Requirements”](#drive-requirements) * All three drives must support DriveTo() method for absolute positioning * Drives should have IsAtTarget property for position confirmation * Configure appropriate speeds and accelerations for smooth coordinated movement * Ensure drive position ranges accommodate all programmed coordinates ### Safety Considerations [Section titled “Safety Considerations”](#safety-considerations) * Verify workspace limits to prevent mechanical collisions * Test all positions manually before running automated sequences * Implement emergency stop functionality through external PLC interfaces * Consider soft limits and mechanical end stops for axis protection ### Performance Optimization [Section titled “Performance Optimization”](#performance-optimization) * Use FixedUpdate timing for consistent sequence execution * Position coordinates are cached for optimal performance * Component state machine minimizes processing overhead * Status string updates provide debugging without performance impact ## Troubleshooting [Section titled “Troubleshooting”](#troubleshooting) ### Sequence Not Starting [Section titled “Sequence Not Starting”](#sequence-not-starting) * Verify StartPickAndPlace signal is connected and receiving true values * Check that all three axis drives are properly assigned and active * Ensure system has completed initialization to StandardPos ### Axes Not Moving [Section titled “Axes Not Moving”](#axes-not-moving) * Verify drive DriveTo() method is supported by connected drive types * Check position coordinates are within drive ranges and workspace limits * Confirm drives are not in manual mode or disabled state ### Timing Issues [Section titled “Timing Issues”](#timing-issues) * Monitor Status property to identify which phase is causing delays * Check IsAtTarget implementation on drive components * Verify drive speeds and accelerations are appropriate for application ### PLC Communication Problems [Section titled “PLC Communication Problems”](#plc-communication-problems) * Test PLC signal connections in realvirtual Runtime Inspector * Verify interface configuration and connection status * Check signal direction (input vs output) assignments ## See Also [Section titled “See Also”](#see-also) * [Drive](/doc/unity/components-and-scripts/motion/drive/) - Drive component configuration and methods * [LogicStopDriveOnSensor](/doc/unity/components-and-scripts/plc-logics/logic-stop-drive-on-sensor/) - Simple drive control logic * [Interfaces](/doc/unity/components-and-scripts/interfaces/) - PLC communication setup * [Gripper](/doc/unity/components-and-scripts/picking-and-placing-mus/gripper/) - Alternative gripper control methods *** © 2025 realvirtual GmbH - All rights reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or by any means, including printing, saving, photocopying, recording, or other electronic or mechanical methods, without the prior written permission of the publisher. # LogicStopDriveOnSensor ## Overview [Section titled “Overview”](#overview) The **LogicStopDriveOnSensor** component automatically controls a drive based on sensor occupancy state, implementing a common conveyor control pattern where material flow stops when an object is detected and resumes when the path is clear. This component is essential for preventing collisions and managing material flow in automated production lines. The component monitors a sensor continuously and stops the associated drive when the sensor becomes occupied, then automatically restarts the drive when the sensor clears or when an external restart signal is received. \[Screenshot: LogicStopDriveOnSensor component in Inspector showing drive and sensor assignments] ## Properties [Section titled “Properties”](#properties) ### Component References [Section titled “Component References”](#component-references) **Drive** (Drive) The drive component to control based on sensor state. When the sensor becomes occupied, this drive will be stopped by setting its JogForward property to false. When the sensor clears, the drive automatically resumes forward movement. **Sensor** (Sensor) The sensor component that triggers drive control actions. The component monitors this sensor’s Occupied property to determine when to stop and start the drive. Use proximity sensors, photoelectric sensors, or any realvirtual sensor type. ### PLC Signal Integration [Section titled “PLC Signal Integration”](#plc-signal-integration) **ConveyorStopped** (PLCInputBool) Optional PLC input signal that reports the conveyor stop status to external systems. When the sensor becomes occupied and the drive stops, this signal is set to true, allowing external PLCs or control systems to monitor the conveyor state. **Restart** (PLCOutputBool) Optional PLC output signal that provides external restart control. When this signal becomes true, the drive resumes operation regardless of sensor state, useful for manual override or external control logic integration. ## Usage Examples [Section titled “Usage Examples”](#usage-examples) ### Basic Conveyor Control [Section titled “Basic Conveyor Control”](#basic-conveyor-control) 1. **Setup Components**: Add LogicStopDriveOnSensor to an empty GameObject in your scene 2. **Assign Drive**: Drag the conveyor drive from the Hierarchy to the **Drive** field 3. **Assign Sensor**: Drag the sensor that should trigger the stop action to the **Sensor** field 4. **Test Operation**: Run the scene and observe drive stopping when objects trigger the sensor ### PLC Integration Setup [Section titled “PLC Integration Setup”](#plc-integration-setup) 1. **Configure Stop Signal**: Assign a PLCInputBool to **ConveyorStopped** for external system feedback 2. **Setup Restart Control**: Assign a PLCOutputBool to **Restart** for external restart capability 3. **Interface Connection**: Connect these signals to your PLC interface (OPC-UA, S7, etc.) 4. **Verify Communication**: Test signal exchange with your external control system ### Production Line Integration [Section titled “Production Line Integration”](#production-line-integration) 1. **Multiple Sensors**: Use multiple LogicStopDriveOnSensor components for different conveyor sections 2. **Cascading Control**: Connect restart signals between components for coordinated material flow 3. **Status Monitoring**: Use ConveyorStopped signals to create a production line status dashboard 4. **Emergency Stops**: Integrate with safety systems through external restart control ## Behavior Details [Section titled “Behavior Details”](#behavior-details) ### Stop Logic [Section titled “Stop Logic”](#stop-logic) * Drive stops immediately when sensor transitions from unoccupied to occupied * Stop action occurs on the first frame the sensor becomes occupied * Drive JogForward property is set to false to stop forward movement ### Restart Logic [Section titled “Restart Logic”](#restart-logic) * Drive automatically restarts when sensor transitions from occupied to unoccupied * External restart signal (if connected) can override sensor state to force restart * Drive JogForward property is set to true to resume forward movement ### Signal Updates [Section titled “Signal Updates”](#signal-updates) * ConveyorStopped signal updates in the same frame as drive stop/start actions * All signal updates occur in FixedUpdate for consistent timing with physics simulation * Component optimizes performance by caching null checks during initialization ## Integration Notes [Section titled “Integration Notes”](#integration-notes) ### Drive Compatibility [Section titled “Drive Compatibility”](#drive-compatibility) * Works with all realvirtual Drive types (linear drives, rotation drives, transport surfaces) * Requires drives configured for JogForward operation mode * Compatible with drive behaviors and advanced drive features ### Sensor Requirements [Section titled “Sensor Requirements”](#sensor-requirements) * Compatible with all realvirtual sensor types (proximity, photoelectric, etc.) * Requires sensors with proper Occupied property implementation * Works with both normally open and normally closed sensor configurations ### Performance Considerations [Section titled “Performance Considerations”](#performance-considerations) * Optimized for real-time operation with minimal processing overhead * Uses cached component references to avoid expensive GetComponent calls * FixedUpdate timing ensures consistent behavior with physics simulation ## Troubleshooting [Section titled “Troubleshooting”](#troubleshooting) ### Drive Not Stopping [Section titled “Drive Not Stopping”](#drive-not-stopping) * Verify Drive reference is assigned and drive is active * Check that sensor Occupied property changes correctly * Ensure drive is configured for JogForward operation ### PLC Signals Not Working [Section titled “PLC Signals Not Working”](#plc-signals-not-working) * Verify PLCInputBool and PLCOutputBool references are correctly assigned * Check interface connection status and configuration * Test signal values in realvirtual Runtime Inspector ### Timing Issues [Section titled “Timing Issues”](#timing-issues) * Component uses FixedUpdate for consistent timing with physics * Adjust Unity Fixed Timestep if timing precision is critical * Consider sensor detection distance and object movement speed ## See Also [Section titled “See Also”](#see-also) * [Drive](/doc/unity/components-and-scripts/motion/drive/) - Basic drive component configuration * [Sensor](/doc/unity/components-and-scripts/sensors/sensor/) - Sensor setup and configuration * [Interfaces](/doc/unity/components-and-scripts/interfaces/) - PLC signal integration options * [LogicMove3AxisPickAndPlace](/doc/unity/components-and-scripts/plc-logics/logic-move-3axis-pick-and-place/) - Advanced multi-axis control *** © 2025 realvirtual GmbH - All rights reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or by any means, including printing, saving, photocopying, recording, or other electronic or mechanical methods, without the prior written permission of the publisher. # Robot Inverse Kinematics (Pro) Note This inverse kinematic solver is only included in realvirtual Professional. Note Robot Inverse Kinematics has been significantly updated in realvirtual **6.3 LTS**. New features include zone blending, scene view gizmos, a redesigned IK solutions UI, and collaborative robot support (beta). With inverse kinematics you can control robots with the toolcenter position (TCP). The possible solutions to reach the toolcenter positions are calculated by the inverse kinematics. With inverse kinematics, a robot can move along a path in point to point mode (PTP) or in a linear motion. Zone blending allows smooth transitions between targets without stopping. The Robot IK is located in the package directory `Packages/io.realvirtual.professional/Runtime/IK/`. Demo scenes can be opened via the Demo Scenes Browser under *Professional > Robotics*. The main IK demo scene contains both a standard 6-axis robot (ABB IRB2400, spherical wrist) and a collaborative robot (FANUC CRX, non-spherical wrist), so you can compare both solver types side by side. ![RobotIK demo model with robot arm and path visualization](/doc/unity/assets/robotik.png) RobotIK demo model ### Autonox demo models and prefabs[](#limitations) [Section titled “Autonox demo models and prefabs ”](#autonox-demo-models-and-prefabs) Explore the capabilities of Autonox robots with our dedicated demonstration model, featuring three distinct robot types within a single demo scene. Access these robots directly as prefabs for seamless integration into your projects. **Demo Scene Location:** * **Scene Path:** Available via Demo Scenes Browser under *Professional > Autonox Robots* **Prefabs Directory:** * **Prefab Location:** `Packages/io.realvirtual.professional/Runtime/IK/AUTONOX` [](/doc/unity/assets/Unity_yqmKd1ipgN.mp4) Autonox demonstration model and library ### Limitations[](#limitations) [Section titled “Limitations ”](#limitations) * Standard inverse kinematics uses an analytical solver for 6-axis industrial robots with spherical wrists. * Collaborative robots with non-spherical wrists are supported in beta via a numerical solver (see [Collaborative Robot IK](#collaborative-robot-ik-beta)). * Only robots that can align the TCP, Axis6, 5 and 4 on a straight line are possible (spherical wrist requirement). For cobots with wrist offsets, use the NonSpherical wrist type. * Only linear accelerations are possible, smooth (sinoid) accelerations of robot axes are currently not supported. * Robot IK is not supported on WebGL builds. * It is necessary that the positions of the robot axes can be defined by the following parameters: ![Robot kinematic parameters diagram](/doc/unity/assets/robotik-restrictions.png) ### Robot Preparation[](#robot-preparation) [Section titled “Robot Preparation ”](#robot-preparation) The robot must be prepared for inverse kinematics taking into account the following things: * The zero point of the robot must have the Unity X axis aligned forward, Z upward, and Y to the left (in the following picture you see an additional right handed coordinate system - which is normally used in industrial robotics - Unity’s coordinate system is left handed) ![Robot root coordinate system alignment](/doc/unity/assets/robotik-root.png) * The RobotIK script itself must be connected to the game object in the zero point. * The first rotation axis must also be at the zero point. * All other axes must not be rotated with respect to the zero point (i.e. again X to the front, Z to the top and Y to the left) * The TCP (standard TCP as well as possibly own shifted TCPs for tools) must also have Z aligned to the top, Y to the left and X to the front in the stretched position. ![TCP coordinate system alignment](/doc/unity/assets/robotik-tcp.png) * On each Axis a [Drive](/doc/unity/components-and-scripts/motion/drive/) needs to be attached. For the drive, limits and accelerations need to be defined. The upper and lower limits are considered for calculating the possible solutions. ![Axis drive configuration with limits](/doc/unity/assets/robotik-axis.png) * All 6 axes need to be assigned in the Axis list in RobotIK. ### Prepared robot kinematic prefab[](#calculating-the-kinematic-parameters) [Section titled “Prepared robot kinematic prefab ”](#prepared-robot-kinematic-prefab) Simplify the process of defining new robots with our preconfigured robot kinematic prefab. This prefab streamlines the setup by including essential components like the RobotIK Script, Axis hierarchy with drives, and a predefined pick and place path. All you need to do is add the 3D data of the robot meshes. ![Empty robot kinematic prefab hierarchy](/doc/unity/assets/robotik-emptykinematicprefab.png) Prepared robot kinematic prefab **Empty Robot Kinematic Prefab:** * **Prefab Path:** `Packages/io.realvirtual.professional/Runtime/IK/EmptyRobotKinematic.prefab` **Steps to Customize Your Robot:** 1. **Add Prefab to Scene:** Drag the prefab into your Unity scene to begin customization. 2. **Unpack Prefab:** Unpack the prefab in the scene to access its individual components for adjustment. 3. **Adjust Axis Positions:** Modify the positions of Axis 1 to Axis 6 to match the specifications provided in the robot’s datasheet. 4. **Import CAD Data:** Use CADLink to import the robot’s CAD data in STEP format for accurate representation. 5. **Export as FBX:** Create an FBX asset based on the imported CAD data using the FBX exporter. 6. **Add FBX to Model:** Place the exported FBX file into your Unity scene. 7. **Organize Components:** Move the components of Axis 1 to Axis 6 under the corresponding Axis in the unpacked prefab hierarchy. 8. **Calculate Kinematic Parameters:** Start “Calc Kinematic Parameters” in the RobotIK script to compute kinematic parameters automatically (see below). 9. **Start Testing:** Enter play mode to begin testing your robot’s functionality and behavior within the Unity environment. ### Calculating the kinematic parameters[](#calculating-the-kinematic-parameters) [Section titled “Calculating the kinematic parameters ”](#calculating-the-kinematic-parameters) Calculating the kinematic parameters needs to be done once when the robot is prepared. All parameters (a1,a2,b,c1,c2,c3,c4) which are shown in the picture above are automatically calculated and used later on for calculating the inverse kinematic solutions.\ Before calculating the parameters you also need to define in which position the robot is in editor mode. If the Elbow is oriented in Unity X-Direction you need to select *Elbow in Unity X*. Activate “Do not follow in Edit Mode” to override the parameter “Follow in Edit Mode” at all current [Target](/doc/unity/components-and-scripts/robot-inverse-kinematics/#targets) positions. After everything is prepared *Calc Kinematic Parameters* can be pushed and you will see all parameters in the RobotIK inspector window. ![Kinematic parameters in RobotIK inspector](/doc/unity/assets/robotik-parameter.png) ### Defining Paths [Section titled “Defining Paths”](#defining-paths) Robot paths are defined by lining up targets. A target is the alignment of the robot’s TCP at a defined position. Robot paths and targets must be created under the RobotIK script (the robot’s zero point) as a child game object. To create a path, an empty gameobject must first be created and an IKPath script added. New targets can be added in the IKPath Inspector window by pushing *Add new target*. As soon as a target is active, the robot will also follow in the editor to the defined position. If this is not reachable, then a red sphere appears around the target. If the path is activated, all targets below the path can be moved in the editor window. If the CTRL key is held down, the targets can be rotated. ![Robot path with targets in scene view](/doc/unity/assets/robotik-path.png) The sequence of the paths can be arranged by changing the order in the target list. ### Scene View Gizmos[](#scene-view-gizmos) [Section titled “Scene View Gizmos ”](#scene-view-gizmos) Note This feature was added in realvirtual **6.3** (Professional) The IK system provides comprehensive scene view visualizations to help you understand and debug robot kinematics. All gizmos are controlled via toggle properties on the **RobotIK** component. **RobotIK Gizmo Toggles:** * **Draw Gizmos** (master toggle) - Enables or disables all IK gizmos in the scene view. When enabled, always shows a TCP marker (orange wire sphere with XYZ axis lines). * **Show Elbow Direction** - Displays an arrow at the robot base indicating the elbow direction (X or Z in robot local frame). * **Show Kinematic Chain** - Draws white lines connecting Base through all axes to TCP, with DH parameter labels at segment midpoints. For non-spherical wrist robots, additional offset indicator lines are shown. * **Show Joint Positions** - Renders colored arcs at each axis showing the joint range and current position. The current position needle is color-coded: green at center of range, yellow near limits, red at limits. * **Show Axis Frames** - Displays small XYZ coordinate frames at each axis with rotation direction labels. * **Show Wrist Type** - For spherical wrists: green wire sphere around A4/A5/A6. For non-spherical wrists: orange dashed offset lines with distance labels. **Path Gizmos (IKPath / IKTarget):** When an IKPath or IKTarget is selected, additional gizmos are drawn: * **Path lines** - Green lines for Linear segments, yellow lines for PTP segments. * **Direction arrows** - Cone-shaped arrows at segment midpoints showing travel direction. * **Target labels** - Index and name (e.g. “0: PickPos”) displayed above each target. * **TCP orientation** - Small XYZ axis lines at each target showing the TCP orientation. * **StartNextPath connection** - Dashed line from the last target to the first target of the next path. * **Blend zones** - Visualized when blending is enabled (see [Zone Blending](#zone-blending)). ### Zone Blending (Ueberschleifen)[](#zone-blending) [Section titled “Zone Blending (Ueberschleifen) ”](#zone-blending-ueberschleifen) Note This feature was added in realvirtual **6.3** (Professional) Zone blending allows the robot to transition smoothly to the next target without stopping at the current target. Instead of decelerating to a full stop, the robot starts moving toward the next target when it enters the blend zone, defined by the **Blend Radius**. ![Linear blending visualization showing circular arc blend between two linear path segments](/doc/unity/assets/robotik_linearblending.png) Zone blending on a linear path - the orange arc shows the blend zone where the robot transitions smoothly between segments ![PTP blending visualization showing blue sphere at target position](/doc/unity/assets/robotik_ptpblending.png) PTP blending - the blue sphere indicates the blend zone radius around the target **Properties on IKTarget:** * **Enable Blending** (boolean) - Enables zone blending for this target. When enabled, the robot transitions to the next target at BlendRadius distance instead of stopping exactly at this target. * **Blend Radius** (float, millimeters) - The radius of the blend zone. The robot starts moving toward the next target when the TCP is within this distance of the current target. Minimum value: 1 mm. **Blend behavior depends on the motion type combination:** | From → To | Blend Behavior | Scene Gizmo | | --------------- | --------------------------------------------------------------------------------------- | ------------------------------------- | | PTP → PTP | Smooth joint angle redirect - all axes are redirected to the next target’s joint angles | Blue transparent sphere | | PTP → Linear | Switches to Cartesian linear motion at blend zone entry | Blue transparent sphere | | Linear → Linear | Geometrically exact circular arc blend connecting the two linear segments | Orange arc with tangent point markers | | Linear → PTP | Stops linear motion and redirects joint angles to the next target | Blue transparent sphere | **Cross-path blending:** Blending also works across paths connected via **Start Next Path**. The last target of one path can blend directly into the first target of the next path without the TCP ever stopping. **Constraints:** Blending is automatically disabled for a target when: * **Wait For Signal** is set - the robot must stop to wait for the signal * **Wait For Seconds** > 0 - the robot must stop and wait * The target is the last target of a non-looping path without Start Next Path **Debug Blending** (boolean, on IKPath) - Logs detailed blending state transitions to the console for debugging. ### Path Properties [Section titled “Path Properties”](#path-properties) **Speed Override** Override Speed between 0 and 1 to slow down the path. Standard is 1. **Set new TCP** Optional. Sets a new TCP for the robot which is used for the path. **Draw Path** Draws the path as a sequence of lines in editor window. Linear movements are drawn in green, PTP movements in yellow. **Draw Targets** Draws the targets in editor window. Targets can be moved by the handles. With pressed CTRL they can be rotated. **Path** Sequence of targets. **Signal Start** A PLCOutput signal for starting the Path. **Start** Starts the path directly at simulation start. **Loop Path** Starts the path again as soon as the path is ended. **Signal is Started** A PLCInput signal when the Path is started. **Signal Ended** A PLCInput signal when the Path has ended. **Start Next Path** A pointer to the next path which can be started after this path. Supports cross-path blending when the last target has blending enabled. **Debug Blending** Logs detailed blending state transitions to the console for debugging jump issues. ### Targets [Section titled “Targets”](#targets) Targets are the destination points in paths. Within the target, several parameters of the destination are controlled. ![IKTarget Inspector showing blending settings, axis positions, reference angles and IK Solutions picker](/doc/unity/assets/robotik_inspector.png) IKTarget Inspector with blending, solution picker and axis positions ### Target Properties[](#target-properties) [Section titled “Target Properties ”](#target-properties) **Right Handed Robot Coordinates** (Readonly) The position of the target in right handed coordinate system. **Speed to Target** The speed to the target. If set to 1 all axes are driving with the maximum speed (on PTP) or the given linear speed (on Linear Interpolation). **Linear Acceleration** Only applicable for Linear Move mode. The acceleration on the linear path. **Interpolation to Target** The interpolation mode to the target. **Point to Point (PTP)** All axes will arrive at the same time at destination. The time is controlled by the axis which takes the longest time. The other axis acceleration is reduced so that they reach the target in the same time as the slowest axis. The movement of the TCP is in this case non-linear and cannot be controlled. **Point to Point unsynced** Same as above but all axes drive with maximum speed and reach the destination at different times. **Linear** Linear movement between the two targets with the given linear acceleration and linear speed. **Linear Speed to Target** The linear speed to the target for Linear Interpolation. **Set Signal** Sets the defined Signal when the Target is reached. **Set Signal Duration** Sets the Signal for the defined duration. **Wait for Seconds** The robot waits for the defined time after reaching the target. Note: Setting this value > 0 automatically disables blending for this target. **Wait For Signal** Waits at the target before continuing the path until the defined signal becomes true. Note: Setting a signal here automatically disables blending for this target. **Pick and Place** Enables picking and placing MUs at the target. **Grip** (new in 6.3) Reference to a [Grip](/doc/unity/components-and-scripts/picking-and-placing-mus/grip/) component for pick and place operations. This is the recommended approach. When both Grip and Fixer are assigned, Grip takes priority. **Fixer** Reference to a [Fixer](/doc/unity/components-and-scripts/picking-and-placing-mus/fixer/) component for pick and place operations (legacy). **Pick** True if the grip/fixer should pick at the target. **Place** True if the grip/fixer should place at the target. ### IK Solutions[](#ik-solutions) [Section titled “IK Solutions ”](#ik-solutions) Note This feature was added in realvirtual **6.3** (Professional) The IK Solutions panel at the bottom of the IKTarget Inspector shows all reachable solutions for the current target position. The list keeps a **stable order** (by configuration index), so the rows do not jump around when you select a different solution. For each solution the panel shows the joint movement relative to the previous path point - **maxΔ**, the largest single-axis move. The solution with the smallest largest-axis move is marked **SMOOTH**: it produces the most continuous, low-motion transition along the path without extreme rotations. This lets you see at a glance which configuration is best for a smooth path and pick it yourself. ![IK Solutions picker showing solutions with maxΔ and SMOOTH marker](/doc/unity/assets/robotik_inspector.png) IK Solutions picker - stable order with the per-solution maxΔ to the previous point; SMOOTH marks the lowest-motion configuration **How it works:** * The header shows “IK Solutions (N reachable)” with the number of valid solutions. * Solutions are displayed as clickable rows showing all 6 axis angles in degrees plus the maxΔ to the previous path point. * The **SMOOTH**-marked row is the recommended low-motion choice; a solution with a large maxΔ (a near-180° axis swing) is highlighted because it would cause fast or jerky motion. * Click a row to select it. The chosen configuration is **pinned by storing its joint angles**, so it is stably restored on every re-solve - even when target positions change or the reachable solution set changes. * The robot preview in the scene view updates immediately. **Axis Pos** (readonly) - Shows the calculated axis positions in degrees for the currently selected solution. **Reference Angles** (readonly) - The reference joint angles used to rank solutions. Typically the previous target’s axis positions. **Reachable** - True if the target is reachable with the selected solution. ### Solution Selection Mode[](#solution-selection-mode) [Section titled “Solution Selection Mode ”](#solution-selection-mode) Note This feature was added in realvirtual **6.3** (Professional) On the **RobotIK** component, the **Solution Selection** property controls what happens when the user’s preferred IK solution becomes unreachable (e.g., due to joint limits at a new target position): * **First Reachable** (default) - Falls back to the first available valid solution. * **Minimal Angle Change** - Falls back to the solution requiring the smallest total joint movement from the current position. Note: The IK Solutions list in the IKTarget Inspector keeps a stable order and marks the lowest-motion configuration as SMOOTH regardless of this setting. This property only affects the fallback behavior when the pinned solution is no longer reachable. ### Collaborative Robot IK (Beta)[](#collaborative-robot-ik-beta) [Section titled “Collaborative Robot IK (Beta) ”](#collaborative-robot-ik-beta) Caution Collaborative Robot IK is currently in **Beta**. Position-only IK works reliably, but path planning may produce unexpected results. Added in realvirtual **6.3** (Professional). Standard industrial robots have a spherical wrist where axes 4, 5 and 6 intersect at a single point. Collaborative robots (cobots) like the FANUC CRX or Universal Robots series have non-spherical wrists with offsets between these axes. The **Wrist Type** property on RobotIK selects the solver: * **Spherical** (default) - Analytical Pieper solver for standard 6-axis robots. Fast and exact with up to 8 solutions. * **Non-Spherical** - Hybrid solver that uses the analytical Pieper solution as a seed and refines it with a Newton-Raphson numerical solver. Supports robots with wrist offsets (d4, d5, a5, a6 parameters, calculated automatically). **Setup:** Select `Non-Spherical` as Wrist Type, then press “Calc Kinematic Parameters”. The wrist offset parameters (d4, d5, a5, a6) are calculated automatically from the axis positions and displayed in the **Wrist Offsets** foldout. **Seed Strategy** (visible only for Non-Spherical): * **Mirror Seeds** (boolean, default: true) - Generates 8 mirrored wrist-flip seeds from the 4 Pieper base configurations, increasing the chance of finding valid solutions. * **Halton Seed Count** (0-16, default: 0) - Number of additional Halton low-discrepancy fallback seeds. Increase this if the solver misses solutions for extreme poses. **NR Solver** (foldout, visible only for Non-Spherical): * **NR Angular Weight** (default: 1.0) - Weight for orientation vs position in the Newton-Raphson solver. * **NR Orientation Tolerance** (default: 0.01 radians / \~0.57°) - Convergence tolerance for orientation. * **NR Diagnostics** (boolean) - Enable convergence logging to the Unity console for debugging. ### Axis correction [Section titled “Axis correction”](#axis-correction) The IK system automatically keeps joint angles continuous - it picks, within the axis limits, the angle representation closest to the current robot pose. This avoids most 360° jumps (for example the -180°/+180° wrist flip) during linear and point-to-point motion. Axis correction remains available for the rare cases where you want to force a specific corrected value on a PTP target. In some situations it might happen that an axis is misaligned by 360 degrees. If you are using PTP movements you can use the Axis correction values to set the axis positions for the defined target to a manually corrected value: ![Axis correction values in IKTarget inspector](/doc/unity/assets/image%20\(1\)%20\(1\)%20\(1\)%20\(1\)%20\(1\)%20\(1\)%20\(1\)%20\(1\)%20\(1\)%20\(1\)%20\(1\)%20\(1\)%20\(1\)%20\(1\).png) Axis correction values on PTP movements ### Turn correction [Section titled “Turn correction”](#turn-correction) In some special cases it might happen that the IK calculation returns axis 4 and 6, each of them turned 180 degrees too much (which is 360 degrees together). If you turn on Turn correction in the case of a sum of 360 of axis 3 and 5, on both axes the value is corrected by -180 degrees. ### See Also [Section titled “See Also”](#see-also) * [Drive](/doc/unity/components-and-scripts/motion/drive/) - Configure axis drive limits and accelerations used by IK * [Grip](/doc/unity/components-and-scripts/picking-and-placing-mus/grip/) - Grip component for pick and place at IKTarget positions * [Fixer](/doc/unity/components-and-scripts/picking-and-placing-mus/fixer/) - Legacy fixer component for pick and place * [PathTracer (Pro)](/doc/unity/components-and-scripts/motion/path-tracer/) - Visualize robot TCP motion trails * [Kinematic Tool (Pro)](/doc/unity/basics/user-interface/kinematic-tool-pro/) - Visual tool for robot axis setup in the editor © 2026 realvirtual GmbH [https://realvirtual.io](https://realvirtual.io/) - All rights reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or by any means, including printing, saving, photocopying, recording, or other electronic or mechanical methods, without the prior written permission of the publisher. # Robot Program Export (Pro, Beta) Note Robot Program Export is only included in realvirtual Professional. Caution **Beta feature.** The generated output is a **copy-paste template**, not a complete, ready-to-run robot program. Always load and validate the code on a (virtual) controller before running it on real hardware, and start at a reduced speed override. Tool, base/work-object, frame and I/O addressing stay your responsibility on the controller. Note This feature was added in realvirtual **6.3.4** (Professional). Robot Program Export turns a robot path you teach in realvirtual ([Robot Inverse Kinematics](/doc/unity/components-and-scripts/robot-inverse-kinematics/)) into ready-to-paste controller code. It reads the targets of an **IK Path**, re-solves each one, and generates the axis angles and Cartesian poses as a program template for the major robot controllers. This is an **offline** helper for virtual commissioning: there is no live connection and no automatic upload to the controller. You generate the text, copy it (or save it to a file), and paste it into the controller’s program editor. ![Robot Program Export window with the target dropdown open, a monospace code preview, and the IK Path inspector export button](/doc/unity/assets/robot-program-export.png) Robot Program Export window with live preview, next to the IK Path inspector button ## Important: it is a template, not a finished program [Section titled “Important: it is a template, not a finished program”](#important-it-is-a-template-not-a-finished-program) The export produces exactly **one instruction per IK Target** — it does not sample or interpolate the path between targets. The robot follows precisely the points and poses you defined. What the template does **not** include (you complete this on the controller): * Calibrated tool data, base / work-object and user frames (the export falls back to defaults such as `tool0` / `wobj0`, `TOOL_DATA[1]` / `BASE_DATA[1]`, `UFRAME 0` / `UTOOL 1`). * Real signal addresses. Signal names from the path are written as comments; for KUKA and Fanuc a placeholder index is used (remap it on the controller). * Safety logic, program flow and external-axis values. The chosen template character is also written into the header of every generated file. ## Supported targets [Section titled “Supported targets”](#supported-targets) | Target | Output | Notes | | ------------------------ | ----------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | **ABB RAPID** | `.mod` module | `MoveAbsJ` (axis-based) or `MoveJ`/`MoveL` (Cartesian), `SetDO`/`WaitDI`, `WaitTime` | | **KUKA KRL** | `.src` + `.dat` | `PTP {E6AXIS}` (axis-based) or `LIN`/`PTP {E6POS}` (Cartesian), `$APO.CDIS`, `$OUT[]`/`WAIT FOR $IN[]` | | **Fanuc TP/LS** | `.ls` (ASCII) | Joint or Cartesian positions with `CONFIG` string, `J`/`L` moves, `DO[]`/`WAIT DI[]`. Compile to `.tp` in RoboGuide / `maketp.exe` | | **SEW MOVI-C / MOVIKIT** | `.srlprg` sequence program | Native MOVIKIT Robotics program: `PTP_J` (joint) / `LIN` (Cartesian `X/Y/Z` + `RotZ/RotY/RotX`), `REALVAR` I/O init, `MotionSet`/blending setup, signal writes and `WAIT_TIME`. Kinematic number and MotionSet are configurable. Copy-paste template — verify on the (virtual) MOVISUITE controller | | **Wandelbots NOVA** | `.py` (NOVA Python SDK) or `.ws` (Wandelscript) | `joint_ptp` / `cartesian_ptp` / `linear` / `io_write` executed via `plan_and_execute`. Positions in mm, orientation as a rotation vector (rad), joints in rad. The Python SDK is the recommended path; Wandelscript is deprecated by Wandelbots but still runs during the transition | ## Quick Start [Section titled “Quick Start”](#quick-start) 1. Select your **IK Path** in the scene (the GameObject carrying the `IKPath` component). 2. Open the window via **Tools > realvirtual > Robot Program Export (Pro)**, or click **Export Robot Program (Beta)** at the bottom of the IK Path inspector. 3. Choose the **Target** controller from the dropdown. 4. Pick the motion mode (see below) and adjust the options. 5. Click **Preview** to generate the code and review it. 6. Click **Copy to Clipboard** to paste it into the controller editor, or **Save File…** to write it to disk (KUKA writes two files into a folder). The status line shows how many instructions were generated and whether any warnings (unreachable target, gimbal lock, missing kinematics) occurred. ## Options [Section titled “Options”](#options) **Target** Selects the controller dialect: ABB RAPID, KUKA KRL, Fanuc TP/LS, SEW MOVI-C (.srlprg) or Wandelbots NOVA. **Axis-based (MoveAbsJ) – recommended** When enabled, joint moves are exported as pure axis targets (ABB `MoveAbsJ` + `jointtarget`, KUKA `PTP {E6AXIS}`, Fanuc joint-representation positions, SEW `PTP_J`). This is unambiguous and avoids robot-configuration problems, so it is the recommended default. Turn it off for **Cartesian** output (`robtarget` / `E6POS` / `X,Y,Z + W,P,R`), which produces human-readable poses but requires correct configuration data. SEW emits joint moves as `PTP_J` and linear moves as `LIN` (Cartesian) independently of this toggle. **SEW: Kinematic number / MotionSet** SEW MOVI-C only. The kinematic number is written to the `// KINEMATIC:` header line (the machine-specific controller kinematic id); MotionSet is emitted as `MotionSet := `. Both default to `1` and match your MOVISUITE project. **ABB: snap speed to predefined v####** When enabled, the linear speed is mapped to the nearest predefined ABB speed value (`v5 … v7000`). When disabled, a custom `speeddata` is emitted with the exact speed. Applies to ABB only. **Include linked paths (StartNextPath)** When disabled (default), only the selected path’s own targets are exported. When enabled, the export follows the `StartNextPath` chain and concatenates all linked paths into one program. ## Output modes [Section titled “Output modes”](#output-modes) * **Axis-based (recommended)** — exact solved axis angles, one move per target, free of configuration ambiguity. Best for getting a path onto the controller reliably. * **Cartesian** — TCP poses (position + orientation) with the derived robot configuration. More readable and editable on the controller, but you must verify the configuration (ABB `robconf`, KUKA `S`/`T`, Fanuc `CONFIG`) for your cell. ## Validating the generated code [Section titled “Validating the generated code”](#validating-the-generated-code) Because there is no live connection, validate the output in the controller vendor’s offline tool before deploying: * **ABB** — RobotStudio (Basic edition is free): create a virtual controller and load the `.mod`. * **KUKA** — WorkVisual (free, syntax check) and KUKA.OfficeLite (trial, runs real KSS/KRL). The export targets classic KSS/KRL. * **Fanuc** — RoboGuide (trial): compile the `.ls` to `.tp` and run it in a virtual work cell. * **SEW** — load the `.srlprg` sequence program in MOVISUITE / MOVIKIT Robotics and verify it on the (virtual) controller; check the `KINEMATIC` number, `MotionSet` and the `REALVAR` signal mapping against your project. A built-in forward-kinematics check inside realvirtual is the always-available first line of validation. ## Limitations [Section titled “Limitations”](#limitations) * **Beta** — the Cartesian configuration derivation can be wrong in edge cases; the axis-based mode is the robust path. * **No live connection** — offline copy-paste only; no program upload (use the [robot interfaces](/doc/unity/components-and-scripts/interfaces/) for live coupling). * **6 axes only** — external axes / positioners and multi-robot programs are not exported; ABB/KUKA external-axis fields are written as “not in use” (`9E9` / `E1..E6 = 0`). * **No circular moves** — only point-to-point and linear moves are produced. * **SEW is teach-in, not text-programmed** — MOVIKIT Robotics computes the inverse kinematics on the controller and its `.srlprg` sequence syntax is not publicly documented; the exporter reproduces the observed program form, so verify the `KINEMATIC`/`MotionSet`/`REALVAR` mapping and dynamics against your MOVISUITE project. ## Extending: custom postprocessors [Section titled “Extending: custom postprocessors”](#extending-custom-postprocessors) The export uses an open architecture so you can add your own controller dialect or adapt an existing one. It has two layers: 1. **Conversion** — `IKPathToProgram.Convert(ikPath)` re-solves the path and produces a vendor-neutral `RobotProgram`: a list of `RobotMoveInstruction`s where the joint angles, the right-handed Cartesian position (mm), the rotation quaternion, the ZYX Euler angles, speeds, blend radius, signals and configuration flags are already computed once. 2. **Formatting** — a `RobotPostProcessor` subclass turns that model into controller text. The built-in ABB, KUKA, Fanuc and SEW postprocessors all share this base class. All files live in `Packages/io.realvirtual.professional/Runtime/IK/Export/` (the base, model and converter) and `Export/Vendors/` (the per-controller postprocessors) — the existing vendor files are the best templates to copy. ### Create your own postprocessor [Section titled “Create your own postprocessor”](#create-your-own-postprocessor) Subclass `RobotPostProcessor`, set the identity properties, and override the hooks you need. The base class drives the generation order (header → tool → frame → one `MoveJ`/`MoveL` per target plus its signals/dwell → footer) and writes everything into a shared `StringBuilder` (`AddLine(...)`): ```csharp public class MyControllerPostProcessor : RobotPostProcessor { public override string DisplayName => "My Controller"; public override string FileExtension => ".txt"; public override string GetFileName(RobotProgram prog) => prog.Name; protected override void Header(RobotProgram prog) => AddLine($"PROGRAM {prog.Name}"); protected override void Footer(RobotProgram prog) => AddLine("END"); protected override void MoveJ(RobotMoveInstruction m) => AddLine($"PTP J=[{Fmt(m.JointAngles[0])}, ... ,{Fmt(m.JointAngles[5])}] v={Fmt(m.JointSpeedPct)}%"); protected override void MoveL(RobotMoveInstruction m) => AddLine($"LIN X={Fmt(m.PositionMm.x)} Y={Fmt(m.PositionMm.y)} Z={Fmt(m.PositionMm.z)} " + $"A={Fmt(m.EulerZYXDeg.z)} B={Fmt(m.EulerZYXDeg.y)} C={Fmt(m.EulerZYXDeg.x)} v={Fmt(m.LinSpeedMmS)}"); protected override void SetDigitalOutput(string signal, bool value) => AddLine($"DOUT {signal}={value}"); protected override void WaitDigitalInput(string signal, bool value) => AddLine($"WAIT {signal}=={value}"); protected override void WaitTime(float seconds) => AddLine($"DELAY {Fmt(seconds)}"); } ``` Useful fields on each `RobotMoveInstruction`: `MoveType` (PTP / LIN), `JointAngles[6]` (deg), `PositionMm`, `RotationQuat`, `EulerZYXDeg` (`z`=A/Yaw, `y`=B/Pitch, `x`=C/Roll), `JointSpeedPct`, `LinSpeedMmS`, `LinAccelMmS2`, `BlendRadiusMm`, `EnableBlending`, `DwellSec`, `SetSignalName`, `WaitSignalName`, `PickPlaceSignalName` and the `Config` flags (`AbbConf`, `FanucTurns`, `Flip`, `Lower`, `KukaStatus`, `KukaTurn`). The static `RobotCoordConverter` provides the shared coordinate helpers (right-handed conversion, ZYX Euler, configuration flags). For more control you can override: * `Emit(RobotProgram)` — to produce **multiple files** (KUKA emits `.src` + `.dat` this way). * `Generate(RobotProgram)` — to take over the **whole layout** (the ABB postprocessor collects declarations separately). The SEW postprocessor instead keeps the base generation order and only overrides `Header`/`Footer` and the motion/signal hooks (`MoveJ`/`MoveL`/`SetDigitalOutput`/`WaitTime`) to emit its `.srlprg` form. ### Register it in the window [Section titled “Register it in the window”](#register-it-in-the-window) Add your postprocessor to `RobotProgramExportWindow` (`Packages/io.realvirtual.professional/Runtime/IK/private/Editor/`): add an entry to the `VendorNames` array and a matching `case` in `CreatePostProcessor()`. ### Change an existing postprocessor [Section titled “Change an existing postprocessor”](#change-an-existing-postprocessor) Edit the relevant file in `Export/Vendors/` (`ABBRapidPostProcessor.cs`, `KukaKrlPostProcessor.cs`, `FanucLsPostProcessor.cs`, `SewPostProcessors.cs`, `WandelbotsPostProcessors.cs`) — for example to change speed mapping, the program header, frame/tool defaults or the signal-address convention for your cell. ## See Also [Section titled “See Also”](#see-also) * [Robot Inverse Kinematics (Pro)](/doc/unity/components-and-scripts/robot-inverse-kinematics/) * [Interfaces](/doc/unity/components-and-scripts/interfaces/) # Debug Console > Debugging without the Unity Editor in a Build The **Debug Console** in realvirtual.io is based on the [Unity Ingame Debug Console](https://github.com/yasirkula/UnityIngameDebugConsole), which is licensed under the **MIT License** (Copyright © Süleyman Yasir KULA). This tool provides **full access to Unity’s console log in a build** and allows the execution of **custom commands**. It is particularly useful for **debugging** and for modifying specific **player application properties** during runtime. ![](/doc/unity/assets/48eE07eLQY.png) Debug Console ## How to Use the Debug Console [Section titled “How to Use the Debug Console”](#how-to-use-the-debug-console) 1. **Add the Debug Console Prefab**\ To enable the Debug Console in your project, add the prefab located at: ```plaintext Assets/realvirtual/UIPrefabs/DebugConsole.prefab ``` into your scene hierarchy. 2. **Opening the Debug Console**\ While running the simulation, you can open the Debug Console by clicking in the **bottom-left corner** of the screen. 3. **Console Log Indicators** * If there are any console log entries, small **icons** and a **log count** will appear to notify you. * You can review **warnings, errors, and other logs** in real time. 4. **Executing Commands**\ The Debug Console also supports **custom commands**, allowing you to trigger specific functions or modify application settings directly. ## Console Commands [Section titled “Console Commands”](#console-commands) To see a full list of available commands, type the following in the Debug Console’s input field: ```plaintext bashKopierenBearbeitenhelp ``` **Available Commands** | Command | Description | | ----------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | **ConnectOff** | Disables Connect Mode. This setting is saved for the next start. | | **ConnectOn** | Enables Connect Mode. This setting is saved for the next start. | | **DebugOff** | Turns off Debug Mode. The player must be restarted for this change to take effect. *Please note: Not all components take care about Global Debug Mode.* | | **DebugOn** | Turns on Global Debug Mode in realvirtualController. The player must be restarted for this change to take effect. *Please note: Not all components take care about Global Debug Mode.* | | **DeletePrefs** | Deletes all PlayerPrefs (everything what is saved with [RuntimePersistence](/doc/unity/basics/runtime-ui/runtime-persistence/) or saved manually via script). The model returns to the standard settings. | | **help** | Prints all available commands. | | **help \[commandName]** | Prints detailed information about the specified command. | | **InspectorOff** | Disables the Runtime Inspector. The player must be restarted for this change to take effect. | | **InspectorOn** | Enables the Runtime Inspector. The player must be restarted for this change to take effect. | For more information about implementing your own commands please check # Scene Interaction The **Scene Interaction** section in the realvirtual.io documentation introduces a suite of components designed to facilitate user interaction within your digital twin models. These tools enable the creation of interactive elements such as buttons, switches, and overlays, allowing users to engage with the simulation in real-time. Some of the functions are only available in realvirtual.io Professional. #### Key Components: [Section titled “Key Components:”](#key-components) * [**3D Buttons**](/doc/unity/components-and-scripts/scene-interaction/3d-buttons/): These are physical-like buttons placed within the 3D scene, mimicking real-world controls. They can be connected to PLC signals, enabling users to trigger actions like starting or stopping machinery directly within the simulation. * [**Screen Overlay Buttons**](/doc/unity/components-and-scripts/scene-interaction/screen-overlay-buttons/): UI elements that overlay the 3D scene, providing users with controls such as toggling views or initiating processes without interacting directly with 3D objects. * [**Scene Selectables (Pro)**:](/doc/unity/components-and-scripts/scene-interaction/scene-selectables-pro/) This system allows objects within the scene to be selectable during play mode. Selecting an object can display a window with options to manipulate predefined signals, facilitating dynamic interaction with scene elements. * [**Interact3D**: ](/doc/unity/components-and-scripts/scene-interaction/interact3d/)A script that enables user interactions such as pressing buttons or toggling switches within the 3D environment. It allows for defining behaviors like changing materials or triggering signals upon user actions. * [**UI Components (depracated)**](/doc/unity/components-and-scripts/scene-interaction/ui-components/): A collection of user interface elements including panels, buttons, and sliders that can be used to display information or provide controls within the simulation. * [**HMI Components (Pro)**](/doc/unity/components-and-scripts/scene-interaction/hmi-components-pro/): Advanced human-machine interface elements like tabs, dropdowns, and message displays, allowing for the creation of comprehensive control panels and dashboards within the simulation. [doc.realvirtual.io](/doc/unity/components-and-scripts/scene-interaction/hmi-components?utm_source=chatgpt.com/) # 3D Buttons > >- ![](/doc/unity/assets/Screenshot%202025-01-20%20142649.png) We provide 4 drag and drop prefrabs under realvirtual/3DPrefabs/ControlCabinet. Each button has at least one connected signal reflecting the current state of the button. In playmode, the user can simply toggle the state of each button by clicking it directly in the 3D space. ## EmergencyButton [Section titled “EmergencyButton”](#emergencybutton) ![](/doc/unity/assets/Screenshot%202025-01-20%20134908.png) The emergency button has a fairly simple set up. it has a connection to a PLCInputBool signal representing the current state of the button. Additionally the user can select if it is active when starting play mode. ![](/doc/unity/assets/Screenshot%202025-01-20%20135643.png) ## HandleSwitch [Section titled “HandleSwitch”](#handleswitch) ![](/doc/unity/assets/Screenshot%202025-01-20%20134846.png) The handle switch behaves identically to the emergency button and has the same properties. The handle switch comes with a second variant sharing the same functionality. ![](/doc/unity/assets/Screenshot%202025-01-20%20142418.png) ## PushButton [Section titled “PushButton”](#pushbutton) ![](/doc/unity/assets/Screenshot%202025-01-20%20134824.png) The push button implements some additional features to the functionality described above. Besides the state signal, the user can reference a light signal (PLCOutputBool). If the light signal is not set, the button light reflects the current state of the button, otherwise the light is controlled by the light signal. ![](/doc/unity/assets/Screenshot%202025-01-20%20135757.png) Additionally, the push button can not only act as a toggle but also as hold button. To enable the click and hold mode, simply turn off the Toggle option in the inspector. ![](/doc/unity/assets/Screenshot%202025-01-20%20135818.png) The button will now only be active while the user is clicking and holding the button, onrelease the button turns of after a minimum total pushing time which is defined by the Timer in the inspector. Moreover, the user can set the label text of the button by changing the label in the inpector. # HMI components (Deprecated) > only available in realvirtual.io Professional Danger **Deprecated — Unity-only, superseded by realvirtual WEB.** These uGUI HMI components are deprecated and are **not read by realvirtual WEB** — the browser-based 3D-HMI is a separate, re-architected system, not a port of these components. Migration status per component: * **HMI Marker → WebSensor** and **HMI Message → WebError / WebDiagnostics + CustomRuntimeInstruction** — equivalent capability exists in realvirtual WEB via new components; use those. * **HMI Value / HMI Text** — shown in the browser via hover tooltips, signal chips, KPI cards and WebSensor labels; there is no authored per-object overlay. * **HMI Slider / Switch / Pushbutton / DropDown / Tab and the HMI panel system** — interactive operator widgets with **no realvirtual WEB equivalent**; the browser HMI is built from WebSensor / WebError, KPI and message panels, and the React plugin layer. See **[realvirtual WEB](/doc/unity/extensions/realvirtual-web/)**, the single platform for delivering browser-based 3D-HMIs. Caution Please install CINEMACHINE via the package manager. [Cinemachine ](/doc/unity/advanced-topics/usefull-addons/#cinemachine)is needed for controlling the camera position for HMI messages. Please also make sure that “CINEMACHINE” is added as Scripting Define Symbols (`Project Setting > Player > Scripting Define Symbols`) HMI components are prefabricated UI components used to create 3D interfaces for automation systems. They can be connected to signals and integrated with various PLC interfaces such as [S7TCP](/doc/unity/components-and-scripts/interfaces/s7-tcp/), [TwinCAT](/doc/unity/components-and-scripts/interfaces/twincat/), [TwinCAT HMI](/doc/unity/components-and-scripts/interfaces/twincat-hmi/), [EthernetIP](/doc/unity/components-and-scripts/interfaces/ethernetip/), [OPCUA ](/doc/unity/components-and-scripts/interfaces/opcua/)and more. [](/doc/unity/assets/hmi.mp4) HMI example with error message ## Overview [Section titled “Overview”](#overview) HMI components are organized into “Tabs” which are overlays on the 3D scene and can be opened and closed by buttons or certain events. All HMI components can be connected with Signals and by this the can control or display scene or machine data. Certain HMI components can utilize Unity’s Cinemachine to manage multiple cameras and camera positions. To enable this functionality, ensure that you have the required [compile definition](/doc/unity/advanced-topics/compiler-defines/) in place The following components can be used for building individual HMI interfaces: * [HMI Tab](/doc/unity/components-and-scripts/scene-interaction/hmi-components-pro/hmi-tab/) * [HMI Pushbutton](/doc/unity/components-and-scripts/scene-interaction/hmi-components-pro/hmi-puschbutton/) * [HMI Switch](/doc/unity/components-and-scripts/scene-interaction/hmi-components-pro/hmi-switch/) * [HMI Value](/doc/unity/components-and-scripts/scene-interaction/hmi-components-pro/hmi-value/) * [HMI Text](/doc/unity/components-and-scripts/scene-interaction/hmi-components-pro/hmi-text/) * [HMI Slider](/doc/unity/components-and-scripts/scene-interaction/hmi-components-pro/hmi-slider/) * [HMI Drop Down](/doc/unity/components-and-scripts/scene-interaction/hmi-components-pro/hmi-dropdown/) * [HMI Message](/doc/unity/components-and-scripts/scene-interaction/hmi-components-pro/hmi-message/) ## Supported Use Cases [Section titled “Supported Use Cases”](#supported-use-cases) HMI components offer various use cases when combined with real machine controls. These include: 1. Displaying custom texts, such as IDs of machine components at 3D positions 2. Changing data on the industrial control by pushbuttons, sliders and pulldowns and switches 3. Representing sensor states as colored elements (booleans) at 3D positions 4. Showing values like axis positions and temperatures as 2D overlays or within the 3D scene 5. Presenting messages (normal, warning, and failure) that are connected to PLC outputs and inputs, allowing for acknowledgments. These messages can trigger specific 3D views and initiate custom animation sequences based on logical steps. ## Demo scene [Section titled “Demo scene”](#demo-scene) The HMI demo scene contains most of the realvirtual.io HMI functions. You find the demo scene `realvirutal/professional/HMI/Demo/DemoHMI.` Within the Demo folder you find also a scene with an example how to set up your own HMI. The scene [“emptyHMIscene”](/doc/unity/components-and-scripts/scene-interaction/hmi-components-pro/start-your-own-hmi/) is an example which can be used as a HMI prefab. The basic elements of this scene are available as prefabs. [](/doc/unity/assets/HMIDemoSceneExp.mp4) ## Common properties [Section titled “Common properties”](#common-properties) The following attributes are available at all interactive HMI components. ![](/doc/unity/assets/HMIBase.png) * `Color`: standard of the element when no user interaction * `Color Mouse` Over: color when the mouse pointer is on the element * `Alpha Visibility`: determine the occupancy of the element * `EventOnValueChanged`: Unity event when the value of the connected signal is changing ### HMI Controller [Section titled “HMI Controller”](#hmi-controller) The HMI controller must be added as a component to the topmost GameObject in the HMI area. It manages camera position changes and can also restrict mouse navigation for the user. ![](/doc/unity/assets/hmiController.png) # HMI DropDown (Deprecated) > realvirtual.io Professional Danger **Deprecated — no realvirtual WEB equivalent.** This interactive Unity uGUI control is deprecated. It is **not exported to realvirtual WEB** and has no direct counterpart there — the browser-based 3D-HMI does not use authored slider / switch / button / dropdown widgets. Instead, **[realvirtual WEB](/doc/unity/extensions/realvirtual-web/)** builds operator HMIs from its own components and plugin system (WebSensor, WebError, KPI and message panels, and the React overlay layer). Writing signals from the browser is handled by the connect/debug tools, not by authored control widgets. The drop down can be used as a part of a HMI tab or as the main control for selecting the tabs. If you use it as a main control for selecting the tabs only one Tab can be opened at once*.* The value of a PLCInputInt is set according to the selected menu element (from 0 to n). Within the HMI-Demo-scene it is used to switch in between camera views. To use it with the render mode “Worldspace” you need the HMI-PanelWorldSpace as parent. [](/doc/unity/assets/hmiDropDownExample.mp4) ## Properties [Section titled “Properties”](#properties) ![](/doc/unity/assets/hmiDropDown.png) * `Color Elements`: background color of the dropdown elements when inactive * `Color Selected`: background color of the selected (currently active) dropwodn element * `Menue Title`: title of the menue * `Title Font Size`: font size of the title * `DropDown Elements`: List of drop down elements as strings * `Start Mode`: mode/ menue item which is active when the game mode start * `SignalSelectedElement`: PLCInputInt - Value of the selected Dropdown element * `SignalSetElement`: PLCOutputInt - Value to set the selected element from PLC side. * `Duration`: duration in second how long the drop down appears * Activate On Mouse Enter: activates the dropdown when the mouse pointer enter # HMI Marker (Deprecated) Danger **Deprecated — replaced in realvirtual WEB.** This Unity uGUI marker is deprecated and is **not read by realvirtual WEB**. The browser-based 3D-HMI provides signal-bound status indication through the **WebSensor** component — Low / High / Warning / Error states, ISA-101 colors and a 3D overlay — which exports via `rv_extras` and renders in **[realvirtual WEB](/doc/unity/extensions/realvirtual-web/)**. Use `WebSensor` instead of `HMI Marker` for new work. HMI-Marker are used to visualize the state of a signal. They have to be within the “Worldspace”-Section of a tab. ![](/doc/unity/assets/hmiMarkerEx%20\(1\).png) The current prefab provides a simple cube as a marker object. But it is possible to customize this with a own mesh elements. The structure of the marker includes currently a game object “Icon” to map a user defined icon on the marker object. ![](/doc/unity/assets/hmiMarkerStructure.png) ## Properties [Section titled “Properties”](#properties) ![](/doc/unity/assets/hmiMarker.png) * Color On: Material which is active when the connected signal is high * `Color Off:` Material which is active when the connected signal is low * `ObjectTracking`: boolean wether the value object is placed next to a game object within the scene or not * `TrackedObject`: game object within the scene which position is used to place the HMI value information * `Offset` : Offset position to the object in up direction. * `EnableGameObjectOnSignalTrue:` sets the defined game object active if the signal value is true * `EnableGameObjectOnSignalFalse:` sets the defined game object active if the signal value is false * `Signal Bool:` signal whose values are indicated by the marker # HMI Message (Deprecated) > realvirtual.io Professional Danger **Deprecated — replaced in realvirtual WEB.** This Unity uGUI message runtime is deprecated and is **not read by realvirtual WEB**. In the browser, signal-driven alarms and messages are provided by the **WebError** and **WebDiagnostics** components (feeding the WEB message/alarm panel), and step-by-step operator instructions by **CustomRuntimeInstruction** (with per-step 3D highlighting and isolate-on-click). See **[realvirtual WEB](/doc/unity/extensions/realvirtual-web/)**. Use those components instead of `HMI Message` for new work. HMI Messages can be used to display for example warnings, failures or maintenance information based on the PLC Status. Each HMI Message is activated by a PLCOutputBool. [](/doc/unity/assets/hmiMsgExmp.mp4) Messages are sorted into the message stack by category (Failure, Warning, Message) and based on the time stamps. Messages can be modal (they ned to be Acknowledged before any other Message can be displayed) or not. If Messages are not modal they can be closed without acknowledgement. They are sorted to the last position on the message stack. To provide messages consists of 3 areas 1. on the left: message icon 2. in the middle: message text and the time stamp 3. on the right: message buttons: 1. show/ information button 2. acknowledge button 3. cancel button ![](/doc/unity/assets/hmiExampelMsg.png) example of a Warning message ### HMI Message [Section titled “HMI Message”](#hmi-message) Currently 3 types of messages can be definded: *Message*, *Warning* and *Failure*. ![](/doc/unity/assets/hmimessage%20\(3\).png) * `Msg Type` * `Use User Defined Color`: custom background color. By default are the following colors are set *Message* —> light grey; *Warning* —> yellow; *Failure* —> red * `Background Color`: user defined background color of the message * `Use User Defined Icon:` custom icon on the left hand side of the message * `Message Icon:` user icon * `Text`: text of the message * `Size Text`: font size of the message * `Show Time Stamp:` boolean, if true a time stamp is shown at the lower left corner * `Modal` : if true this messag is modal and everything else is closed. You must acknowledge the message before anything else can be displayed. * `Message Check Time:` duration after the message signal is checked again after canceling the message. * `Cancel Button:` bool, if true a cancel button appears in the message * `Acknowledge Button:` bool, if true a acknowledge button appears in the message * `Show Button:` bool, if true a show button appears in the message * `Message Camera`: Optional cinemachine camera for defining the camera position for this message. * `Camera Show Details:` second cinemachine camera to focus on a certain detail * `Highlighting:` bool, if true a user defined meshrenderer is highlighted when the message is active * `Highlight Object` : list of objects (mesh-renderer) to highlight, when the message is active * `Highlight Material:` material which is used to highlight * `FlickerEffectMaterial:` bool, if true the material flickers * `FlickerMaterial:` second material of the flicker effect * `FlickerTime:` float for the flicker speed * `SignalMessage` : signal of type PLC Output Bool. When the signal is true the message is active. * `Signal Acknowledge` : signal of type PLC Input Bool. When the user confirms the message by using the button *“Acknowledge”* the message will be closed. * `Signal Cancel` : Optional signal of type PLC Input Bool. When the user is pressing the cancel button the message will be put back on the last position of the stack. * `References:` game object references to set all message information. # HMI Pushbutton (Deprecated) > realvirtual.io Professional Danger **Deprecated — no realvirtual WEB equivalent.** This interactive Unity uGUI control is deprecated. It is **not exported to realvirtual WEB** and has no direct counterpart there — the browser-based 3D-HMI does not use authored slider / switch / button / dropdown widgets. Instead, **[realvirtual WEB](/doc/unity/extensions/realvirtual-web/)** builds operator HMIs from its own components and plugin system (WebSensor, WebError, KPI and message panels, and the React overlay layer). Writing signals from the browser is handled by the connect/debug tools, not by authored control widgets. The HMI Pushbutton is used to set a signal for a certain time to high (boolean value true). To use it with the render mode “Worldspace” you need the HMI-PanelWorldSpace as parent. [](/doc/unity/assets/hmiPushbutton.mp4) Pressing the Pushbutton "Send Warning": the message tab shows the received warning message for a defined amount of time. ## Properties [Section titled “Properties”](#properties) ![](/doc/unity/assets/HMIPushButton.png) * `SignalButtonPushed` : signal which will be set by the button * `Min high Time` : minimum high time of the signal * `Button text` : free text which is shown within the button * `Text Size:` font size of the button text * `Color 1 Signal` to `Color 3 Signal` and Colors: the button can change the color depending on boolean Signals # HMI Slider (Deprecated) > realvirtual.io Professional Danger **Deprecated — no realvirtual WEB equivalent.** This interactive Unity uGUI control is deprecated. It is **not exported to realvirtual WEB** and has no direct counterpart there — the browser-based 3D-HMI does not use authored slider / switch / button / dropdown widgets. Instead, **[realvirtual WEB](/doc/unity/extensions/realvirtual-web/)** builds operator HMIs from its own components and plugin system (WebSensor, WebError, KPI and message panels, and the React overlay layer). Writing signals from the browser is handled by the connect/debug tools, not by authored control widgets. The HMI Value slider can set PLCInputFloat or PLCInputInt values on the connected PLC.. The Value is always displayed. The slider appears as soon as the user is hovering over the object with the mouse. To use it with the render mode “Worldspace” you need the HMI-PanelWorldSpace as parent. [](/doc/unity/assets/hmisliderEx.mp4) ## Properties [Section titled “Properties”](#properties) ![](/doc/unity/assets/HMISlider.png) * `Min Value` : minimum value of the slider * `Max Value`: maximum value of the slider * `Value`: Current and start value of the slider * `Font Size Valu`e: font size of the displayed value * `Activate On Mouse Ente`r: if true the slider only appears when the mouse pointer enters the value area * `Format`: * `SignalInt` : connected PLCInputInt Signal * `SignalFloat` : connected PLCInputFloat Signal * `SignalIntStart` : connected PLCOutputInt Signal which is set when the application is staring * `SignalFloatStart` : connected PLCOutputFloat Signal which is set when the application is starting * `Title`: title or short description of the slider value * `Display Unit` : true do display a unit right next to the value * `Unit`: user defined unit string * `Unit Font Size` : font size of the unit # HMI Switch (Deprecated) > realvirtual.io Professional Danger **Deprecated — no realvirtual WEB equivalent.** This interactive Unity uGUI control is deprecated. It is **not exported to realvirtual WEB** and has no direct counterpart there — the browser-based 3D-HMI does not use authored slider / switch / button / dropdown widgets. Instead, **[realvirtual WEB](/doc/unity/extensions/realvirtual-web/)** builds operator HMIs from its own components and plugin system (WebSensor, WebError, KPI and message panels, and the React overlay layer). Writing signals from the browser is handled by the connect/debug tools, not by authored control widgets. The HMI Switch works as toggle switching the connected Signal status between true and false. To use it with the render mode “Worldspace” you need the HMI-PanelWorldSpace as parent. ![](/doc/unity/assets/hmiSwitchExample.png) Switches are used to start and stop\ the can conveyor and the gantry. ## Properties [Section titled “Properties”](#properties) ![](/doc/unity/assets/HMISwitch.png) * `ColorOn` : color in case of Signal status true * `SignalOn` : PLCInputBool signal connected to the Button * `SignalInit` : PLCOutputBool signal for the value of the Switch when the application starts * `Text`: Button text * `Text Size` : font size * `IsOn` : read only for the current state of the switch # HMI Tab (Deprecated) > realvirtual.io Professional Danger **Deprecated — no realvirtual WEB equivalent.** This Unity uGUI tab/panel overlay is deprecated and is **not exported to realvirtual WEB**. The browser-based 3D-HMI is not built from these in-scene tabs: **[realvirtual WEB](/doc/unity/extensions/realvirtual-web/)** provides its own HMI framework (WebSensor, WebError, KPI and message panels, and a React overlay/plugin layer with configurable slots). Build browser HMIs there rather than porting this tab setup. An HMI tab is a user interface overlay that includes multiple elements. We recommend that you start your own tabs based on the existing Tabs within the HMI Demoscene Activation of the tabs can be done either through a button a dropdown menu or a PLC-signal. ![](/doc/unity/assets/hmiControl.png) ## Tab properties [Section titled “Tab properties”](#tab-properties) ![](/doc/unity/assets/HMI_Tab.png) HMI Tab properties * `Tab Activated:` Boolean if the tab is active. * `Modal`: true, if this Tab can’t be opened with other Tabs in same time. If it is modal other tabs will be closed automatically. * `Camera:` Cinemachine camera which is activated when the tab is activated * `SignalTab`: PLC Output bool signal which activates / deactivate the tab ## Custom Tabs [Section titled “Custom Tabs”](#custom-tabs) To create a custom tab pull the prefab “HMI\_Tab” in your scene and unpack the prefab. (Right-click on the game object and choose Prefab/unpack completely). ![](/doc/unity/assets/HMItabStructure%20\(1\).png) HMI Tab structure Do not rename the GameObjects within the HMI-prefab. The tab’s content consists of two areas: OverlayContent for HMI-elements displayed as a screen overlay, and WorldspaceContent without a Canvas where elements automatically receive a canvas in “WorldSpace” render mode. These elements will be placed in the 3D scene.” If you use [HMI-messages](/doc/unity/components-and-scripts/scene-interaction/hmi-components-pro/hmi-message/) in one of the areas the HMI-tab will detect this and manage them. ## HMI TabButton [Section titled “HMI TabButton”](#hmi-tabbutton) The HMI TabButton is a button which can be placed on the UI for enabling and disabling Tabs. ![](/doc/unity/assets/HMITabButton%20\(1\).png) * Tab: HMI tab which is controlled by the button * Connected Tab Active: Background color of the button when the tab is active. * SignalButtonOn: signal to turn the Button on. * Button Image: sprite image of the button * Color 1 Signal to Color 3 Signal and Colors: the button can change the color depending on which signal is currently true. * Image1 to Image3: can be used to change the image of the button depenting on the PLC state # HMI Text (Deprecated) > realvirtual.io Professional Danger **Deprecated — no authored equivalent in realvirtual WEB.** This Unity uGUI text overlay is deprecated and is **not read by realvirtual WEB**. In the browser, static text is provided by **WebSensor** labels and scene annotations, and dynamic values by tooltips and signal chips — there is no authored per-object text overlay. See **[realvirtual WEB](/doc/unity/extensions/realvirtual-web/)**. HMI Value is displaying texts for example identification codes or general information.\ The example below shows texts with the overlay option (BMK tags) and tags with a canvas in render mode “Worldspace” including the follow camera option. [](/doc/unity/assets/hmiTextExample.mp4) ## Properties [Section titled “Properties”](#properties) ![](/doc/unity/assets/hmiText.png) * `Text:` user defined text * `Text Font Size:` font size of the text * `Signal Activate Information:` PLC-signal to set the text active * `Follow Camera:` text orientation follows the camera (only relevant in canvas render mode “WorldSpace” * `Object Tracking:` activates the object tracking * `Tracked Object:` tracked Object of the HMI-Text * `Offset:` position offset # HMI Value (Deprecated) > realvirtual.io Professional Danger **Deprecated — no authored equivalent in realvirtual WEB.** This Unity uGUI value display is deprecated and is **not read by realvirtual WEB**. In the browser, live signal values are shown through hover tooltips, signal chips/badges and KPI cards rather than an authored per-object value overlay. See **[realvirtual WEB](/doc/unity/extensions/realvirtual-web/)**. HMI Value is displaying values (PLCOutputFloats or PLCOutputInts) for example the number of produced parts, axis positions or temperatures. [](/doc/unity/assets/hmiValueLife.mp4) Example HMI-Value moving with the tracked object. ## Properties [Section titled “Properties”](#properties) ![](/doc/unity/assets/hmiValue.png) * `Title`: short describtion or name of the value * `Title Font Size` : font size of the title * `Display Unit` : true do display a unit right next to the value * `Unit`: user defined unit string * `Unit Font Size` : font size of the unit * `Value Font Size`: font size of the value * `Format` : number format * `Follow Camera:` the orientation of the panel is always directed to the camera (only relevant if the canvas uses the render mode “Worldspace”) * `ObjectTracking`: boolean wether the value object is placed next to a game object within the scene or not * `TrackedObject`: game object within the scene which position is used to place the HMI value information * `Offset` : Offset position to the object in up direction. * `SignalInt`: Connected PLCOutputInt Signal * `SignalFloat` : Connected PLCOutputFloat Signal # Start your own HMI (Deprecated) > example to set up your own HMI Danger **Deprecated — no realvirtual WEB equivalent.** The Unity uGUI HMI panel/tab system is deprecated and is **not exported to realvirtual WEB**. The browser-based 3D-HMI is not built from these in-scene panels: **[realvirtual WEB](/doc/unity/extensions/realvirtual-web/)** provides its own HMI framework (WebSensor, WebError, KPI and message panels, and a React overlay/plugin layer with configurable slots). Build browser HMIs there rather than porting this panel setup. The scene `EmtySceneHMI`only consists of HMI components, demonstrating a standard HMI structure. This is also available as a Prefab HMI serving as a foundation for creating your own HMI. To incorporate the `HMI` prefab, insert it into your scene and customize it to fit your requirements by adding or removing elements under the appropriate content game object. To make these modifications, simply right-click on the game object in the hierarchy and select `Prefab/UnpackCompletly`.\ The example scene contains two HMI-Tabs. ![](/doc/unity/assets/HMIemptyScene.png) Hierarchy overview HMI They are activated and deactivated by Tab-Buttons which are organized in a separat panel. The panel is an overlay and always visible. ## HMI-Tab 1 - details [Section titled “HMI-Tab 1 - details”](#hmi-tab-1---details) HMI-Tab1 shows how to set up a overlay panel. The game object “Panel” uses the component “VerticalLayoutGroup” to organize the buttons by setting the padding and the spacing in between elements. ![](/doc/unity/assets/HMIexTab1.png) To change the size of an element use the parameter “Width” and “Height” of the component “RectTransform”. This is possible for all HMI elements. ![](/doc/unity/assets/HMIRectTrans.png) RectTransform component ## HMI-Tab 2 details [Section titled “HMI-Tab 2 details”](#hmi-tab-2-details) HMI-Tab 2 uses an overlay content and contains elements in world space. The gif below shows you how the different elements appear when you navigate through the scene: [](/doc/unity/assets/HMIworldSpaceEx.mp4) Behavior HMI-elements in render mode "Worldspace" The overlay content stays always at the same position. It contains an example how to use a [Drop-Down-Menu](/doc/unity/components-and-scripts/scene-interaction/hmi-components-pro/hmi-dropdown/) and a [Value Display](/doc/unity/components-and-scripts/scene-interaction/hmi-components-pro/hmi-value/). ![](/doc/unity/assets/HMIexTab2.png) The “WorldspaceContent” section contains two separate elements: [HMI\_Marker ](/doc/unity/components-and-scripts/scene-interaction/hmi-components-pro/hmi-marker/)and [HMI\_Text](/doc/unity/components-and-scripts/scene-interaction/hmi-components-pro/hmi-text/). The HMI\_Text, as well as the [HMI\_Value](/doc/unity/components-and-scripts/scene-interaction/hmi-components-pro/hmi-value/), check if they’re positioned beneath a canvas. If no canvas is found in the parent object, the “Canvas” component is automatically added and set to “Worldspace” render mode. This feature is currently only available for this HMI-elements. For the other HMI-elements you can use the `HMI_PanelWorldSpace` prefab, which already includes the canvas component. Just place this prefab under “WorldspaceContent.” Subsequent HMI elements are added beneath the panel. This approach allows you to create a user panel within your scene. The [HMI Marker](/doc/unity/components-and-scripts/scene-interaction/hmi-components-pro/hmi-marker/) doesn’t need a canvas because it is a 3D object. # Interact3D The Interact3D script alows you to define user interaction like pushbuttons, switches or opening of doors in the 3D scene. This script can be attached to any component with a collider. If the user is clicking on the object the status will change. ![](/doc/unity/assets/interact3d.png) ### Properties[](#properties) [Section titled “Properties ”](#properties) You can set the following properties **Switch**\ True if interaction should work like a switch, if false it works like a button. **MaterialOn**\ Material which should be used for Mesh renderer for the ON status of the Switch or Button. **MaterialOnMouseDown**\ Material which should be used for the Mesh renderer on mouse down. **MaterialOnBlocked**\ Material which should be used if interaction is blocked by a PLCSignal **DurationMaterialOnBlocked**\ Duration of visual feedback with MaterialOnBlocked. If user is pressing button and it is blocked by PLC the blocked status will be visualized. **MaterialPLCOn**\ Material which should be used if PLC Output signal SignalOn is true. **LightOn**\ Optional light which is turned on on ON status. **LightPLCOn**\ Optional light which is turned on if PLC Output signal SignalOn is true. **SignalIsOn**\ PLCInput if button or switch status is on. **SignalOn**\ PLCOutput to turn PLCOn Status on. **SignalBlocked**\ PLCOutput to block interaction with button (e.g. for security doors). © 2025 realvirtual GmbH [https://realvirtual.io](https://realvirtual.io/) - All rights reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or by any means, including printing, saving, photocopying, recording, or other electronic or mechanical methods, without the prior written permission of the publisher. # KeyboardMove Note **New Feature**: The KeyboardMove component is not yet released and will be part of realvirtual version 6.0.5. The **KeyboardMove** component enables precise manual positioning of GameObjects using keyboard input with smooth interpolation and configurable movement boundaries. ## Overview [Section titled “Overview”](#overview) KeyboardMove provides interactive control over GameObject positioning in automation simulations through customizable keyboard inputs. This component is particularly useful for manual positioning tasks during commissioning, debugging object placement, or creating interactive demonstrations where users need direct control over object movement. **Important**: KeyboardMove only moves the specific GameObject it is attached to, along with all of its child objects. The movement occurs in the object’s local coordinate system, meaning the X, Y, and Z axes are relative to the object’s current rotation and orientation, not the world coordinate system. The component supports independent control of all three axes with dual-key combinations, allowing for complex movement patterns while maintaining precise control. This local space movement behavior makes it ideal for controlling objects that may be oriented in various directions within your scene, as the movement directions remain consistent relative to the object’s own coordinate system. > **💡 Hint**\ > KeyboardMove uses Unity’s standard unit system where 1 unit equals 1 meter. All speed and limit values are specified in meters and meters per second. > **💡 Hint**\ > KeyboardMove is designed for manual control during setup, debugging, and testing phases. It is not a Drive-based movement system and should not be used as a replacement for automated movements in production automation sequences. Use Drive components for programmed automation movements. ![KeyboardMove component in Unity Inspector](/doc/unity/assets/keyboard-move-inspector.png) KeyboardMove component in Unity Inspector ## Properties [Section titled “Properties”](#properties) ### Movement Settings [Section titled “Movement Settings”](#movement-settings) **Speed** (float) Controls the movement velocity in meters per second when keys are pressed. Higher values result in faster movement, while lower values provide finer control for precise positioning tasks. The default value of 1 m/s provides a good balance for most applications. **LerpFactor** (float) Determines the smoothness of movement interpolation, with higher values producing more responsive movement and lower values creating smoother, more gradual transitions. Values between 1 and 20 are recommended, with 10 being the default that works well for most scenarios. This smoothing helps create natural-looking movement without abrupt starts and stops. ### Input Keys - X Axis [Section titled “Input Keys - X Axis”](#input-keys---x-axis) The X axis controls left and right movement in the object’s local coordinate system. **XNegativeKey1** (KeyCode) Primary key for negative X axis movement (typically left). Default is Keypad4 for intuitive numpad control. **XNegativeKey2** (KeyCode) Optional secondary key for negative X movement. When set to a value other than None, both keys must be pressed simultaneously to trigger movement. This dual-key requirement is useful for preventing accidental movements in critical positioning tasks. **XPositiveKey1** (KeyCode) Primary key for positive X axis movement (typically right). Default is Keypad6, maintaining consistency with numpad layout. **XPositiveKey2** (KeyCode) Optional secondary key for positive X movement, following the same dual-key logic as the negative direction. ### Input Keys - Y Axis [Section titled “Input Keys - Y Axis”](#input-keys---y-axis) The Y axis controls vertical movement (up and down) in the object’s local coordinate system. **YNegativeKey1** (KeyCode) Primary key for negative Y axis movement (typically down). Default is None, as vertical movement is often not required in automation scenarios. **YNegativeKey2** (KeyCode) Optional secondary key for negative Y movement with dual-key support. **YPositiveKey1** (KeyCode) Primary key for positive Y axis movement (typically up). Default is None. **YPositiveKey2** (KeyCode) Optional secondary key for positive Y movement. ### Input Keys - Z Axis [Section titled “Input Keys - Z Axis”](#input-keys---z-axis) The Z axis controls forward and backward movement in the object’s local coordinate system. **ZNegativeKey1** (KeyCode) Primary key for negative Z axis movement (typically backward). Default is Keypad2 for logical numpad navigation. **ZNegativeKey2** (KeyCode) Optional secondary key for negative Z movement with dual-key functionality. **ZPositiveKey1** (KeyCode) Primary key for positive Z axis movement (typically forward). Default is Keypad8, completing the intuitive numpad control scheme. **ZPositiveKey2** (KeyCode) Optional secondary key for positive Z movement. ### Reset Control [Section titled “Reset Control”](#reset-control) **ResetKey** (KeyCode) Key used to instantly reset the GameObject to its initial position. Default is Keypad5, providing quick access to return to the starting position during positioning tasks. This feature is particularly useful when you need to quickly return to a known reference point after extensive movement. ### Movement Limits [Section titled “Movement Limits”](#movement-limits) All movement limits are specified relative to the GameObject’s initial position when the component starts. **XAxisLimits** (Vector2) Defines the minimum (x) and maximum (y) allowed positions along the X axis in meters from the initial position. The default range of -10 to +10 meters provides ample movement space while preventing objects from moving too far from their starting point. **YAxisLimits** (Vector2) Sets the vertical movement boundaries in meters from the initial position. These limits ensure objects remain within designated height ranges, particularly important for crane systems or vertical lift mechanisms. **ZAxisLimits** (Vector2) Establishes forward and backward movement boundaries in meters from the initial position. These constraints are essential for preventing collisions and keeping objects within their operational areas. ## Editor Tools [Section titled “Editor Tools”](#editor-tools) ### Visual Gizmos [Section titled “Visual Gizmos”](#visual-gizmos) When the GameObject with KeyboardMove is selected in the Unity Editor, cyan wireframe boundaries visualize the allowed movement area. This wireframe cube shows the exact limits defined by the axis limit properties, making it easy to understand and adjust the movement constraints. A yellow sphere marks the initial position (center point) of the movement area, providing a clear reference for the origin of all movement calculations. During play mode, a red sphere indicates the current target position, helping debug movement behavior and verify that limits are working correctly. ## Usage Examples [Section titled “Usage Examples”](#usage-examples) ### Basic Setup for Manual Positioning [Section titled “Basic Setup for Manual Positioning”](#basic-setup-for-manual-positioning) 1. Add the **KeyboardMove** component to any GameObject you want to control 2. Configure the **Speed** to match your desired movement rate (1-5 m/s for general use) 3. Adjust **LerpFactor** for movement smoothness (5-10 for smooth motion, 15-20 for responsive control) 4. Set appropriate **Movement Limits** based on your scene constraints 5. Press Play and use the configured keys to move the object ### Numpad Control Configuration [Section titled “Numpad Control Configuration”](#numpad-control-configuration) The default configuration uses the numpad for intuitive movement control: * Numpad 4/6: Left/Right movement (X axis) * Numpad 8/2: Forward/Backward movement (Z axis) * Numpad 5: Reset to initial position * Y axis keys can be configured if vertical control is needed This layout mirrors common industrial control panels and provides logical spatial mapping. ### Dual-Key Safety Setup [Section titled “Dual-Key Safety Setup”](#dual-key-safety-setup) For critical positioning tasks where accidental movement must be prevented: 1. Set **XNegativeKey2** to LeftShift or LeftControl 2. Set **XPositiveKey2** to the same modifier key 3. Repeat for Y and Z axes as needed 4. Movement now requires holding the modifier key plus the direction key This configuration ensures deliberate control actions and prevents unintended movements. # Lamp ## Overview [Section titled “Overview”](#overview) The **Lamp** component turns any mesh into a visual status indicator — a signal tower light, a button lamp, a machine state beacon. It drives the emission color and intensity of the renderer through a `MaterialPropertyBlock`, so no per-renderer material is instantiated and GPU batching is preserved. The lamp can be switched on and off, set to flash at a configurable rate, and driven directly from PLC signals. ![Lamp status indicator](/doc/unity/assets/lamp.png) Note This component was reworked in realvirtual **6.3.3** to use emission overrides via `MaterialPropertyBlock`. Caution The shared material on the lamp’s MeshRenderer must have **emission enabled** (URP Lit, HDRP Lit, or Standard with the `_EMISSION` keyword active) for the color override to be visible. When you add the component in the editor it assigns the built-in **Lamp** material automatically. ## Properties [Section titled “Properties”](#properties) **On Color** (Color) The emission color shown while the lamp is on. Also applied as the base color so the lamp reads correctly when unlit. **Intensity** (float) HDR emission intensity multiplier applied to the On Color. Higher values produce a stronger glow and bloom. Set to `0` for a flat, non-glowing color. **Flashing** (boolean) When enabled, the lamp blinks instead of staying steady. Can also be driven at runtime by the flashing signal. **Period** (float) Flashing period in seconds — the full on/off cycle length. The lamp is on for half the period and off for the other half. **Lamp On** (boolean) The current on/off state. Toggle it in the Inspector to test, or let the PLC signal control it. **Signal Lamp On** (PLCOutputBool) PLC signal that switches the lamp on and off. When assigned, it overrides the manual Lamp On state each frame. **Signal Lamp Flashing** (PLCOutputBool) PLC signal that enables or disables flashing mode at runtime. ## Quick Start [Section titled “Quick Start”](#quick-start) 1. Add the **Lamp** component to a GameObject that has a MeshRenderer (e.g. a cylinder or a signal-light mesh). 2. Pick the **On Color** and adjust **Intensity** until the glow looks right. 3. To test, enable **Lamp On** in the Inspector during play mode. 4. For PLC control, assign **Signal Lamp On** (and optionally **Signal Lamp Flashing**) to your interface signals. 5. For a blinking warning light, enable **Flashing** and set the **Period**. ## Common Use Cases [Section titled “Common Use Cases”](#common-use-cases) * **Signal tower** – Stack several lamps (red/amber/green) driven by machine-state signals. * **Button lamps** – Illuminate operator panel buttons based on PLC outputs. * **Fault indication** – Flashing red lamp tied to an alarm or collision signal. * **Status beacon** – Steady green for running, flashing amber for warning. ## See Also [Section titled “See Also”](#see-also) * [Signals and Interfaces](/doc/unity/components-and-scripts/interfaces/) *** © 2025 realvirtual GmbH [https://realvirtual.io](https://realvirtual.io/) - All rights reserved. # ModelZoo (Pro) > Building your own scene launcher like in our realvirtual.io ModelZoo # Runtime Metadata (Pro) > Attach part information to 3D objects and search, highlight and inspect it at runtime ## Overview [Section titled “Overview”](#overview) Runtime Metadata attaches information to the parts of your 3D model: article numbers, technical data, live PLC signal values and links to documents. At runtime the operator searches this information in a toolbar at the bottom of the screen. Matching parts are highlighted in the 3D scene and show their data in a small window. The system consists of three building blocks: * **Runtime Metadata** – the component on each part. It holds the information as a short tagged text. * **Metadata Manager** – one per scene. It provides the search toolbar and controls which parts are highlighted and which windows are shown. * **Excel Metadata Setup** – optional. It creates the Runtime Metadata components for a whole CAD assembly from a part list. The same content is exported with the GLB and used by realvirtual WEB for hover tooltips and for linking parts to their documents. See [Building a 3D-HMI](/doc/unity/extensions/realvirtual-web/3d-hmi/). Caution The runtime windows and the search toolbar are built with the Unity **App UI** package. Import its **UI Kit** sample once per project (**Window → Package Manager → App UI → Samples → UI Kit → Import**). Without it the windows appear as empty dark boxes and the Console shows *“No Theme Style Sheet set to PanelSettings”*. ## Quick Start [Section titled “Quick Start”](#quick-start) 1. Drag the **MetadataManager** prefab from *Packages/realvirtual Professional/RuntimeUISystem* into your scene. It already contains the **UIManager** that renders the windows. 2. Select a part and add the **Runtime Metadata** component. **Runtime UI Window** and **Runtime Interactable** are added automatically. 3. Write the part information into the **Content** field (see [Content Syntax](/doc/unity/components-and-scripts/scene-interaction/runtime-metadata/#content-syntax)). 4. On **Runtime Interactable**, assign a highlighter to **Base Highlight** and **Hover Highlight**, for example *realvirtual/Highlighter/Highlight 1* and *realvirtual/Highlighter/Outline*. 5. Start play mode, type a search term into the toolbar at the bottom and press **Enter**. ## Runtime Metadata [Section titled “Runtime Metadata”](#runtime-metadata) ### Properties [Section titled “Properties”](#properties) **Content** (text) The information shown for this part, written with the tags described below. The first `` entry is also the name the search uses for this part. **Window** (Runtime UI Window) The window that displays the content. It is assigned automatically when you add the component. **Interactable** (Runtime Interactable) The component that highlights the part and makes it react to the mouse. It is assigned automatically when you add the component. On **Runtime Interactable**: **Base Highlight** (selection manager) The highlighter applied while the part matches the current search. **Hover Highlight** (selection manager) The highlighter applied additionally while the mouse is over the part in Hover mode. **On Highlight Activated / Deactivated, On Hover Start / End** (events) Optional Unity events to trigger your own reactions, for example to play a sound or show an additional object. ### Content Syntax [Section titled “Content Syntax”](#content-syntax) Each line of information is one tag. The entries are shown in the window from top to bottom in the order you write them. | Tag | Result in the window | | ---------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | | `Entry Conveyor Motor` | Bold title. Also used as the display name in the search. | | `Live Signals` | Bold section header. | | `Geared motor driving the belt.` | A line of plain text. | | `GM-0370-B14` | A labeled value. | | `EntryConveyorStart` | A labeled value that shows the live value of the PLC signal with this name. | | `Open data sheet` | A button that opens the URL. A path without `http://` or `https://` opens the matching page of the realvirtual documentation. | Example: ```xml Entry Conveyor Motor Geared motor driving the entry conveyor belt. GM-0370-B14 Demo Drives GmbH 0.37 kW Live Signals EntryConveyorStart Open data sheet ``` Note Signals are found by their signal name, which is case-sensitive. Bool signals show *True* / *False*, float signals show two decimals. If no signal with this name exists, the window shows *Signal not found*. Tags cannot be nested, and the text inside a tag must not contain the `<` character. ## Metadata Manager [Section titled “Metadata Manager”](#metadata-manager) The Metadata Manager adds a toolbar to the bottom of the screen. It collects all Runtime Metadata components when the scene starts. ### Using the Toolbar [Section titled “Using the Toolbar”](#using-the-toolbar) * **Search field** – Type to get suggestions. Parts whose name starts with your text come first, then parts whose name contains it, then parts where it appears anywhere in the content. Press **Enter** or click a suggestion to apply the search. All matching parts are highlighted. The search is not case-sensitive and accepts regular expressions. * **Clear** (x) – Removes all highlights and windows and empties the search field. * **Show all** (pointer) – Makes every part with metadata react to the mouse without highlighting it. This overrides the search. * **Always / Hover** (info) – Switches the display mode. In **Hover** mode a window appears when you move the mouse over a highlighted part. In **Always** mode every highlighted part that is visible on screen shows its window permanently. * **Camera follow** (camera) – Moves the camera so that all highlighted parts stay in view. ### Properties [Section titled “Properties”](#properties-1) **Mode** (Always / Hover) The display mode the scene starts with. The operator can switch it in the toolbar. **Pattern** (string) The search text the scene starts with. Leave it empty to start without an active search. **Max Active Interactables** (integer) The largest number of parts one search may highlight. If a search matches more parts, nothing is highlighted and a message asks the operator to refine the search. Use this to keep large CAD models responsive. 0 means no limit. **View Margin** (float) The free space around the highlighted parts when camera follow is active. 1 is a tight fit, larger values zoom out further. **Max Suggestions** (integer) The largest number of suggestions shown below the search field. **Enable Suggestion Preview** (boolean) If set to true, moving the mouse or the arrow keys over a suggestion highlights that part immediately, before the search is applied. Note Parts are only picked by the mouse on the layer **rvSelection**. This layer is part of the realvirtual project settings. The colliders needed for picking are created automatically for highlighted parts, so you do not need to add colliders to your CAD data. ## Excel Metadata Setup [Section titled “Excel Metadata Setup”](#excel-metadata-setup) For a real machine you do not write the content by hand. **Excel Metadata Setup** reads a part list (*.xlsx*) and creates a Runtime Metadata component on every matching part of the imported CAD model. ### Workflow [Section titled “Workflow”](#workflow) 1. Add **Excel Metadata Setup** to an empty GameObject in the scene. 2. Select the file with the **…** button next to **Excel File Path** and enter the **Sheet Name**. If the sheet name is empty or not found, the first sheet is used. The first row of the sheet must contain the column names. 3. Assign **Base Highlight** and **Hover Highlight**. They are applied to every created part. 4. Click **Read Header**. The columns of the sheet appear in the **Columns** list. 5. Set a mode for each column: * **Key** – the part number used to find the matching part in the scene. At least one column must be a Key. Its value is shown with the label *ID*. * **Display Name** – becomes the title of the window and the name used in the search. * **Include** – shown as a labeled value, with the column name as label. * **Exclude** – ignored. 6. Click **Setup Components**. The Console reports how many components were created. Danger **Setup Components** first removes **all** existing Runtime Metadata components in the scene, including the ones you created by hand, and then creates them again from the sheet. The step can be reverted with Undo. ### How Parts Are Matched [Section titled “How Parts Are Matched”](#how-parts-are-matched) **Match By Cad Part Number** (boolean) If set to true, each part is matched by the part number stored in its imported CAD properties. This is the reliable choice, because GameObject names in CAD imports are often inconsistent. Parts without a CAD part number are matched by their GameObject name instead. **Cad Metadata Type Name** (string) The component that holds the imported CAD properties. The default is the metadata component created by a Pixyz import. **Cad Part Number Property** (string) The CAD property that contains the part number. **Cad Part Number Property Fallback** (string) A second CAD property that is used if the first one is empty. The comparison ignores upper and lower case, a CAD file extension such as *.ipt* or *.sldprt*, and an instance suffix such as *:2*. A part *ENG-033927:2* therefore matches the row *ENG-033927.ipt*. If the same part number appears in several rows, the first row is used. ## Common Use Cases [Section titled “Common Use Cases”](#common-use-cases) * **Spare part lookup** – The operator types an article number and sees where the part is installed. * **Maintenance support** – Each part shows its service data and a button that opens the data sheet or manual. * **Live diagnostics** – Signal values are shown directly at the sensor or drive they belong to. * **Browser 3D-HMI** – The same content drives tooltips and document links in realvirtual WEB. ## See Also [Section titled “See Also”](#see-also) * [Building a 3D-HMI](/doc/unity/extensions/realvirtual-web/3d-hmi/) – how realvirtual WEB uses Runtime Metadata for tooltips and documents * [Supported Components](/doc/unity/extensions/realvirtual-web/supported-components/) – all components read by realvirtual WEB * [Scene Selectables (Pro)](/doc/unity/components-and-scripts/scene-interaction/scene-selectables-pro/) – highlighting and selecting objects at runtime * [Tooltip (Pro)](/doc/unity/components-and-scripts/scene-interaction/tooltip-pro/) – simple tooltips for single objects # Scene Selection (Pro) > >- The Scene Selection system provides interactive runtime object selection with sophisticated visual feedback, allowing operators to inspect components, view live signal states, and interact with simulation elements during virtual commissioning, training, and debugging scenarios. ![Scene Selection system showing tooltip and selection window](/doc/unity/assets/SceneSelection-ModernTooltip.png) Scene Selection with modern tooltip display and interactive signal window ## Overview [Section titled “Overview”](#overview) Scene Selection transforms static 3D models into interactive elements that users can hover over, click, and inspect during runtime. The system provides multi-layer visual feedback with separate highlighting for hover effects, active states, selections, and change indicators. Each selectable object can display tooltips on hover and detailed information windows when clicked, including live signal states that can be toggled directly from the interface. Key capabilities include: * **Multi-layer highlighting system** with four independent visual states (Active, Hover, Selected, Changed) * **Interactive tooltips** that appear on hover with customizable content * **Detailed selection windows** showing properties, descriptions, and live signal states * **Signal monitoring and control** with toggle switches for real-time manipulation * **Change tracking** that highlights objects when their signal states differ from initial values * **Dynamic content system** for adding runtime values and clickable links * **Multi-renderer grouping** to treat complex models as single selectable units * **Raycast-based interaction** with automatic UI avoidance The system integrates seamlessly with realvirtual’s signal system, allowing you to monitor and control PLCInputBool, PLCOutputBool, and other signal types directly from the selection interface. This makes it invaluable for debugging automation logic, training operators on equipment functions, and creating interactive maintenance procedures. ## Setup and Configuration [Section titled “Setup and Configuration”](#setup-and-configuration) ### Adding Scene Selection to Your Scene [Section titled “Adding Scene Selection to Your Scene”](#adding-scene-selection-to-your-scene) To implement Scene Selection in your project: 1. **Add the prefab**: Drag the `SceneSelectables` prefab from `Assets/realvirtual/UIPrefabs/` into your scene hierarchy 2. **Configure the toolbar button**: The system automatically adds a toolbar button using the icon specified in the SceneSelectionManager 3. **Set up highlighting managers**: The prefab comes pre-configured with four highlighting managers that are automatically detected: * **Highlight 1**: Active state highlighting * **Highlight 2**: Hover effect highlighting * **Highlight 3**: Changed state highlighting * **Highlight 4**: Selected state highlighting ### Creating Selectable Objects [Section titled “Creating Selectable Objects”](#creating-selectable-objects) You can create selectable objects in two ways: **Method 1: Using the Add Selectable Button** 1. Select the SceneSelectables GameObject in the hierarchy 2. Click **Add Selectable** in the Inspector 3. A new SceneSelectable child object is created automatically 4. Configure the selectable’s properties in the Inspector **Method 2: Manual Creation** 1. Create an empty GameObject as a child of SceneSelectables 2. Add the SceneSelectable component 3. Configure renderers, signals, and content ## SceneSelectionManager Properties [Section titled “SceneSelectionManager Properties”](#sceneselectionmanager-properties) The SceneSelectionManager orchestrates all selection interactions and visual feedback: ### Selection Managers [Section titled “Selection Managers”](#selection-managers) **Active** (AbstractSelectionManager) controls the highlighting for objects in their default active state. This manager applies visual feedback to all selectable objects when the selection system is enabled, providing a base layer of highlighting that indicates which objects are interactive. **Hover** (AbstractSelectionManager) manages the hover effect when the mouse cursor moves over a selectable object. This provides immediate visual feedback to users, indicating which object will be selected if clicked. The hover highlighting is automatically removed when the cursor moves away. **Selected** (AbstractSelectionManager) handles persistent highlighting for objects that have been clicked and selected. This highlighting remains active until another object is selected or the selection is cleared, providing clear visual indication of the currently inspected object. **Changed** (AbstractSelectionManager) highlights objects whose signal states have changed from their initial values. This is particularly useful for debugging and training scenarios, as it immediately shows which components have been manipulated or have changed state during simulation. ### UI Configuration [Section titled “UI Configuration”](#ui-configuration) **Icon** (Sprite) defines the toolbar button icon for enabling/disabling the selection system. This icon appears in both the on and off states of the toolbar button, providing a consistent visual identifier for the selection tool. **Window** (GameObject) references the selection window prefab that displays detailed information when an object is selected. This window contains the title, description, signal toggles, and any dynamic content associated with the selected object. **Title** (TextMeshProUGUI) points to the text component that displays the selected object’s title in the selection window header. This is automatically updated when an object is selected. **Description** (GameObject) contains the panel for displaying detailed descriptions. The panel is automatically shown or hidden based on whether the selected object has a description defined. **Tooltip** (GameObject) references the tooltip prefab that appears on hover. The tooltip automatically sizes itself to fit the content and follows the mouse cursor position. ### UI Prefabs [Section titled “UI Prefabs”](#ui-prefabs) **Value Prefab** (GameObject) defines the template for displaying property values in the selection window. This prefab is instantiated for each value-type content item, showing a label and value pair. **Button Prefab** (GameObject) provides the template for creating interactive link buttons in the selection window. These buttons can open URLs, documentation, or trigger other actions when clicked. ## SceneSelectable Properties [Section titled “SceneSelectable Properties”](#sceneselectable-properties) ### Basic Information [Section titled “Basic Information”](#basic-information) **Title** (string) sets the header text displayed in the selection window. This should be a clear, concise name that identifies the component or system being selected. For example: “Conveyor Motor M1” or “Safety Door Sensor”. **Description** (string) provides detailed information about the selected object. This text appears in an expandable panel within the selection window and can include operational details, specifications, or usage instructions. The description panel automatically hides if no text is provided. **Tooltip** (string) defines the hover text that appears when the mouse cursor is over the object. Tooltips are edited through a custom text area in the Inspector and support multi-line content. Use tooltips to provide quick identification or status information without requiring a full selection. ### Visual Configuration [Section titled “Visual Configuration”](#visual-configuration) **Renderers** (List) specifies all mesh renderers that belong to this selectable unit. When any renderer in the list is hovered or selected, all renderers are highlighted together. This allows you to group multiple parts of a complex model as a single interactive element. For example, a motor assembly might include the motor body, mounting bracket, and cooling fan as separate renderers that highlight as one unit. ### Signal Integration [Section titled “Signal Integration”](#signal-integration) **Signals** (List) contains the signals to monitor and control through the selection window. Each signal appears as a toggle switch in the selection window, showing its current state and allowing direct manipulation. The system tracks the initial state of all signals and automatically applies change highlighting when values differ from their starting state. Supported signal types include: * PLCInputBool for input signals * PLCOutputBool for output signals * PLCInputFloat and PLCOutputFloat for analog signals * Custom signal implementations ### Dynamic Content [Section titled “Dynamic Content”](#dynamic-content) **Contents** (List) stores additional information items to display in the selection window. Each content item can be either a value (text display) or a link (clickable button). Content items are added programmatically using the AddStringContent and AddLinkContent methods, allowing you to populate selection windows with runtime data. ## Usage Examples [Section titled “Usage Examples”](#usage-examples) ### Basic Setup Example [Section titled “Basic Setup Example”](#basic-setup-example) Here’s how to set up a simple selectable conveyor motor: ```csharp // Configure in Inspector or via script SceneSelectable motorSelectable = conveyorMotor.AddComponent(); motorSelectable.SetTitle("Conveyor Drive Motor M1"); motorSelectable.description = "Main drive motor for conveyor section 1\n" + "Power: 5.5 kW\n" + "Speed: 0-1450 RPM"; motorSelectable.tooltip = "Motor M1 - Click for details"; // Add the motor's mesh renderers motorSelectable.renderers.Add(motorBody.GetComponent()); motorSelectable.renderers.Add(motorFan.GetComponent()); // Link motor control signals motorSelectable.signals.Add(motorRunSignal); motorSelectable.signals.Add(motorFaultSignal); motorSelectable.signals.Add(motorSpeedSignal); ``` ### Adding Dynamic Content [Section titled “Adding Dynamic Content”](#adding-dynamic-content) You can add runtime information to selectables: ```csharp public class MotorMonitor : MonoBehaviour { private SceneSelectable selectable; private float runtime = 0; void Start() { selectable = GetComponent(); // Add static information selectable.AddStringContent("Serial Number", "MTR-2024-0156"); selectable.AddStringContent("Installation Date", "2024-03-15"); // Add documentation link selectable.AddLinkContent("View Manual", "https://doc.realvirtual.io/motors/m1-series"); // Add maintenance link selectable.AddLinkContent("Maintenance Schedule", "https://maintenance.local/motor/M1"); } void Update() { runtime += Time.deltaTime; // Update runtime display selectable.ClearContent(); selectable.AddStringContent("Runtime", $"{runtime:F1} hours"); selectable.AddStringContent("Temperature", $"{GetMotorTemp():F1}°C"); } } ``` ### Tooltip Configuration [Section titled “Tooltip Configuration”](#tooltip-configuration) Tooltips are configured through the custom Inspector interface: 1. Select a SceneSelectable object 2. In the Inspector, find the **Tooltip** section at the bottom 3. Enter multi-line tooltip text in the text area 4. The tooltip automatically appears on hover during runtime Example tooltip content: ```plaintext Safety Door SD-01 Status: Closed Interlock: Active Last opened: 10:45 AM ``` ### Signal Monitoring Example [Section titled “Signal Monitoring Example”](#signal-monitoring-example) Here’s how the selection system integrates with signals for a sensor: ```csharp public class SensorSelectable : MonoBehaviour { public PLCInputBool sensorActive; public PLCInputBool sensorFault; public PLCOutputBool sensorReset; void Start() { SceneSelectable selectable = GetComponent(); // Add signals for monitoring selectable.signals.Add(sensorActive); selectable.signals.Add(sensorFault); selectable.signals.Add(sensorReset); // Set descriptive title selectable.SetTitle($"Proximity Sensor {gameObject.name}"); // Add diagnostic information selectable.AddStringContent("Type", "Inductive"); selectable.AddStringContent("Range", "8mm"); selectable.AddStringContent("Output", "PNP NO"); } } ``` ## Advanced Features [Section titled “Advanced Features”](#advanced-features) ### Multi-Layer Highlighting System [Section titled “Multi-Layer Highlighting System”](#multi-layer-highlighting-system) The four-layer highlighting system provides sophisticated visual feedback: 1. **Base Layer (Active)**: Shows all interactive objects when the selection system is enabled 2. **Hover Layer**: Provides immediate feedback as the cursor moves 3. **Selection Layer**: Persists to show the currently inspected object 4. **Change Layer**: Overlays objects that have been modified These layers work together to create an intuitive interaction experience. For example, a motor might show: * Active highlighting (blue outline) indicating it’s selectable * Hover highlighting (yellow glow) when the mouse is over it * Selection highlighting (green outline) when clicked * Change highlighting (red pulse) if its signals have been toggled ### Change Tracking [Section titled “Change Tracking”](#change-tracking) The system automatically tracks signal changes: ```csharp // Initial state is captured automatically on Start() // When signals change, the Changed highlight manager activates // This happens automatically - no code required // To reset change tracking programmatically: void ResetChangeTracking() { SceneSelectionManager manager = FindObjectOfType(); manager.RefreshActives(); // Re-evaluates all change states } ``` ### Custom Selection Behavior [Section titled “Custom Selection Behavior”](#custom-selection-behavior) You can extend selection behavior by responding to selection events: ```csharp public class CustomSelectable : MonoBehaviour { private SceneSelectable selectable; void Start() { selectable = GetComponent(); } void Update() { // Check if this object is currently selected SceneSelectionManager manager = GetComponentInParent(); if (manager.selectedSelectable == selectable) { // Perform actions while selected UpdateRealtimeData(); } } void UpdateRealtimeData() { // Update dynamic content while selected selectable.ClearContent(); selectable.AddStringContent("Speed", $"{GetCurrentSpeed():F1} m/s"); selectable.AddStringContent("Position", $"{transform.position}"); } } ``` ### Programmatic Selection Control [Section titled “Programmatic Selection Control”](#programmatic-selection-control) You can control the selection system through code: ```csharp public class SelectionController : MonoBehaviour { private SceneSelectionManager selectionManager; void Start() { selectionManager = FindObjectOfType(); } public void EnableSelection() { selectionManager.Activate(); } public void DisableSelection() { selectionManager.Deactivate(); } public void ClearSelection() { selectionManager.CloseWindow(); } public void RefreshHighlighting() { selectionManager.RefreshActives(); } } ``` ## API Reference [Section titled “API Reference”](#api-reference) ### SceneSelectionManager Methods [Section titled “SceneSelectionManager Methods”](#sceneselectionmanager-methods) **Activate()** enables all child SceneSelectable components and applies initial highlighting. Call this to turn on the selection system programmatically. **Deactivate()** disables all child SceneSelectable components, removes highlighting, and closes any open windows. Use this to turn off the selection system. **RefreshActives()** re-evaluates the active/changed state of all selectables based on current signal values. This updates the highlighting to reflect any changes since initialization. **CloseWindow()** closes the current selection window and clears the selection highlighting. The selected object reference is also cleared. **AddSelectable()** creates a new SceneSelectable child GameObject. This Editor method provides a quick way to add selectables through the Inspector. ### SceneSelectable Methods [Section titled “SceneSelectable Methods”](#sceneselectable-methods) **SetTitle(string title)** sets the display title for the selection window header. **AddStringContent(string name, string value)** adds a text value display to the selection window. The name appears as a label, and the value is shown alongside it. **AddLinkContent(string name, string url)** adds a clickable button that opens the specified URL. Use this for documentation links, external resources, or web-based tools. **ClearContent()** removes all dynamically added content items. Signal displays are not affected. **Activate()** enables this selectable object, creating the necessary SelectablePart components and applying initial highlighting. **Deactivate()** disables this selectable object, removing SelectablePart components and clearing all highlighting. **Hover()** applies hover highlighting to all associated renderers and shows the tooltip if configured. **UnHover()** removes hover highlighting and hides the tooltip. **Click()** handles selection, toggling the selection state and opening or closing the information window. **HasTooltip()** returns true if a tooltip is configured for this selectable. **RefreshActive(SceneSelectionManager manager)** updates the visual state based on current signal values compared to initial state. ### SceneSelectableContent Structure [Section titled “SceneSelectableContent Structure”](#sceneselectablecontent-structure) The SceneSelectableContent class defines additional information items: ```csharp public class SceneSelectableContent { public enum Type { Value, // Text display Link // Clickable URL button } public Type type; // Content type public string name; // Display label public string value; // Text or URL } ``` ## Performance Considerations [Section titled “Performance Considerations”](#performance-considerations) ### Raycast Optimization [Section titled “Raycast Optimization”](#raycast-optimization) The system uses Physics.RaycastAll for accurate multi-layer detection. To optimize performance: * Place selectable objects on specific layers * Use layer masks in physics settings to exclude unnecessary objects * Limit the number of active selectables in dense scenes ### Highlighting Performance [Section titled “Highlighting Performance”](#highlighting-performance) Each highlighting manager can impact rendering performance: * Use simple outline shaders for better performance * Limit the number of simultaneous highlight effects * Consider LOD settings for complex models * Disable highlighting for objects outside the camera view ### Signal Updates [Section titled “Signal Updates”](#signal-updates) Signal monitoring happens continuously during runtime: * Limit the number of signals per selectable (recommend < 10) * Use efficient signal implementations * Consider update frequencies for real-time data * Cache signal references to avoid lookups ## Unity 6 Compatibility [Section titled “Unity 6 Compatibility”](#unity-6-compatibility) When upgrading projects to Unity 6, the Render Graph compatibility mode must be disabled for highlighting to work correctly: 1. Open **Edit > Project Settings** 2. Navigate to **Graphics** 3. Find **Render Graph Settings** 4. Disable **Compatibility Mode** 5. Restart Unity Editor ![Unity 6 Render Graph settings](/doc/unity/assets/Screenshot%202025-02-03%20115043.png) Disable Compatibility Mode in Graphics settings for proper highlighting This setting ensures that the highlighting shaders work correctly with Unity 6’s rendering pipeline. ## CMCViewR Compatibility [Section titled “CMCViewR Compatibility”](#cmcviewr-compatibility) When deploying realvirtual projects to CMCViewR, Scene Selectables have the following restrictions: ### Scene Selectables Not Supported [Section titled “Scene Selectables Not Supported”](#scene-selectables-not-supported) Scene Selectables are **not compatible** with CMCViewR and will not function in exported CMCViewR scenes. The interactive selection system, highlighting, tooltips, and selection windows are editor/runtime Unity features that do not translate to the CMCViewR environment. If you need interactive object selection in CMCViewR, you will need to implement alternative interaction methods compatible with the CMCViewR runtime. ### Custom Script Requirements [Section titled “Custom Script Requirements”](#custom-script-requirements) When using custom scripts in projects that will be exported to CMCViewR, all custom code must be placed in its own custom assembly definition. This is a CMCViewR requirement for proper script compilation and deployment. To create a custom assembly definition for your scripts: 1. Create a new folder for your custom scripts (e.g., `Assets/CustomScripts/`) 2. Right-click in the folder and select **Create > Assembly Definition** 3. Name the assembly (e.g., `MyProject.Custom`) 4. In the Assembly Definition Inspector: * Add references to `realvirtual` and any other required assemblies * Configure platform compatibility as needed 5. Place all your custom scripts within this folder Example assembly definition setup: ```json { "name": "MyProject.Custom", "references": [ "realvirtual.base", "Unity.TextMeshPro" ], "includePlatforms": [], "excludePlatforms": [] } ``` ### Camera Handling [Section titled “Camera Handling”](#camera-handling) When exporting to CMCViewR, you do not need to manually prepare or deactivate realvirtual cameras. The realvirtual camera system will be **automatically deactivated** when the scene runs in CMCViewR, as CMCViewR uses its own camera management system. ## Integration with Other Components [Section titled “Integration with Other Components”](#integration-with-other-components) Scene Selection integrates seamlessly with other realvirtual components: ### Drive Integration [Section titled “Drive Integration”](#drive-integration) Selectable drives can display current position, speed, and control signals: ```csharp selectable.signals.Add(drive.JogForward); selectable.signals.Add(drive.JogBackward); selectable.AddStringContent("Position", $"{drive.CurrentPosition:F2} mm"); ``` ### Sensor Integration [Section titled “Sensor Integration”](#sensor-integration) Sensors can show detection states and configuration: ```csharp selectable.signals.Add(sensor.Occupied); selectable.AddStringContent("Detection Range", $"{sensor.Range} mm"); ``` ### Transport System Integration [Section titled “Transport System Integration”](#transport-system-integration) Conveyors and transport systems benefit from selection for debugging: ```csharp selectable.signals.Add(conveyor.Running); selectable.signals.Add(conveyor.EmergencyStop); selectable.AddStringContent("Speed", $"{conveyor.Speed:F1} m/s"); ``` ## Troubleshooting [Section titled “Troubleshooting”](#troubleshooting) ### Highlighting Not Visible [Section titled “Highlighting Not Visible”](#highlighting-not-visible) * Verify Render Graph Compatibility Mode is disabled (Unity 6) * Check that highlighting managers are assigned in SceneSelectionManager * Ensure renderers have materials that support highlighting shaders * Verify the Highlighter prefab exists in the scene hierarchy ### Tooltips Not Appearing [Section titled “Tooltips Not Appearing”](#tooltips-not-appearing) * Check that tooltip text is configured in the Inspector * Verify the Tooltip GameObject is assigned in SceneSelectionManager * Ensure EventSystem exists in the scene for UI interaction * Check that Canvas render mode supports world space tooltips ### Signals Not Updating [Section titled “Signals Not Updating”](#signals-not-updating) * Verify signals are properly initialized before adding to selectable * Check that signal GameObjects are active in the hierarchy * Ensure PLCInterface or signal source is running * Verify signal references are not null ### Selection Window Issues [Section titled “Selection Window Issues”](#selection-window-issues) * Check Window GameObject is assigned in SceneSelectionManager * Verify UI Canvas and EventSystem are present * Ensure window prefab has required components (RectTransform, CanvasGroup) * Check that text components use TextMeshPro ## Best Practices [Section titled “Best Practices”](#best-practices) 1. **Group Related Renderers**: Combine parts of the same component into a single selectable for cleaner interaction 2. **Use Descriptive Titles**: Make titles clear and include identifying information (e.g., “Motor M1” not just “Motor”) 3. **Provide Helpful Tooltips**: Include status information in tooltips for quick inspection without selection 4. **Limit Signal Count**: Keep signal lists focused on the most relevant controls (5-10 signals maximum) 5. **Add Context Links**: Include links to documentation, datasheets, or maintenance procedures 6. **Update Dynamic Content Sparingly**: Only update runtime values when selected to reduce overhead 7. **Use Consistent Highlighting**: Maintain consistent colors across your application for each highlighting state 8. **Test Performance**: Profile selection interactions in complex scenes and optimize as needed ## See Also [Section titled “See Also”](#see-also) * [Signals](/doc/unity/components-and-scripts/signals/signals/) - Signal system for PLC communication * [UI System](/doc/unity/components-and-scripts/ui/ui-system/) - User interface components and controls * [Highlighting System](/doc/unity/components-and-scripts/visual/highlighting/) - Visual feedback and highlighting * [Drive](/doc/unity/components-and-scripts/motion/drive/) - Drive components that integrate with selection * [Sensor](/doc/unity/components-and-scripts/sensors/sensor/) - Sensor components for detection and monitoring # Screen Overlay Buttons > Hiding Groups or setting Camera Positions This documentation explains how to set up and use the overlay buttons whithin a scene. All elements are in the UIPrefabs folder. ## Overview [Section titled “Overview”](#overview) * **OverlayButtons Prefab**: A pre-designed canvas that serves as the central UI element for your set up * **Button Prefabs**: Predefined button styles designed for different functionalities and use cases, such as camera position, group connection and signal trigger. ## Setup [Section titled “Setup”](#setup) ### Adding the user canvas [Section titled “Adding the user canvas”](#adding-the-user-canvas) 1. Drag and drop the OverlayButtons-Prefab in the hierarchy. There are no further parameter needed. 2. the button placement area, named “Buttons,” is positioned by default along the right margin. ### Button prefabs [Section titled “Button prefabs”](#button-prefabs) All button prefabs include the `rvUIToolbarButton` component, where you can configure the following parameters: * **Item Tooltip**: Defines the button’s tooltip text. * **Tooltip Position**: Sets the tooltip’s display position relative to the button. ![](/doc/unity/assets/RVUIToolbarButtonOverlay.png) rvUIToolbarButton Each button GameObject contains two child images where you can assign custom sprites ![](/doc/unity/assets/rcuitoolbarButtonImages.png) Set button images #### Button Camera position [Section titled “Button Camera position”](#button-camera-position) #### Within the component “StartCameraPosition” you can assign a Camera Pos. [Section titled “Within the component “StartCameraPosition” you can assign a Camera Pos. ”](#within-the-component-startcameraposition-you-can-assign-a-camera-pos) ![](/doc/unity/assets/StartCameraPosition.png) A camera position is created in the following way: * “Right Click” in your project and select “Create/realvirtual/Add Camera Position”. This creates a scriptable object where you define the position of the camera. * Assign the created camera position to the “StartCameraPosition” component. [](/doc/unity/assets/CreateCameraPosition.mp4) #### Button Show Group [Section titled “Button Show Group”](#button-show-group) The `ButtonShowGroup` component provides a list of groups available to the user in Playmode. Select a group to control its visibility with the button. ![](/doc/unity/assets/overlayButtonShowGroup.png) To define these groups for Playmode, use the [`GroupManager`](/doc/unity/basics/runtime-ui/group-manager/) in the RealVirtual prefab. Ensure the `GroupManager` used is also assigned in the `ButtonShowGroup` component. # StatDisplay (Pro) The StatDisplay system provides comprehensive real-time performance monitoring and production statistics for realvirtual simulations, enabling detailed analysis of automation system performance. Caution **Professional Version Only**: StatDisplay is exclusively available in realvirtual Professional. It is not included in the Starter version. ## Requirements [Section titled “Requirements”](#requirements) **TextMeshPro Required**: StatDisplay requires Unity’s TextMeshPro for text rendering. TextMeshPro is included with Unity and accessible through the Window menu. ### Setting up TextMeshPro [Section titled “Setting up TextMeshPro”](#setting-up-textmeshpro) TextMeshPro is already included with Unity. To access TextMeshPro resources: 1. **Access TextMeshPro Menu**: Window → TextMeshPro 2. **Import Essential Resources**: Select “Import TMP Essential Resources” if prompted 3. **Import Examples (Optional)**: Select “Import TMP Examples and Extras” for additional resources ![](/doc/unity/assets/textmeshpro-installation.png) Accessing TextMeshPro resources through Unity's Window menu Note **Note**: TextMeshPro comes pre-installed with Unity. You only need to import the essential resources when first using TextMeshPro components in your project. ## Overview [Section titled “Overview”](#overview) StatDisplay consists of multiple specialized components that work together to provide complete visibility into simulation performance and production metrics. The system tracks output rates, cycle times, state utilization, and operational efficiency to help optimize automation systems during virtual commissioning. Key benefits include: * Real-time production monitoring during simulation * Cycle time analysis for performance optimization * State utilization tracking for efficiency analysis * Automated statistics collection with minimal setup * Integration with realvirtual’s LogicStep system > **💡 Hint** StatDisplay components work best when integrated early in the simulation development process, allowing for continuous monitoring during system development and optimization. ![](/doc/unity/assets/statdisplay-inspector.png) StatDisplay system with StatDisplayOutput component in Unity Inspector ## Component Architecture [Section titled “Component Architecture”](#component-architecture) The StatDisplay system consists of five specialized components that work together: ```plaintext StatController (Central coordinator) ├── StatDisplayOutput (Visual display) ├── StatCycleTime (Timing analysis) ├── StatStates (Utilization tracking) └── StatOutput (Production counting) ``` ### Component Roles [Section titled “Component Roles”](#component-roles) **StatController**: Central coordinator for statistics management and reset timing **StatDisplayOutput**: Renders real-time statistics to on-screen display using TextMeshPro **StatCycleTime**: Tracks production cycle timing with min/max/average analysis **StatStates**: Monitors operational states and calculates utilization percentages **StatOutput**: Counts production output and calculates rates (parts per hour/day) ## Runtime Display [Section titled “Runtime Display”](#runtime-display) The system provides comprehensive runtime visualization of all statistical data: ![](/doc/unity/assets/statdisplay-runtime.png) Complete StatDisplay system runtime view showing output stats, cycle times, and state utilization ## Quick Start [Section titled “Quick Start”](#quick-start) ### Basic Setup (5 minutes) [Section titled “Basic Setup (5 minutes)”](#basic-setup-5-minutes) 1. **Create Statistics GameObject**: * Right-click in Hierarchy → Create Empty * Name it “ProductionStats” 2. **Add Core Components**: * Add **StatController** component * Add **StatOutput** component for production counting * Add **StatDisplayOutput** component for visual display 3. **Configure Display**: * Create UI Canvas if not present * Assign TextMeshPro components to StatDisplayOutput * Set reset interval in StatController (default: 60 seconds) 4. **Connect to Production**: * Use LogicStep components or direct API calls to trigger statistics * Call `StatOutput.IncrementCount()` when parts are produced ## StatDisplayOutput Component [Section titled “StatDisplayOutput Component”](#statdisplayoutput-component) ### Properties [Section titled “Properties”](#properties) #### Display Configuration [Section titled “Display Configuration”](#display-configuration) **Stat Displays** (Array) Collection of display elements for showing different statistics. * **Type**: StatDisplayElement array * **Default**: Empty array * **Use case**: Define which statistics to show and their formatting #### Text Mesh Pro Settings [Section titled “Text Mesh Pro Settings”](#text-mesh-pro-settings) **Background** Visual background component for the statistics display. * **Type**: UI Image component reference * **Default**: None * **Use case**: Provide visual background for better text readability **Padding** Display padding settings for text layout. * **Type**: Vector2 (X and Y values) * **Default**: (10, 10) * **Range**: 0 to 100 pixels * **Use case**: Adjust text spacing within the display background ### Runtime Display Features [Section titled “Runtime Display Features”](#runtime-display-features) The on-screen display shows: * **Output Rate**: Current parts per hour (e.g., “308”, “334”) * **Total Count**: Cumulative production count * **Real-time Updates**: Live statistics that update during simulation ## StatController Component [Section titled “StatController Component”](#statcontroller-component) ### Properties [Section titled “Properties”](#properties-1) #### Core Settings [Section titled “Core Settings”](#core-settings) **Reset Statistics** Time interval for automatic statistics reset across all components. * **Type**: Float * **Default**: 60 seconds * **Range**: 1 to 3600 seconds (1 second to 1 hour) * **Use case**: Define how often statistics are cleared for fresh measurements #### Component Management [Section titled “Component Management”](#component-management) **Stat Components** Automatically detected statistical components in the scene. * **Type**: Component array (read-only) * **Default**: Auto-populated * **Use case**: Shows which components are managed by this controller ### Functionality [Section titled “Functionality”](#functionality) The StatController coordinates all statistical components by: * Synchronizing reset timing across all statistics * Providing centralized management interface * Automatically detecting compatible components in the scene ## StatCycleTime Component [Section titled “StatCycleTime Component”](#statcycletime-component) ### Properties [Section titled “Properties”](#properties-2) #### Cycle Tracking [Section titled “Cycle Tracking”](#cycle-tracking) **Auto Start Detection** Automatically detect cycle start events from connected components. * **Type**: Boolean * **Default**: true * **Use case**: Enable for automatic cycle detection, disable for manual control **Cycle Timeout** Maximum time before considering a cycle incomplete. * **Type**: Float * **Default**: 300 seconds (5 minutes) * **Range**: 10 to 3600 seconds * **Use case**: Prevent incomplete cycles from affecting statistics ### Runtime Statistics [Section titled “Runtime Statistics”](#runtime-statistics) The component tracks and displays: * **Min Cycle Time**: Shortest recorded cycle (seconds) * **Max Cycle Time**: Longest recorded cycle (seconds) * **Average Cycle Time**: Mean cycle time over monitoring period * **Current Cycle Time**: Most recent completed cycle * **Cycle Count**: Total completed cycles since last reset > **💡 Hint** Use `StartCycle()` and `EndCycle()` methods in your LogicStep components to precisely control timing measurement. ## StatStates Component [Section titled “StatStates Component”](#statstates-component) ### Properties [Section titled “Properties”](#properties-3) #### State Configuration [Section titled “State Configuration”](#state-configuration) **Default States** Predefined operational states for tracking. * **Type**: String array * **Default**: \[“Moving”, “Waiting”, “MoveBack”, “Error”] * **Use case**: Customize states to match your automation system **Show Utilization** Display overall utilization percentage in runtime statistics. * **Type**: Boolean * **Default**: true * **Use case**: Toggle overall utilization display ### Runtime Analysis [Section titled “Runtime Analysis”](#runtime-analysis) The component provides detailed operational analysis: **Overall Utilization**: System efficiency percentage based on productive vs idle time **State Breakdown**: Time and percentage spent in each operational state: * **Moving**: Active production operations * **Waiting**: Idle time between operations * **MoveBack**: Return or positioning movements * **Error**: Error or maintenance states > **💡 Hint** Call `State("StateName")` method to track state changes. States are case-sensitive and must match configured state names. ## StatOutput Component [Section titled “StatOutput Component”](#statoutput-component) ### Properties [Section titled “Properties”](#properties-4) #### Production Settings [Section titled “Production Settings”](#production-settings) **Hours Per Day** Operating hours for daily production rate calculations. * **Type**: Float * **Default**: 24 hours * **Range**: 1 to 24 hours * **Use case**: Set actual operating schedule (e.g., 8 hours for single shift) **Parts Description** Custom label for the type of items being counted. * **Type**: String * **Default**: “Parts” * **Use case**: Specify product type (“Bottles”, “Assemblies”, “Packages”) #### Display Options [Section titled “Display Options”](#display-options) **Show Parts Per Day** Include daily production projection in the display. * **Type**: Boolean * **Default**: true * **Use case**: Toggle daily rate calculations for short-term analysis ### Runtime Statistics [Section titled “Runtime Statistics”](#runtime-statistics-1) Displays real-time production metrics: * **Total Count**: Cumulative items produced since last reset * **Parts Per Hour**: Current production rate based on recent activity * **Parts Per Day**: Projected daily output based on current rate and operating hours > **💡 Hint** Use `IncrementCount()` or `IncrementCount(int amount)` to track production. The system automatically calculates rates based on timing. ## Editor Tools [Section titled “Editor Tools”](#editor-tools) ### Inspector Features [Section titled “Inspector Features”](#inspector-features) **Component Auto-Detection**: StatController automatically finds and manages compatible statistical components in the scene. **Real-time Preview**: Statistics display updates in real-time during Play mode for immediate feedback. **Reset Button**: Manual reset button in StatController inspector for clearing statistics during testing. ### Gizmos and Visual Aids [Section titled “Gizmos and Visual Aids”](#gizmos-and-visual-aids) **State Visualization**: StatStates component shows current state in Scene view when selected. **Connection Indicators**: Visual lines show relationships between StatController and managed components. ## Advanced Configuration [Section titled “Advanced Configuration”](#advanced-configuration) ### Multi-Station Setup [Section titled “Multi-Station Setup”](#multi-station-setup) 1. **Separate Controllers**: Use individual StatController components for each production station 2. **Component Grouping**: Group related statistical components under station-specific GameObjects 3. **Display Coordination**: Configure multiple StatDisplayOutput components for different viewing areas 4. **Synchronized Reset**: Use global reset timing or independent station resets based on requirements ## Usage Examples [Section titled “Usage Examples”](#usage-examples) ### Basic Production Monitoring [Section titled “Basic Production Monitoring”](#basic-production-monitoring) #### Simple Output Counting [Section titled “Simple Output Counting”](#simple-output-counting) ```csharp // In your production logic public class ProductionStation : MonoBehaviour { public StatOutput outputCounter; public void OnPartCompleted() { outputCounter.IncrementCount(); Debug.Log($"Total parts: {outputCounter.TotalCount}"); } } ``` #### Cycle Time Measurement [Section titled “Cycle Time Measurement”](#cycle-time-measurement) ```csharp // Track complete production cycles public class CycleController : MonoBehaviour { public StatCycleTime cycleTimer; public StatStates stateTracker; public void StartProduction() { cycleTimer.StartCycle(); stateTracker.State("Moving"); } public void CompleteProduction() { cycleTimer.EndCycle(); stateTracker.State("Waiting"); } } ``` ### Integration with LogicStep System [Section titled “Integration with LogicStep System”](#integration-with-logicstep-system) StatDisplay components integrate seamlessly with realvirtual’s LogicStep system: #### Starting Cycle Time Tracking [Section titled “Starting Cycle Time Tracking”](#starting-cycle-time-tracking) ```csharp public class LogicStep_StatStartCycle : LogicStep { public StatCycleTime StatCycleTimeComponent; #pragma warning disable 0414 // Suppress "field assigned but never used" warning private bool signalnotnull = false; #pragma warning restore 0414 protected new bool NonBlocking() { return true; } protected override void OnStarted() { State = 50; if (StatCycleTimeComponent != null) StatCycleTimeComponent.StartCycle(); NextStep(); } protected new void Start() { base.Start(); } } ``` #### Setting State for Utilization Tracking [Section titled “Setting State for Utilization Tracking”](#setting-state-for-utilization-tracking) ```csharp public class LogicStep_StatSetState : LogicStep { public StatStates StatStatesComponent; public string SetState = "Moving"; protected override void OnStarted() { if (StatStatesComponent != null) { StatStatesComponent.State(SetState); } NextStep(); } protected new void Start() { base.Start(); } } ``` #### Advanced LogicStep Integration [Section titled “Advanced LogicStep Integration”](#advanced-logicstep-integration) ```csharp // Complete production workflow with comprehensive statistics public class ProductionSequence : LogicStep { [Header("Statistics Components")] public StatCycleTime cycleTimer; public StatStates stateTracker; public StatOutput outputCounter; protected override void OnStarted() { // Initialize production cycle cycleTimer?.StartCycle(); stateTracker?.State("Moving"); // Execute production steps ExecuteProductionSequence(); } private void ExecuteProductionSequence() { // Production logic here // Complete cycle OnProductionComplete(); } private void OnProductionComplete() { cycleTimer?.EndCycle(); outputCounter?.IncrementCount(); stateTracker?.State("Waiting"); NextStep(); } } ``` #### Custom Statistics Manager [Section titled “Custom Statistics Manager”](#custom-statistics-manager) ```csharp // Centralized statistics management public class ProductionStatsManager : MonoBehaviour { [Header("Statistics References")] public StatController controller; public StatCycleTime[] stationTimers; public StatOutput[] stationOutputs; public void ResetAllStatistics() { controller.ResetStatistics(); } public void GetProductionSummary() { float totalOutput = 0; foreach (var output in stationOutputs) { totalOutput += output.TotalCount; } Debug.Log($"Total Production: {totalOutput} parts"); } } ``` ### Display Customization [Section titled “Display Customization”](#display-customization) #### Custom Display Layout [Section titled “Custom Display Layout”](#custom-display-layout) ```csharp // Programmatic display configuration public class CustomStatDisplay : MonoBehaviour { public StatDisplayOutput display; void Start() { ConfigureDisplay(); } void ConfigureDisplay() { // Customize display appearance display.Background.color = Color.black; display.Padding = new Vector2(15, 15); // Add custom formatting display.ShowDecimalPlaces = 1; } } ``` ## Troubleshooting [Section titled “Troubleshooting”](#troubleshooting) ### Statistics Not Updating [Section titled “Statistics Not Updating”](#statistics-not-updating) **Symptoms**: Display shows static values, zeros, or outdated information **Common Causes & Solutions**: **Missing Component References** * Check that all StatDisplay components have their script references properly assigned * Verify StatController can find and manage statistical components in the scene * Ensure GameObjects containing statistics components are active **Timing Configuration Issues** * Verify StatController reset interval matches your analysis needs * Check if automatic reset is clearing data too frequently * Ensure production events are actually triggering statistical updates **Integration Problems** * Confirm LogicStep components are calling statistical methods correctly * Verify API calls like `IncrementCount()` and `StartCycle()` are executed * Check Unity Console for any statistical component error messages ### Inaccurate Cycle Times [Section titled “Inaccurate Cycle Times”](#inaccurate-cycle-times) **Symptoms**: Cycle time measurements don’t reflect actual production timing **Diagnosis Steps**: 1. **Verify Cycle Boundaries**: ```csharp // Ensure StartCycle() and EndCycle() are called at correct times Debug.Log($"Starting cycle at: {Time.time}"); cycleTimer.StartCycle(); // ... production logic ... Debug.Log($"Ending cycle at: {Time.time}"); cycleTimer.EndCycle(); ``` 2. **Check for Timing Conflicts**: * Multiple components calling cycle methods simultaneously * Reset operations interrupting active cycle measurements * LogicStep timing conflicts with manual cycle control 3. **Review Reset Settings**: * StatController reset interval too short for complete cycle measurement * Manual resets during active production cycles ### Display Formatting Issues [Section titled “Display Formatting Issues”](#display-formatting-issues) **Symptoms**: Statistics appear incorrectly formatted, positioned, or illegible **Visual Display Problems**: * **Text Overlap**: Increase padding values in StatDisplayOutput * **Background Issues**: Verify UI Image component is assigned and properly configured * **Layout Problems**: Check Canvas scaling and StatDisplayOutput positioning * **Missing Statistics**: Ensure StatDisplayOutput array includes all desired display elements **UI Integration Issues**: * **Canvas Setup**: Verify UI Canvas is configured correctly for your display method * **TextMeshPro Configuration**: Check font, size, and color settings * **Z-Ordering**: Ensure statistics display appears above other UI elements ### Performance Issues [Section titled “Performance Issues”](#performance-issues) **Symptoms**: Frame rate drops or stuttering when statistics are active **Optimization Solutions**: **Reduce Update Frequency**: * Increase StatController reset interval for less frequent calculations * Use fewer concurrent statistical components in large scenes * Consider separate StatControllers for different production areas **Display Optimization**: * Limit number of decimal places shown in display * Use object pooling for dynamic statistical displays * Disable statistics visualization when not needed ### Integration Debugging [Section titled “Integration Debugging”](#integration-debugging) **Symptoms**: Statistics work in isolation but fail in complete simulation **System Integration Checks**: 1. **Component Dependencies**: ```csharp // Verify all required components are present if (cycleTimer == null) Debug.LogError("Missing StatCycleTime component"); if (stateTracker == null) Debug.LogError("Missing StatStates component"); ``` 2. **Event Timing**: * Ensure statistical events occur in correct sequence * Check for race conditions in complex automation sequences * Verify LogicStep execution order doesn’t conflict with statistics 3. **Multi-Scene Issues**: * StatDisplay components may not persist across scene loads * Statistics references may break when reloading scenes * Consider using `DontDestroyOnLoad()` for persistent statistics Caution **Performance Tip**: In large simulations with many statistical components, consider using separate StatControllers for different production areas to optimize performance and organize statistics logically. ## See Also [Section titled “See Also”](#see-also) * [LogicStep](/doc/unity/components-and-scripts/behavior-graph/logicstep/) - Core system for statistical event integration * [Runtime Debugger](/doc/unity/components-and-scripts/runtime-debugger/) - Additional debugging and monitoring tools * [MU, Source and Sink](/doc/unity/components-and-scripts/mu-movable-unit/) - Production components that generate statistics * [Performance Tools](/doc/unity/components-and-scripts/performance-tools/) - Framework performance optimization components *** © 2025 realvirtual GmbH [https://realvirtual.io](https://realvirtual.io/) - All rights reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or by any means, including printing, saving, photocopying, recording, or other electronic or mechanical methods, without the prior written permission of the publisher. # Tooltip (Pro) > Disppaying tooltips in the scene. Caution This feature is only available in realvirtual.io Professional The **RuntimeTooltip** system allows you to display contextual tooltips in your simulation, helping users understand the function or content of scene objects at runtime. ![](/doc/unity/assets/tooltip.png) Runtime tooltip #### Features [Section titled “Features”](#features) * Works with any 3D object in the scene * Fully supports **TextMeshPro rich text** (bold, color, line breaks) * Dynamically displayed on hover or selection * Easy to integrate via prefab ## Required Components [Section titled “Required Components”](#required-components) **1. Tooltip Controller (Scene-Level)** You must add the Tooltip Controller to your scene. This controller handles the positioning and display of all tooltips. > 📦 **Prefab**:\ > `Assets/realvirtual/Professional/SceneSelection/TooltipController.prefab` Drag and drop this prefab into your scene to enable the tooltip system. **2. RuntimeTooltip Script (Object-Level)** Attach the `RuntimeTooltip` script to any GameObject you want to annotate with a tooltip. **Steps:** 1. Select the target GameObject (e.g., a cabinet). 2. Add the component: `Runtime Tooltip (Script)` 3. Enter your tooltip text in the **Text** field using TextMeshPro for formatting if needed. **Example:** ```html Cabinet\nContains control electronics and power supply ``` # UI components Caution UI components is still part of our release but you should consider using the new [HMI components](/doc/unity/components-and-scripts/scene-interaction/hmi-components-pro/) (only available in Professional), [Screen Overlay Buttons](/doc/unity/components-and-scripts/scene-interaction/screen-overlay-buttons/) or [3DButtons](/doc/unity/components-and-scripts/scene-interaction/3d-buttons/) UI Components can be used to display PLC Signals on the screen or to control PLC Signals during simulation. Currently the UI Components contain these components: | Component | Description | | ------------ | -------------------------------------------------------- | | UIPanel | Empty sliding panel as a container for the UI components | | UIButton | A push or toggle button | | UILamp | Lamp with different colors | | UIMessageBox | Model window for displaying messages. | The components can be arranged in a Panel (or multiple Panels) that can slide over the main view: ![](/doc/unity/assets/uicomponents.png) All UI Components should be arranged under the UI Gameobject in the Hierarchy: ![](/doc/unity/assets/rvUIcomp.png) ### UIPanel[](#uipanel) [Section titled “UIPanel ”](#uipanel) The UIPanel is an element used as a container for Buttons and Lamps. It is opened when it is selected in the bottom of the screen with a sliding animation. It can be closed by selecting the panel name or closing icon. You can place multiple panes on the screen but the naming of the second panel and the position of the animations must be changed manually. ![](/doc/unity/assets/uicomponents.png) ### UIButton[](#uibutton) [Section titled “UIButton ”](#uibutton) The Button can be placed in a UI Panel. The Button can act as a switch (changes between on and off everytime you press it) or can act as a pushbutton (only stays at on if you press it). You can select the color and the text which is displayed under the button. The connection to PLC Inputs is made by dragging the PLC Input onto the Field *Button On* or by selecting under *Button On* the desired input. ![](/doc/unity/assets/uicomponents-pushbutton.png) ### UILamp[](#uilamp) [Section titled “UILamp ”](#uilamp) The lamp is used for displaying values. It can be connected to a PLC Output. ![](/doc/unity/assets/uicomponents-lamp.png) ### UIMessageBox[](#uimessagebox) [Section titled “UIMessageBox ”](#uimessagebox) The UIMessageBox is a modal message box that is opening as an overlay over all windows in the scene. It can be turned on by a PLC Output signal. ![](/doc/unity/assets/uicomponents-messagebox.png) The message box can be closed automatically after a defined time in seconds if *Auto Close After Seconds* is a value greater zero. The message box can be connected to a Cinemachine Virtual Camera for automatically zooming to the position of the message. Also some objects in the scene, that are highlighted during the message, can be selected. ![](/doc/unity/assets/uicomponents-messageboxinspector.png) Please check the [Realvirtual.io Class Reference](https://game4automation.com/documentation/current/apidoc/html/classgame4automation_1_1_u_i_message.html) for more information about the properties and methods of this component.\ \ \ \ \ \ © 2025 realvirtual GmbH [https://realvirtual.io](https://realvirtual.io/) - All rights reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or by any means, including printing, saving, photocopying, recording, or other electronic or mechanical methods, without the prior written permission of the publisher. # Sensors Components for detecting objects, measuring positions, and providing feedback in automation systems. ## Available Components [Section titled “Available Components”](#available-components) * **[Sensor](/doc/unity/components-and-scripts/sensors/sensor/)** - Primary proximity sensor for detecting MUs and objects with configurable detection zones * **[Measure](/doc/unity/components-and-scripts/sensors/measure/)** - Position and distance measurement sensor for precise object positioning * **[MeasureRaycast](/doc/unity/components-and-scripts/sensors/measureraycast/)** - Raycast-based distance measurement for precise range detection ## Key Features [Section titled “Key Features”](#key-features) * **PLC Integration**: Direct connection with PLCOutputBool and PLCOutputFloat signals * **Visual Feedback**: Editor gizmos and runtime visualization of detection zones * **Configurable Detection**: Adjustable zones, timing delays, and object filtering * **Logic Integration**: Works with Logic Steps and Behavior Graph systems ## See Also [Section titled “See Also”](#see-also) * [Logic Steps](/doc/unity/components-and-scripts/defining-logic/logicsteps/) - Automation sequences using sensor inputs * [Interfaces](/doc/unity/components-and-scripts/interfaces/) - PLC communication for sensor data # Measure Measure is measuring distances between the pivot point of the Gameobject, the Measure script is attached to and another pivot point of a referenced Gameobject. You can also connect the result of the measurement to a PLCInput Signal. By doing this Measure is able to act as a distance sensor. ![](/doc/unity/assets/measure.png) You can apply the following properties: | Property | Description | | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ | | Measure From | Gameobject the measurement should be performed from to this object. | | Distance | (Readonly) The measured distance as a vector. | | Distance Abs | (Readonly) The measured distance as an absolute value. | | Set Distance | A distance that should be set by the button Set Distance | | Keep Set Distance | If set to true the SetDistance value is always set to the related Gameobject so that the distance between the two objects always keeps the same. | | Display On Selected | Display the measurement only when the measurement object is selected. | | Display Always | Display the measurement always. | | Display Line | Display a line between the Pivot Points in scene view. | | Display Abs | Display the absolute value as a number in scene view. | | Display Vector | Display the vector as numbers in scene view. | | Use Millimeters | Display one Unity Unit as 1000. | | PLCSignalOffset | Offeset to the MeasuredDistance. | | Measured Distance | PLCInputFloat signal for the absolute distance. | | Measured DistanceX | PLCInputFloat signal for the DistanceX part of the Vector. | | Measured DistanceY | PLCInputFloat signal for the DistanceY part of the Vector. | | Measured DistanceZ | PLCInputFloat signal for the DistanceZ part of the Vector. | © 2025 realvirtual GmbH [https://realvirtual.io](https://realvirtual.io/) - All rights reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or by any means, including printing, saving, photocopying, recording, or other electronic or mechanical methods, without the prior written permission of the publisher. # MeasureForce ## Overview [Section titled “Overview”](#overview) The **MeasureForce** component measures forces and torques acting on Unity joints, providing real-time monitoring of mechanical loads in your simulation. This component reads force and torque values from a joint component and outputs them through PLC signals, making it essential for load monitoring, force-based control systems, and mechanical stress analysis. MeasureForce automatically extracts force and torque data from Unity’s joint physics system and converts them into both readable properties and PLC signal outputs for external system integration. \[Screenshot: MeasureForce component in Inspector showing force/torque readings and PLC signal assignments] ## Properties [Section titled “Properties”](#properties) ### Force Measurements [Section titled “Force Measurements”](#force-measurements) **Force** (Vector3, read-only) Current force vector in Newtons acting on the joint. Displays the X, Y, and Z components of the force being applied to the joint. These values update in real-time during physics simulation and reflect the actual loads on the mechanical connection. **AbsForce** (float, read-only) Absolute magnitude of the force vector in Newtons. This single value represents the total force regardless of direction, useful for load monitoring applications where the direction is less important than the total magnitude. ### Torque Measurements [Section titled “Torque Measurements”](#torque-measurements) **Torque** (Vector3, read-only) Current torque vector in Newton-meters acting on the joint. Shows the rotational forces around the X, Y, and Z axes, providing insight into rotational loads and moments acting on the joint connection. **AbsTorque** (float, read-only) Absolute magnitude of the torque vector in Newton-meters. Represents the total rotational load magnitude, useful for applications requiring overall torque monitoring without directional considerations. ### PLC Signal Outputs - Force [Section titled “PLC Signal Outputs - Force”](#plc-signal-outputs---force) **ForceX** (PLCInputFloat) PLC signal output for force X component in Newtons. Connect to external systems to monitor horizontal force along the X-axis, useful for detecting side loads or lateral forces in mechanical systems. **ForceY** (PLCInputFloat) PLC signal output for force Y component in Newtons. Provides vertical force monitoring along the Y-axis, essential for weight measurement applications and vertical load monitoring. **ForceZ** (PLCInputFloat) PLC signal output for force Z component in Newtons. Monitors force along the Z-axis for depth-related loads and forward/backward force analysis in mechanical assemblies. **ForceAbs** (PLCInputFloat) PLC signal output for absolute force magnitude in Newtons. Provides a single force value representing total load regardless of direction, ideal for overload protection and general load monitoring applications. ### PLC Signal Outputs - Torque [Section titled “PLC Signal Outputs - Torque”](#plc-signal-outputs---torque) **TorqueX** (PLCInputFloat) PLC signal output for torque X component in Newton-meters. Monitors rotational loads around the X-axis, useful for detecting twisting forces and rotational stress in mechanical joints. **TorqueY** (PLCInputFloat) PLC signal output for torque Y component in Newton-meters. Provides torque monitoring around the Y-axis for applications requiring rotational load analysis and moment measurement. **TorqueZ** (PLCInputFloat) PLC signal output for torque Z component in Newton-meters. Monitors torque around the Z-axis for rotational applications and moment analysis in vertical rotation systems. **TorqueAbs** (PLCInputFloat) PLC signal output for absolute torque magnitude in Newton-meters. Single value representing total rotational load regardless of axis, perfect for general torque monitoring and overload protection. ## Usage Examples [Section titled “Usage Examples”](#usage-examples) ### Load Monitoring Setup [Section titled “Load Monitoring Setup”](#load-monitoring-setup) 1. **Joint Requirement**: Ensure your GameObject has a Unity Joint component (HingeJoint, FixedJoint, etc.) 2. **Add Component**: Attach MeasureForce to the same GameObject as the joint 3. **Monitor Values**: Observe Force and Torque properties in the Inspector during play mode 4. **Check Magnitudes**: Use AbsForce and AbsTorque for simplified load monitoring ### PLC Integration Example [Section titled “PLC Integration Example”](#plc-integration-example) 1. **Connect Signals**: Assign PLCInputFloat components to desired force/torque outputs 2. **Interface Setup**: Connect PLC signals to your chosen interface (OPC-UA, S7, etc.) 3. **Threshold Monitoring**: Use external PLC logic to monitor force/torque thresholds 4. **Safety Systems**: Implement overload protection based on force magnitude readings ### Mechanical Analysis Application [Section titled “Mechanical Analysis Application”](#mechanical-analysis-application) 1. **Critical Joint Monitoring**: Place MeasureForce on joints subject to high loads 2. **Real-time Analysis**: Monitor force vectors during different operating conditions 3. **Load Distribution**: Use multiple MeasureForce components to analyze load paths 4. **Performance Optimization**: Identify areas of excessive mechanical stress ## Integration Notes [Section titled “Integration Notes”](#integration-notes) ### Joint Compatibility [Section titled “Joint Compatibility”](#joint-compatibility) * **Required Component**: Unity Joint component must be present on the same GameObject * **Joint Types**: Compatible with all Unity joint types (HingeJoint, FixedJoint, SpringJoint, etc.) * **Physics Dependency**: Requires active physics simulation for accurate force measurement * **Real-time Updates**: Force values update during FixedUpdate for physics consistency ### Performance Considerations [Section titled “Performance Considerations”](#performance-considerations) * Component automatically caches null checks during initialization for optimal performance * Updates occur in FixedUpdate to synchronize with Unity’s physics timestep * Only connected PLC signals are processed to minimize computational overhead * Force calculations use Unity’s built-in joint force measurement system ### Measurement Accuracy [Section titled “Measurement Accuracy”](#measurement-accuracy) * Forces reflect actual physics simulation loads based on joint constraints * Accuracy depends on Unity physics settings and timestep configuration * Joint breaking forces and limits affect the measurement range * Consider joint damping and spring settings for measurement stability ## Troubleshooting [Section titled “Troubleshooting”](#troubleshooting) ### No Force Readings [Section titled “No Force Readings”](#no-force-readings) * Verify that a Unity Joint component is attached to the same GameObject * Ensure physics simulation is running and the joint is under load * Check that joint breaking force limits are not exceeded ### Inconsistent Values [Section titled “Inconsistent Values”](#inconsistent-values) * Verify Fixed Timestep settings in Unity’s Time settings * Check joint configuration for stability issues * Consider joint damping settings for smoother readings ### PLC Signal Issues [Section titled “PLC Signal Issues”](#plc-signal-issues) * Confirm PLCInputFloat components are properly assigned * Test interface connection and signal flow * Verify signal scaling and units match external system expectations ### Performance Impact [Section titled “Performance Impact”](#performance-impact) * Use only necessary PLC signal outputs to minimize processing * Consider update frequency requirements for your application * Monitor physics performance impact in complex scenes with many joints ## See Also [Section titled “See Also”](#see-also) * [Sensor](/doc/unity/components-and-scripts/sensors/sensor/) - Basic sensor components and configuration * [Measure](/doc/unity/components-and-scripts/sensors/measure/) - Distance and position measurement * [Interfaces](/doc/unity/components-and-scripts/interfaces/) - PLC signal integration options * [Joint](/doc/unity/components-and-scripts/motion/joint/) - Unity joint configuration and setup *** © 2025 realvirtual GmbH - All rights reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or by any means, including printing, saving, photocopying, recording, or other electronic or mechanical methods, without the prior written permission of the publisher. # MeasureRaycast MeasureRaycast is measuring distances between the pivot point of the Gameobject, the MeasureRaycast script is attached to and a collider or between two colliders. MeasureRaycast is using the Unity Raycast system for sending rays ino the desired direction and detecting collisions and distances. You need to attach a collider to the 3D meshes you want to detect. You can also connect the result of the measurement to a PLCInput Signal. By doing this MeasureRaycast is able to act as a sensor. ![](/doc/unity/assets/measureraycast.png) You can apply the following properties: | Property | Description | | ------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | RaycastDirection | The direction of the Raycast in local coordinate system | | Measure between colliders | If set to true the measurement is not performed between the pivot point and a collider. Instead rays are set into two directions from the pivot point and the distance between the two detected collisions is measured. | | Raycast Length | Defines the maximum length of the raycast in one direction. If you measure between two colliders the total measured maximum distance is twice this given distance. | | Display Raycast | Needs to be set to true if you want to see a line in Scene window for the raycast. The line will be red on collision and yellow if no collision is detected. | | Raycast to layer | The raycast is always performed only on one layer. As default it is the Default Layer. If you colliders are on a different Layer you need to change this. | | Use Millimeters | If set to true as a result one Unity Unit will be transformed to 1000. | | PLCSignalOffset | A signal offset value which is added to the measurement result. | | DisplayDistance | Displays the distance of the raycast in Scene Window. | | Measured Distance | The measured distance as PLCInputFloat. It is 0 if no collision is detected. | | Raycast Hit | A PLCInputBool which will be true if the raycast hits an object. | © 2025 realvirtual GmbH [https://realvirtual.io](https://realvirtual.io/) - All rights reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or by any means, including printing, saving, photocopying, recording, or other electronic or mechanical methods, without the prior written permission of the publisher. # Sensor Sensors are detecting [MUs](/doc/unity/components-and-scripts/mu-movable-unit/). The sensor can use BoxColliders or Raycasts for collision detection.\ A behavior component (e.g. Sensor\_Standard) must be added to the Sensor for a connection to a PLC’s Input and Outputs. This tutorial explains first steps with Sensors: [Tutorial about adding Sensors to your Digital Twin](https://www.youtube-nocookie.com/embed/3bquTLyGx3k) Tutorial about adding Sensors to your Digital Twin This picture shows a configured Sensor using Colliders in the demo model: ![](/doc/unity/assets/sensor.png) ### Sensor using Colliders[](#sensor-using-colliders) [Section titled “Sensor using Colliders ”](#sensor-using-colliders) Because collisions are used to detect the Sensor status you need to take care that the sensor game object is on the appropriate collision layer which should be normally *g4aSensor*. Note Because of limitations in the collision detection of Mesh Colliders you should always use Box Colliders with Sensors. The Sensor can change the color by changing the material of the sensor. For this, you need to select *Display Status*. ### Sensor using Raycasts[](#sensor-using-raycasts) [Section titled “Sensor using Raycasts ”](#sensor-using-raycasts) Another way for implementing Sensors is to use Raycasts. The advantage of a Raycasts is, that you don’t need to define colliders and you are totally free which Layers you would like to check with the Raycast. Because there is no sensor geometry connected to a Raycast Sensor you need to define the *Raycast Direction* from the pivot point of the Gameobject and the *Raycast length*, as usual in mmm in realvirtual.io. In the game view the Raycast is shown as a Line Renderer which is automatically created on simulation start. Note If the sensor is using Raycasts, the Raycast is always checked against colliders on the same Layer then the Sensor Gameobject itself. Optionally you can define *additional Raycast Layers*. **Raycast always needs to start before the collission with the detected component. Please make sure that the start of the sensor raycast is never inside of an object with needs to be detected.** ![](/doc/unity/assets/sensor-raycast.png) ## Common functions for Sensors using Colliders or Raycasts[](#common-functions-for-sensors-using-colliders-or-raycasts) [Section titled “Common functions for Sensors using Colliders or Raycasts ”](#common-functions-for-sensors-using-colliders-or-raycasts) It is possible to limit the sensor function to a certain Tag of the [MU](/doc/unity/components-and-scripts/mu-movable-unit/). You must enter the Tag in the property *Limit Sensor To Tag*. The current sensor status can be inspected under the section *Sensor IO’s*. Please check the [Realvirtual.io Class Reference](https://game4automation.com/documentation/current/apidoc/html/classgame4automation_1_1_sensor.html) for more information about the properties and methods of this component. You can subscribe to the Unity Events on the Sensor. *Event MU Sensor* is called on every MU detected by the Sensor. *Event Non MU Gameobjet Sensor* is called for all colliders without an MU script that are colliding with the Sensor. ![](/doc/unity/assets/sensor-events.png) ## Sensor Status[](#sensor-status) [Section titled “Sensor Status ”](#sensor-status) Besides the color of the sensor you can check the state of the sensor in the section *Sensor Status* in the Inspector of the Sensor. ![](/doc/unity/assets/sensor-status.png) ## Sensor\_Standard[](#sensor-standard) [Section titled “Sensor\_Standard ”](#sensor_standard) The Sensor\_Standard component provides the standard Sensor behavior and connectivity to the PLC inputs and outputs. With the property *NormallyClosed=true* it can be selected, as the sensor is true and the sensor is not occupied. Note The Sensor\_Standard is a blueprint for additional sensors that return various values such as distance, speed etc. to the PLC. We suggest you use this template as the starting point for building your own sensors. © 2025 realvirtual GmbH [https://realvirtual.io](https://realvirtual.io/) - All rights reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or by any means, including printing, saving, photocopying, recording, or other electronic or mechanical methods, without the prior written permission of the publisher. # Signal Connector > Couple a PLC output to a PLC input with an explicit conversion: copy, INT to BOOL, single bits from or into a word, scaling and inversion. ## Overview [Section titled “Overview”](#overview) The **SignalConnector** passes the value of one signal on to another signal and converts it on the way. The typical case is two controllers in one scene: the robot controller reports `RobotReady`, and the cell PLC expects that information on its own input `Rob_Ready`. The connector copies it across, and it can also turn an INT into a BOOL, pick a single bit out of a status word, build a word from single bits, or scale a value. * One connector has **one source** and **one target**. To couple in both directions, use two connectors. * The **source** is a PLC output (`PLCOutputBool`, `PLCOutputInt`, `PLCOutputFloat`): a value a controller writes, such as a robot output. The **target** is a PLC input (`PLCInputBool`, `PLCInputInt`, `PLCInputFloat`): a value the simulation writes and the other controller reads. * The connector can sit on any GameObject. Unlike **ConnectSignal**, it does not have to be on the target signal. * It checks the source every `FixedUpdate` and writes only when the converted value differs from what the target holds. The SignalConnector is exported to realvirtual WEB with the same fields and gives the same results there (see [Parity with realvirtual WEB](#parity-with-realvirtual-web)). ## Modes [Section titled “Modes”](#modes) The **Mode** decides the conversion and which two signal slots are used. Every mode uses exactly one source slot and one target slot. | Mode | Source → target | What it does | | --------------- | ----------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | | **Copy** | BOOL → BOOL, INT → INT, REAL → REAL, INT → REAL | Passes the value on unchanged. With **Invert**, a BOOL is negated. | | **IntToBool** | INT → BOOL | True when the INT is not 0, equals **Compare Value**, or is at least **Compare Value** (see **Condition**). | | **BoolToInt** | BOOL → INT | Writes **True Value** for true and **False Value** for false. | | **BitFromWord** | INT → BOOL | Reads one bit (**Bit**) of the INT. | | **BitToWord** | BOOL → INT | Sets one bit (**Bit**) of the target word. Several connectors with different bits build the word together. | | **Scale** | INT or REAL → INT or REAL | Writes `source × Factor + Offset`. | One connector handles one bit. To read eight bits of a status byte, use eight connectors with the same source and different **Bit** values. To build a word from eight BOOLs, use eight **BitToWord** connectors with the same target. ## Properties [Section titled “Properties”](#properties) The Inspector shows only the settings and the signal slots the selected **Mode** uses. **Mode** (enum) The conversion, see [Modes](#modes). Default is *Copy*. When you change the mode in the Inspector, the slots the new mode does not use are cleared in the same step, and one undo brings back both the mode and the slots. **Enabled** (boolean) When off, the connector writes nothing and takes part in no check. You can switch it during play mode; a **BitToWord** connector that is switched off sets its bit to 0. **Source Bool**, **Source Int**, **Source Float** (PLC output) The source signal. *Source Bool* is used by Copy (BOOL), BoolToInt and BitToWord; *Source Int* by Copy (INT and INT → REAL), IntToBool, BitFromWord and Scale; *Source Float* by Copy (REAL) and Scale. **Target Bool**, **Target Int**, **Target Float** (PLC input) The target signal. *Target Bool* is used by Copy (BOOL), IntToBool and BitFromWord; *Target Int* by Copy (INT), BoolToInt, BitToWord and Scale; *Target Float* by Copy (INT → REAL and REAL) and Scale. **Condition** (enum) IntToBool only. *NotZero* (default) is true for every value other than 0, negative values included. *Equals* is true when the value equals **Compare Value**, *GreaterOrEqual* when it is at least **Compare Value**. **Compare Value** (integer) IntToBool with *Equals* or *GreaterOrEqual*. The value to compare with. Default is 0. **True Value**, **False Value** (integer) BoolToInt only. The INT written for true and for false. Defaults are 1 and 0. **Bit** (integer) BitFromWord and BitToWord. The bit number, 0 is the least significant bit. It must be smaller than the width: 0–7 for *Byte*, 0–15 for *Word*, 0–31 for *DWord*. Default is 0. **Width** (enum) The size of the INT: *Byte* (8 bit), *Word* (16 bit, default) or *DWord* (32 bit). It sets the range of **Bit**, how Scale reads an INT source, and the range an INT target of Scale is limited to. **Signed** (boolean) Whether the INT is read and written as signed at **Width**. A *Byte* is −128 to 127 when signed and 0 to 255 when not. Default is on. **Factor**, **Offset** (number) Scale only. The result is `source × Factor + Offset`. Defaults are 1 and 0, both without unit. **Rounding** (enum) Scale with an INT target. *Round* (default) rounds halves away from zero, so 2.5 becomes 3 and −2.5 becomes −3. *Truncate* cuts towards zero, so 2.9 becomes 2 and −2.9 becomes −2. **Invert** (boolean) Negates the BOOL result of Copy (BOOL), IntToBool and BitFromWord, and the bit a BitToWord connector contributes. Default is off. ## Usage Examples [Section titled “Usage Examples”](#usage-examples) ### Quick start [Section titled “Quick start”](#quick-start) 1. Create an empty GameObject next to the signals, for example *Couplings*. 2. Add the component via **Add Component > realvirtual > Utility > Signal Connector**. 3. Choose the **Mode**. 4. Drag the source signal (a PLC output of the first interface) and the target signal (a PLC input of the second interface) into the two slots the Inspector shows. 5. Set the remaining options, such as **Bit** and **Width**, and start the simulation. ### Robot and PLC [Section titled “Robot and PLC”](#robot-and-plc) A robot controller and a cell PLC share a scene. The robot reports its state with the BOOL output `RobotReady` and the INT status word `RobotStatus`. The PLC expects BOOL inputs. | Connector | Mode | Source | Target | Settings | | ---------------- | ----------- | --------------------------- | ----------------------- | --------------------------- | | Ready | Copy | `RobotReady` (robot output) | `Rob_Ready` (PLC input) | — | | In home position | BitFromWord | `RobotStatus` | `Rob_Home` | **Bit** 0, **Width** *Word* | | Gripper closed | BitFromWord | `RobotStatus` | `Rob_GripClosed` | **Bit** 3, **Width** *Word* | | Fault | IntToBool | `RobotErrorCode` | `Rob_Fault` | **Condition** *NotZero* | In the other direction, the PLC releases the robot with BOOL outputs that the robot reads as one INT command word: | Connector | Mode | Source | Target | Settings | | --------- | --------- | -------------- | -------------- | --------- | | Start | BitToWord | `PLC_RobStart` | `RobotCommand` | **Bit** 0 | | Reset | BitToWord | `PLC_RobReset` | `RobotCommand` | **Bit** 1 | With `PLC_RobStart` true and `PLC_RobReset` false, `RobotCommand` is 1. ## Number rules [Section titled “Number rules”](#number-rules) The same rules apply in Unity, in realvirtual WEB and in realvirtual CONNECT. * **INT values are 32-bit signed.** A DWORD with bit 31 set is a negative number: `0x80000000` is −2147483648 and `0xFFFFFFFF` is −1. **BitFromWord** with **Bit** 31 on −2147483648 gives true. * **Width and Signed only change how a number is read or limited.** With *Byte* and **Signed** on, the INT 255 is read as −1. With **Signed** off, it is read as 255. * **Scale into an INT target is limited to the range of Width and Signed.** 300 into an unsigned *Byte* becomes 255, 40000 into a signed *Word* becomes 32767. * **REAL targets are 32-bit floats.** 16777217 is written as 16777216. A result that is not a finite number, such as NaN or a value beyond the float range, is not written; the target keeps its last value. * **BitToWord builds the whole word.** The target word holds exactly the bits of the BitToWord connectors that write it. Bits that no connector writes are 0, and the connector never reads the target back. When you disable or remove a bit connector, its bit becomes 0; when the last one goes, the word is set to 0. If the connectors of one word have different settings, the widest **Width** applies, and the word is signed only when all of them are **Signed**. * **IntToBool with NotZero treats negative values as true.** The older **ConnectSignal** component only turns positive values into true. ## Problems [Section titled “Problems”](#problems) The connector checks its setup when the simulation starts, and again when you change it in the Inspector during play mode or switch **Enabled**. It reports problems as warnings in the Console. Each warning names the GameObject and carries the same problem code as the Problems panel of realvirtual WEB. A disabled connector reports nothing. | Code | Meaning | | -------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `signal-connector-unresolved` | A slot the mode needs is empty. The connector writes nothing. | | `signal-connector-slot-mismatch` | A slot is set that the mode does not use, for example after editing the scene file by hand. The connector still works on the slots of its mode. | | `signal-connector-fan-in` | More than one writer on the same target: two connectors, or a connector and a **ConnectSignal** on the target. Several **BitToWord** connectors may share one word only if each uses a different bit and a different source. All writers on that target stop writing. | | `signal-connector-cycle` | The target leads back to the source, over other connectors or a **ConnectSignal** (for example a connector from A to B and a ConnectSignal on A that copies B). The connector writes nothing. | | `signal-connector-width` | **Bit** does not fit the **Width**, for example bit 16 in a *Word*. The connector writes nothing. | | `signal-connector-nonfinite` | The converted value is NaN or beyond the float range and was not written. | In Unity, the slot types already make sure the target is a PLC input, so the WEB code `signal-connector-direction` does not occur. A ConnectSignal that is added or changed while the simulation runs is only taken into account at the next check of the connector. A forced target (signal **Override**) keeps its forced value. The connector keeps calculating in the background, so the current value appears as soon as the force is released. ## Parity with realvirtual WEB [Section titled “Parity with realvirtual WEB”](#parity-with-realvirtual-web) The GLB export carries the SignalConnector with all its fields, and realvirtual WEB runs the same conversion on it. The results are the same; only the timing differs: * **Unity works in ticks.** Each connector reads its source once per `FixedUpdate`. In a chain such as A → B → C over several connectors, or with several BitToWord connectors on one word, the final value can arrive one or more `FixedUpdate` cycles later, depending on the execution order of the components. * **realvirtual WEB passes a change on at once.** A new source value reaches the target in the same step, through a whole chain. The end values are the same in both. Do not build PLC logic that depends on a value arriving in exactly the same cycle as its source. ## ConnectSignal [Section titled “ConnectSignal”](#connectsignal) The older **ConnectSignal** component sits on the target signal and copies one source onto it without options. It follows a fixed rule: an INT onto a BOOL is true when the INT is greater than 0 (a negative INT is false), a BOOL onto an INT is 1 or 0, and everything else is copied unchanged. Existing scenes keep working. For new couplings, use the SignalConnector. ## See Also [Section titled “See Also”](#see-also) * [Interfaces](/doc/unity/components-and-scripts/interfaces/): PLC signals and the industrial interfaces that write and read them * [PLC Logics](/doc/unity/components-and-scripts/plc-logics/): logic in the simulation * [realvirtual WEB: supported components](/doc/unity/extensions/realvirtual-web/supported-components/) # State Statistics (Pro) Note This feature was added in realvirtual **6.0.7** (Professional) **State Statistics** provides production state tracking with time-based statistics collection for OEE analysis, bottleneck identification, and performance monitoring. ## Overview [Section titled “Overview”](#overview) The StateStatistics component tracks how much time objects spend in different states, enabling Overall Equipment Effectiveness (OEE) analysis and production optimization. ## Key Features [Section titled “Key Features”](#key-features) * **State Time Tracking** – Measure duration in each production state * **OEE Calculation** – Support for availability, performance, and quality metrics * **Bottleneck Identification** – Identify which states consume most time * **Real-Time Monitoring** – Track statistics during simulation runtime * **Export Capabilities** – Generate reports from collected statistics ## Common Production States [Section titled “Common Production States”](#common-production-states) Typical states tracked in industrial automation: * **Idle** – Waiting for material or instructions * **Processing** – Active production or handling * **Blocked** – Cannot proceed due to downstream issues * **Starved** – Waiting for upstream material delivery * **Maintenance** – Under maintenance or repair * **Error** – In error state requiring intervention ## Usage Examples [Section titled “Usage Examples”](#usage-examples) ### Basic State Tracking [Section titled “Basic State Tracking”](#basic-state-tracking) ```csharp // StateStatistics component tracks state changes automatically // Configure which states to monitor in Inspector ``` ### OEE Analysis [Section titled “OEE Analysis”](#oee-analysis) Statistics collected can be used for: * **Availability** = (Total Time - Downtime) / Total Time * **Performance** = Actual Output / Theoretical Maximum Output * **Quality** = Good Parts / Total Parts Produced * **OEE** = Availability × Performance × Quality ## Common Applications [Section titled “Common Applications”](#common-applications) * **Production Line Analysis** – Identify inefficiencies in manufacturing processes * **Bottleneck Detection** – Find which stations limit throughput * **Shift Performance** – Compare productivity across different time periods * **Continuous Improvement** – Track impact of process changes over time * **Capacity Planning** – Understand actual vs theoretical capacity ## Integration Points [Section titled “Integration Points”](#integration-points) * Integrates with [StatDisplay](/doc/unity/components-and-scripts/scene-interaction/statdisplay/) for visualization * Compatible with DES simulation for accelerated analysis * Exports to standard reporting formats ## See Also [Section titled “See Also”](#see-also) * [StatDisplay](/doc/unity/components-and-scripts/scene-interaction/statdisplay/) - Real-time statistics display # Duplicate Finder (Pro) Note This feature was added in realvirtual **6.0.7** (Professional) **Duplicate Finder** is an editor tool that identifies identical meshes in your scene using hash comparison, enabling performance optimization through asset consolidation. ## Overview [Section titled “Overview”](#overview) The Duplicate Finder analyzes meshes in your scene and identifies geometrically identical objects, even if they have different names or are positioned differently. This helps optimize scene performance by consolidating duplicate assets. ## Key Features [Section titled “Key Features”](#key-features) * **Mesh Hash Comparison** – Uses sophisticated hashing to identify identical geometries * **Visual Scene Highlighting** – Shows duplicate objects with wireframe gizmos and labels * **Performance Optimization** – Reduces memory and rendering overhead * **Batch Operations** – Select and manage multiple duplicates at once * **Scene Hash Caching** – Speeds up repeated analysis with cached hash data ## Accessing Duplicate Finder [Section titled “Accessing Duplicate Finder”](#accessing-duplicate-finder) Open the tool from Unity’s menu: `Tools > realvirtual > Duplicate Finder (Pro)` ![](/doc/unity/assets/duplicate-finder-window.png) Duplicate Finder window showing 6 clones of a fence object with scene visualization ## How It Works [Section titled “How It Works”](#how-it-works) 1. **Select an Object** – Select any GameObject in your scene hierarchy 2. **Automatic Analysis** – Duplicate Finder calculates mesh hash and finds matches 3. **Visual Feedback** – Identical objects are highlighted in the scene view 4. **Take Action** – Review and consolidate duplicates to optimize performance ## Window Interface [Section titled “Window Interface”](#window-interface) ![](/doc/unity/assets/duplicate-finder-interface.png) Duplicate Finder interface showing visualization options, action buttons, and clone list The Duplicate Finder window is organized into several sections: ### Visualization Options [Section titled “Visualization Options”](#visualization-options) * **Show Wireframe Gizmos** (checkbox) – Display yellow wireframe outlines around duplicate objects in scene view * **Show Number Labels** (checkbox) – Show numeric labels \[0], \[1], \[2], etc. above each duplicate instance * **Refresh** (button) – Recalculates mesh hashes and updates duplicate detection ### Action Buttons [Section titled “Action Buttons”](#action-buttons) * **Select All (X Clones + Original)** (green button) – Selects all duplicate objects plus the original in the scene hierarchy. The button displays the total count dynamically. * **Materials to Clones** (button with brush icon) – Copies all materials from the selected object to all detected clones * **Components to Clones** (button with gear icon) – Copies all components from the selected object to all detected clones ### Clone List [Section titled “Clone List”](#clone-list) * **Selected Object** – Shows the currently selected object name at the top (highlighted with blue cube icon) * **Numbered Clones** – Lists all detected duplicates with sequential numbers \[0], \[1], \[2], \[3], etc. * **Object Names** – Displays the GameObject name for each clone with blue cube icon * **Navigation Icons** – Click the circle icon on the right to select and navigate to that object in the hierarchy ### Status Display [Section titled “Status Display”](#status-display) At the bottom of the window, a yellow warning triangle displays: **“Found X duplicate(s) of the selected object”** ## Common Applications [Section titled “Common Applications”](#common-applications) * **CAD Import Optimization** – Identify repeated components in imported CAD assemblies * **Scene Performance** – Reduce memory usage by consolidating identical meshes * **Asset Management** – Find opportunities to reuse existing prefabs * **Quality Assurance** – Verify component standardization across factory layouts ## Performance Impact [Section titled “Performance Impact”](#performance-impact) **Benefits of Consolidation:** * Reduced memory footprint from shared meshes * Improved rendering performance with fewer unique geometries * Better asset management with prefab reuse * Smaller build sizes ## See Also [Section titled “See Also”](#see-also) * [Material Window](/doc/unity/basics/user-interface/material-window-pro/) - Material management with duplicate detection * [Model Checker](/doc/unity/basics/user-interface/model-checker/) - Scene validation tool # Mesh Tools (Pro) Note This feature was added in realvirtual **6.3.3** (Professional) **Mesh Tools** is a tabbed editor window that combines mesh-related utilities for working with imported CAD models. It provides two tools: **Auto Correct Pivots** for fixing off-center mesh origins, and **Mesh Separator** for splitting combined meshes into individual parts. ## Accessing Mesh Tools [Section titled “Accessing Mesh Tools”](#accessing-mesh-tools) **Editor Window:** `Tools > realvirtual > Mesh Tools (Pro)` **Context Menu (quick access for Mesh Separator):** * Right-click a GameObject > `realvirtual > Separate Mesh` * Right-click a GameObject > `realvirtual > Merge Child Meshes` *** ## Tab 1: Auto Correct Pivots [Section titled “Tab 1: Auto Correct Pivots”](#tab-1-auto-correct-pivots) ![](/doc/unity/assets/mesh-tools-correct-pivots.png) Correct Pivots tab showing analysis results for a conveyor system — all 12 meshes passed with zero offset ### Overview [Section titled “Overview”](#overview) CAD models frequently arrive with mesh pivots (transform origins) far away from the actual geometry. A small bracket might have its origin at the machine’s global zero point, hundreds of millimeters away. This causes poor rotation behavior, difficulty placing objects, and issues with Drive axes. Auto Correct Pivots fixes this by recentering the mesh vertices around the local origin and compensating the transform so the geometry stays in exactly the same world position. ### How It Works [Section titled “How It Works”](#how-it-works) For each mesh in the selected hierarchy, the tool: 1. Calculates how far the mesh center is from the local origin 2. Clones the mesh and offsets all vertices so the center becomes the origin 3. Moves the transform to compensate, keeping the mesh visually in place 4. Preserves all child positions so nothing in the hierarchy shifts 5. Updates any MeshCollider referencing the original mesh 6. Saves the corrected mesh as an asset in `Assets/CorrectedPivots/` ### Settings [Section titled “Settings”](#settings) * **Root Object** — The root GameObject to scan. All MeshFilters in the hierarchy below this object are analyzed. Defaults to the current selection. * **Min Offset (mm)** — Only meshes whose pivot is further than this distance from the mesh center are corrected. Default: `1.0` mm. Increase this to skip meshes with minor offsets. ### Workflow [Section titled “Workflow”](#workflow) 1. Select the root object of your imported CAD model 2. Open `Tools > realvirtual > Mesh Tools (Pro)` 3. The **Auto Correct Pivots** tab is shown by default 4. Set the root object and adjust the threshold if needed 5. Click **Analyze** to scan the hierarchy — the results list shows each mesh with its offset distance 6. Review the results — click any item to ping/select it in the Hierarchy 7. Click **Apply All Corrections** to batch-correct all meshes above the threshold 8. Use **Ctrl+Z** to undo the entire operation if needed ### What Gets Skipped [Section titled “What Gets Skipped”](#what-gets-skipped) * Meshes with offset below the threshold * GameObjects with a SkinnedMeshRenderer (bone-based skinning would break) * MeshFilters with no mesh assigned or with zero vertices ### Notes [Section titled “Notes”](#notes) * Corrected meshes are saved as `.asset` files in `Assets/CorrectedPivots/`. You can safely delete this folder to reclaim disk space — the meshes are referenced by the scene. * If multiple GameObjects share the same source mesh, each receives its own corrected copy. * The operation works correctly on rotated and scaled objects, including objects deep in nested hierarchies. *** ## Tab 2: Mesh Separator [Section titled “Tab 2: Mesh Separator”](#tab-2-mesh-separator) ![](/doc/unity/assets/mesh-tools-separator.png) Mesh Separator with color-coded island preview in the Scene view — 18 islands detected on a machine assembly ### Overview [Section titled “Overview”](#overview-1) CAD imports and mesh-baking tools often produce a single mesh containing multiple disconnected parts. The Mesh Separator detects these disconnected islands using a Union-Find algorithm with configurable vertex welding and lets you split them into individual GameObjects. You can also reverse the process by merging multiple child meshes into one combined mesh. ### Key Features [Section titled “Key Features”](#key-features) * **Island Detection** — Automatically finds disconnected mesh regions using vertex connectivity analysis * **Color-Coded Preview** — Each island is highlighted with a unique color overlay and wireframe in the Scene view * **Selective Separation** — Choose which islands to separate using per-island toggles * **Mesh Merging** — Combine multiple child MeshRenderers into a single mesh on the parent * **Vertex Attribute Preservation** — Normals, tangents, UVs (all channels), vertex colors, and bone weights are preserved * **Sub-Mesh & Material Support** — Material assignments and sub-mesh structure are maintained during separation ### Settings [Section titled “Settings”](#settings-1) * **Weld Threshold** — Vertices closer than this distance (in meters) are treated as the same point for connectivity detection. Default: `0.0001`. Increase this value if islands that should be connected are being split apart. * **Delete Original Mesh** — When enabled, the original MeshFilter and MeshRenderer are removed after separation. When disabled (default), the original renderer is simply disabled. * **Auto Preview** — Automatically updates the island preview whenever you select a new object. ### Islands [Section titled “Islands”](#islands) Shows the detected islands with color swatches and vertex/triangle counts. Use the checkboxes to select which islands to separate. The **All** and **None** buttons quickly toggle all islands. ### Actions [Section titled “Actions”](#actions) * **Separate All** — Separates every detected island into its own child GameObject * **Separate Selected** — Separates only the checked islands * **Merge Child Meshes** — Combines all child MeshRenderers into one mesh on the selected parent object ### Workflow [Section titled “Workflow”](#workflow-1) 1. Select a GameObject with a combined mesh in your scene 2. Open `Tools > realvirtual > Mesh Tools (Pro)` and switch to the **Mesh Separator** tab 3. The preview activates automatically, coloring each island in the Scene view 4. Toggle individual islands on/off using the checkboxes 5. Click **Separate All** or **Separate Selected** 6. The separated parts appear as child GameObjects with individual meshes ### Common Use Cases [Section titled “Common Use Cases”](#common-use-cases) * **CAD Assembly Splitting** — Break apart imported CAD models that were exported as a single combined mesh into individual parts for animation or interaction * **Drive Assignment** — Separate a combined mesh so each part can be assigned to its own Drive component for independent motion * **Selective Export** — Split a mesh to isolate specific parts for GLB export or WebViewer usage * **Performance Optimization** — Merge previously separated parts back into one mesh to reduce draw calls * **Sensor Preparation** — Create individual colliders per part by separating the mesh first *** ## See Also [Section titled “See Also”](#see-also) * [Duplicate Finder (Pro)](/doc/unity/components-and-scripts/tools/duplicate-finder/) * [Mesh Optimizer (Pro)](/doc/unity/components-and-scripts/performance-tools/mesh-optimizer-pro/) * [Combine Meshes (Pro)](/doc/unity/components-and-scripts/performance-tools/combine-meshes-pro/) # Volume Tracking Note Volume Tracking is only included in realvirtual.io Professional Volume tracking allows to record the volume occupied over time by moving components. Once the volume is recorded, the minimal distance can be visualized on any object using different modes. ![](/doc/unity/assets/Screenshot%202025-01-20%20130602.png) The distance to the volume occupied by the robot is visualized in the CNC machine using a discrete color gradient ## Volume Tracker [Section titled “Volume Tracker”](#volume-tracker) The VolumeTracker prefab can be dragged into a scene. It allows setting up the volume tracking system in edit mode, while recording is done in play mode. ![](/doc/unity/assets/Screenshot%202025-01-20%20120636.png) | Attribute | Function | | ------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | | Id | the unique identifier of this tracking system. It defines the persistent save path of the generated volume assets. | | Size | Defines the bounding box of the tracking system. | | Resolution | The resolution defines the dimensions of a single voxel. | | Time Tracking | If set to true, the system will track the occupation time for each voxel. If set to false, the system simply reports if a voxel has been occupied or not. | | Tracked Groups | The names of the groups that will be tracked | | Visualizing Groups | The names of the groups that will display their distance to the tracked volume | | Min Occupation Time | if used with time tracking, this parameter defines the minimal occupation time on a single voxel for it to be marked ass occupied. | | Visualizer Mode | Allows to choose between different visualization modes | | Target Gizmos | Shows the gizmos of the target objects defined by Tracked Groups. | | Surface Level | Defines the level of the generated isosurface | ## Setting up the tracking system [Section titled “Setting up the tracking system”](#setting-up-the-tracking-system) The following instructions help to set up the volume tracking in the edit mode. First, define the Tracked Groups and the Visualizing Groups as well as the Id, the Size and the resolution of your system. Click on Init Targets to precompute the voxel matrix of the system. Depending on your setup, this may take a while. ## Executing the tracking system [Section titled “Executing the tracking system”](#executing-the-tracking-system) In order to execute the volume tracker it is required to switch to play mode. In the section Tracking Status you can find the Start Tracking button. This button starts the the volume recording and once the tracked groups have covered the total area of interest, you can stop the tracking by clicking on Stop Tracking.\ \ The system will automatically generate the required volume assets. Play mode can be exited for the following. ## Visualizing the results [Section titled “Visualizing the results”](#visualizing-the-results) Once you have generated volume assets, you can choose the visualizer mode that suits your needs. The following gives a brief overview of the available modes. #### Original [Section titled “Original”](#original) The visualized groups are displayed using their original materials. #### Gradient [Section titled “Gradient”](#gradient) The minimal distance of the visualized groups to the tracked volume is displayed using a continuous heat color gradient. The range of the gradient goes from 0 to 1 meter. ![](/doc/unity/assets/Screenshot%202025-01-20%20130409.png) #### Segments [Section titled “Segments”](#segments) The minimal distance of the visualized groups to the tracked volume is displayed using 3 colored segments with respective cutoffs. The cutoffs can be changed in the inspector. ![](/doc/unity/assets/Screenshot%202025-01-20%20125415.png) Segment 1 will be displayed as red, segment 2 is yellow and segment 3 is green. ![](/doc/unity/assets/Screenshot%202025-01-20%20130339.png) #### Cutout [Section titled “Cutout”](#cutout) Displayes the visualized groups as in the Segments mode but it cuts of the visualized groups after the 3rd segment. ![](/doc/unity/assets/Screenshot%202025-01-20%20130449.png) ## Generating an Isosurface [Section titled “Generating an Isosurface”](#generating-an-isosurface) Once you have a recorded volume asset, you can generate a mesh representing the surface of the volume with respect to a certain distance. When set to 0 the isosurface directly shows the occupied volume. For a value of 0.1, the surface encloses the occupied volume with a margin of 0.1 meters as shown below. ![](/doc/unity/assets/Screenshot%202025-01-20%20132023.png) # Move Pivot Tool (Pro) The Move Pivot Tool provides precise pivot point manipulation for GameObjects in the Unity Editor, specifically designed for industrial automation components in the realvirtual framework. ## Overview [Section titled “Overview”](#overview) The Move Pivot Tool enables you to reposition object pivot points by selecting vertices in the Scene View or aligning objects with each other. This tool is essential for proper component alignment in automation systems where precise positioning is critical. The tool features a streamlined, condensed interface design for efficient workflow integration and includes comprehensive error handling for stable operation. ![Move Pivot Tool Interface](/doc/unity/assets/movepivot.png) Note This tool is only available in the Professional version of realvirtual. ## Opening the Tool [Section titled “Opening the Tool”](#opening-the-tool) Access the Move Pivot Tool through: * **Quick Edit Menu**: Available in the main realvirtual toolbar * **Scene View Integration**: Toggle between overlay and windowed modes using the mode button in the tool interface The tool automatically selects the currently highlighted GameObject in the Hierarchy as the source object. ## Interface Features [Section titled “Interface Features”](#interface-features) ### Compact Design [Section titled “Compact Design”](#compact-design) The tool interface uses a condensed layout without visual separators between sections, featuring reduced padding and margins for efficient screen space usage. The window has a minimum height of 250 pixels for optimal usability. ### Display Modes [Section titled “Display Modes”](#display-modes) * **Overlay Mode**: Displays as an overlay in the Scene View for seamless integration * **Window Mode**: Opens as a separate EditorWindow for extended use * **Mode Toggle**: Switch between modes using the toggle button in the tool interface > **💡 Hint**\ > The mode toggle functionality is accessed through the UI button, providing flexible workspace integration. ## Core Functionality [Section titled “Core Functionality”](#core-functionality) ### Vertex-Based Positioning [Section titled “Vertex-Based Positioning”](#vertex-based-positioning) **Point Selection** Select up to three vertices in the Scene View to define new pivot positions: 1. Click **Point 1**, **Point 2**, or **Point 3** buttons to activate selection mode 2. Click on mesh vertices in the Scene View while in selection mode 3. Selected points are visually indicated with interactive gizmos **Positioning Options** * **Move to Point**: Position pivot at any selected vertex * **Move to Midpoint**: Position pivot at the center between two selected points * **Move to Center**: Position pivot at the geometric center of three selected points ### Object-Based Alignment [Section titled “Object-Based Alignment”](#object-based-alignment) **Target Object Selection** 1. Click **Select Object2** to activate target selection mode 2. Hover over the desired object in the Scene View 3. Click to select the target object **Visual Indicators** * **RGB Axes**: Indicate the target object’s current pivot point * **White Axes**: Show the target object’s geometric center **Alignment Options** * **Move to Target’s Pivot**: Align source object pivot with target object’s pivot point * **Move to Target’s Mesh Center**: Position source object pivot at the target object’s geometric center > ⚠️ **Attention**\ > The “Move to Target’s Mesh Center” option requires selecting a target object and uses the target’s mesh center, not the source object’s center. ### Utility Functions [Section titled “Utility Functions”](#utility-functions) **Reset** * Clears all current selections * Resets tool state for new operations * Allows starting fresh with pivot positioning **Undo Support** * Full Unity Undo integration * Safe experimentation with pivot changes * Revert actions when needed ## Usage Examples [Section titled “Usage Examples”](#usage-examples) ### Aligning Conveyor Components [Section titled “Aligning Conveyor Components”](#aligning-conveyor-components) 1. Select the conveyor segment as the source object 2. Use **Point 1** and **Point 2** to select connection vertices 3. Click **Move to Midpoint** to center the pivot between connection points 4. Align with adjacent conveyor segments for seamless connection ### Robot Arm Base Positioning [Section titled “Robot Arm Base Positioning”](#robot-arm-base-positioning) 1. Select the robot arm base GameObject 2. Click **Select Object2** and choose the mounting point object 3. Use **Move to Target’s Pivot** to align the robot base with the mounting point 4. Verify alignment using the visual axis indicators ### Sensor Mounting [Section titled “Sensor Mounting”](#sensor-mounting) 1. Select the sensor GameObject as the source 2. Use **Point 1** to select the mounting vertex on the target surface 3. Click **Move to Point** to position the sensor pivot at the mounting location ## Best Practices [Section titled “Best Practices”](#best-practices) ### Precision Guidelines [Section titled “Precision Guidelines”](#precision-guidelines) * **Zoom In**: Use close-up views when selecting vertices for maximum accuracy * **Multiple Views**: Switch between Scene View perspectives to verify selections * **Visual Confirmation**: Always check the gizmo indicators before applying changes ### Workflow Optimization [Section titled “Workflow Optimization”](#workflow-optimization) * **Object Verification**: Confirm the correct source object is selected before starting * **Target Validation**: Verify target object selection, especially in complex scenes * **Incremental Changes**: Make small adjustments and test functionality between changes ### Performance Considerations [Section titled “Performance Considerations”](#performance-considerations) * **Scene Complexity**: Tool performance is optimized for typical automation scenes * **Selection Feedback**: Real-time visual feedback helps maintain responsive interaction * **Error Handling**: Comprehensive null checks prevent crashes during operation ## Troubleshooting [Section titled “Troubleshooting”](#troubleshooting) ### Common Issues [Section titled “Common Issues”](#common-issues) * **No Visual Feedback**: Ensure objects have valid mesh renderers for vertex detection * **Selection Not Working**: Verify objects are not locked or disabled in the Inspector * **Gizmos Not Showing**: Check that Gizmos are enabled in the Scene View toolbar ### Error Prevention [Section titled “Error Prevention”](#error-prevention) The tool includes extensive error checking to handle: * Missing object references * Invalid mesh data * Scene state changes during operation ## See Also [Section titled “See Also”](#see-also) * [Reparenting Tool](/doc/unity/basics/user-interface/reparenting-tool-pro/) - Object hierarchy management * [Quick Edit Menu](/doc/unity/basics/user-interface/quick-edit/) - Accessing editing tools * [Model Checker](/doc/unity/basics/user-interface/model-checker/) - Scene validation tools *** © 2025 realvirtual GmbH [https://realvirtual.io](https://realvirtual.io/) - All rights reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or by any means, including printing, saving, photocopying, recording, or other electronic or mechanical methods, without the prior written permission of the publisher. # Customer Portal The **realvirtual Customer Portal** at [download.realvirtual.io](https://download.realvirtual.io) is the central web platform for managing your realvirtual licenses, downloading packages, generating temporary access codes for your team, and viewing invoices. ## Getting Started [Section titled “Getting Started”](#getting-started) Open [download.realvirtual.io](https://download.realvirtual.io) in your browser. You will see two options: * **Downloads** — Download realvirtual Unity packages * **Customer Portal** — Manage licenses, codes, and invoices ![](/doc/unity/assets/customer-portal-landing.png) Customer Portal landing page at download.realvirtual.io ## Downloads [Section titled “Downloads”](#downloads) Click **Downloads** to access your available realvirtual packages. You need to log in with your invoice credentials first (Invoice Number, Billing ZIP Code, Email). Caution **First Installation?** You must download the `.tgz` package files from this page before you can install realvirtual in Unity. Download all `.tgz` files to a local folder, then import them in Unity via **Package Manager → Add package from tarball**. See [Installation](/doc/unity/basics/installation/) for step-by-step instructions. After login, you see all packages available for your license: * **UPM packages** (`.tgz`) — For Unity 6.3+ projects using the Package Manager * **Legacy packages** (`.unitypackage`) — For older Unity versions Each file shows its size and upload date. Click the download icon to download. ![](/doc/unity/assets/customer-portal-downloads.png) Downloads page showing available packages Note Current version is **realvirtual Professional 6.3** for **Unity 6 LTS (6000.3)**, provided as UPM packages. Import them via Unity Package Manager → Add package from tarball. ## Customer Portal Login [Section titled “Customer Portal Login”](#customer-portal-login) Click **Customer Portal** to access license management. The portal uses passwordless **magic link** authentication: 1. Enter the **email address** from your invoice 2. Click **Request Login Link** 3. Check your email for the login link 4. Click the link to access your portal ![](/doc/unity/assets/customer-portal-login.png) Customer Portal login with magic link Caution Use the email address associated with your invoice. If you are unsure which email was used, check your original purchase confirmation or contact support. ## Portal Dashboard [Section titled “Portal Dashboard”](#portal-dashboard) After logging in, the portal dashboard shows your complete account overview: ![](/doc/unity/assets/customer-portal-dashboard.png) Customer Portal dashboard with license entitlements and code management ### Your License Entitlements [Section titled “Your License Entitlements”](#your-license-entitlements) The **License Entitlements** section shows all products associated with your account: * **Product name** and edition (e.g., realvirtual.io Professional 6.3) * **License type** — perpetual, subscription, or monthly * **Total licenses** and **seats** available ### CONNECT license limits [Section titled “CONNECT license limits”](#connect-license-limits) realvirtual CONNECT licenses issued by the portal carry their usage limits inside the signed license token. CONNECT reads them locally — nothing about your signals or CAD files is ever sent back to the portal. | Limit | Community (free registration) | Annual / Lifetime | | -------------------------- | ----------------------------- | ----------------- | | PLC signals | 20 | Unlimited | | CAD import (STEP) per file | 25 MB | Unlimited | | CAD import (JT) per file | 12 MB | Unlimited | The CAD limits apply **per file**, so importing several files in one session is fine as long as each one is under the limit. An oversize import is rejected by CONNECT before conversion starts, not after — you never wait through a long conversion just to be turned away at the end. Note CAD import limits take effect from the CONNECT build that supports them. An older CONNECT installation accepts the same license token but does not apply the limit. Update CONNECT to see the current behaviour. The JT limit is issued today but not yet applied — JT import is not available in CONNECT yet. ### Temporary Codes / Seats [Section titled “Temporary Codes / Seats”](#temporary-codes--seats) Temporary codes let you distribute access to your team members. The overview shows: * **Total Seats** — Your total seat pool across all products * **In Codes** — Seats currently allocated to generated codes * **Available** — Seats still available for new codes * **Active Codes** — Number of currently active codes Click **Manage Temporary Codes** to create and manage codes. ### Invoices & Billing [Section titled “Invoices & Billing”](#invoices--billing) Click **View Invoices** to see and download your invoices as PDF. ## Temporary Code Management [Section titled “Temporary Code Management”](#temporary-code-management) The code management page lets you generate, track, and revoke temporary access codes for your team. ![](/doc/unity/assets/customer-portal-codes.png) Temporary Code Management with code generation and status overview ### Generating a New Code [Section titled “Generating a New Code”](#generating-a-new-code) 1. Select the **Product** from the dropdown 2. Set the number of **Seats** (how many users can use this code simultaneously) 3. Set the **Days** until expiration (max 365) 4. Optionally add a **Label** for identification (e.g., “Summer 2026” or “Team Berlin”) 5. Click **Generate** The generated code will appear in the **Existing Codes** list below. ### Managing Existing Codes [Section titled “Managing Existing Codes”](#managing-existing-codes) Each code shows: | Column | Description | | --------------- | -------------------------------------------- | | **Code** | The access code to share with users | | **Product** | Which product the code grants access to | | **Label** | Your custom label for identification | | **Nutzung** | Current usage: active sessions / total seats | | **Valid Until** | Expiration date | | **Status** | Active, Expired, or Revoked | You can **revoke** active codes by clicking the delete button. Unused seats are returned to your pool immediately. ### Using a Temporary Code [Section titled “Using a Temporary Code”](#using-a-temporary-code) Share the generated code with your team member. They enter the code in the Unity **User Hub** (`Tools > realvirtual > User Hub`) to activate their seat. See [Login & Download Updates (Pro)](/doc/unity/login-and-download-updates-pro/) for details on the Unity-side setup. ## Partner Keys [Section titled “Partner Keys”](#partner-keys) If you received a **Partner Key** (in the format `PK-XXXX-XXXX-XXXX`) from your sales partner, you can use it to activate your realvirtual license directly in Unity. ### Activating a Partner Key in Unity [Section titled “Activating a Partner Key in Unity”](#activating-a-partner-key-in-unity) 1. Open the Unity **User Hub** via `Tools > realvirtual > User Hub` 2. Enter the Partner Key (`PK-XXXX-XXXX-XXXX`) in the **Code** field 3. Enter your **Email** address 4. Click **Login** Your license activates immediately. You can start using realvirtual Professional right away. Note Partner Keys track concurrent sessions — when you close Unity, your seat is freed for others. If your organization also has a direct license (via invoice), the Partner Key seats are tracked separately. Caution If you see a “No seats available” error, all seats on the Partner Key are currently in use. Contact your sales partner to request additional seats or wait for a seat to become available. ## See Also [Section titled “See Also”](#see-also) * [Login & Download Updates (Pro)](/doc/unity/login-and-download-updates-pro/) — Managing licenses from within Unity * [Installation](/doc/unity/basics/installation/) — Installing realvirtual packages # AGX Physics > Hight quality physics simulation Caution AGX Dynamics for Unity is not part of the realvirtual.io delivery installation itself. AGX Dynamics for Unity is sold and distributed by [Algoryx](https://www.algoryx.se/). As of realvirtual.io 2021.02, realvirtual.io also supports [AGX Dynamics for Unity](https://www.algoryx.se/agx-unity/). AGX is a commercial and optional high quality physics simulation that can simulate complex dynamics. AGX Dynamics for Unity completely replaces the built-in game physics in Unity and allows you to use real physics, measure real forces and expect realistic results. For more information, please visit the [AGX Dynamics Website](https://www.algoryx.se/agx-unity/). [](/doc/unity/assets/algoryx.mp4) Multi contact points on conveyor example based on AGX [Flexible cables and parts based on AGX physics engine](https://www.youtube-nocookie.com/embed/ZGntCy16Wlk) Flexible cables and parts based on AGX physics engine With AGX it is possible to simulate processes in engineering quality. The main advantage is that it is possible to measure real forces and detect multiple contact points between bodies. This allows, for example, very detailed conveyor simulations, where it is also possible to simulate the behavior when a part is on several different conveyors at the same time. ## Installation [Section titled “Installation”](#installation) To use AGX Dynamics for Unity together with realvirtual.io you also need to install the AGX Dynamics for Unity plugin. Please check the AGX documenation for more informationon about the installation: > A license key is needed for using AGX Dynamics for Unity. Please check the [AGX Dynamics Website](https://www.algoryx.se/agx-unity/) for more information regarding trial and licensing of AGX. After installation of the AGX Unity plugin you need to activate it by selecting `File > Build Settings > Player > Script Compilation`.\ Here you need to add the Scripting Define Symbol `REALVIRTUAL_AGX` ![](/doc/unity/assets/agx-compilerdefines.png) Scripting Define symbol for AGX Physics engine ## realvirtual.io AGX support [Section titled “realvirtual.io AGX support”](#realvirtualio-agx-support) Realvirtual.io does not automatically add AGX physics components to Gameobjects, as is sometimes the case with standard realvirtual.io components. You must add all the required AGX components manually, as described below. Note AGX and Unity Physics run in parallel in a scene. It is possible to simulate some parts of the scene with Unity PhysX and other parts with the AGX engine but you are not allowed to put an AGX and a Unity RigidBody in parallel on one Gameobject. ### Source and MU [Section titled “Source and MU”](#source-and-mu) To enable the AGX within the source `Use AGX Physics` needs to be turned on in the source. Note If the AGX specific properties like `Use AGX Physics` are not visible within the Source please check if the `GAME4AUTOMAION_AGX`compiler define is added to the Player settings like described above. \\ ![](/doc/unity/assets/agx-sourceenable%20\(1\).png) Use AGX in Source Additionally all MUs need to have a `AGX Shape Collider` (e.g. a Box Collider) and a AGX `RigidBody` added to it. Please check the AGX Unity Plugin documentation () for more information about these components. ![](/doc/unity/assets/agx-sourcecomponents%20\(1\).png) AGX Collider and Rigidbody on Sourc ### Drive [Section titled “Drive”](#drive) realvirtual.io [Drives ](/doc/unity/extensions/agx-physics/#drive)can move mechanical axes. Axes are defined within AGX by `Contraint` for example with the Type `Hinge`. It is necessary to turn on the `Lock` Controller within the constraint. The Drive itself needs to be turned to `Virtual` (because the direction is defined by the AGX Constraint itself). ![](/doc/unity/assets/agx-drive.png) Drive with AGX physics ### Transportsurface [Section titled “Transportsurface”](#transportsurface) Conveyors are modeled within realvirtual.io with [Drives](https://game4automation.com/documentation/current/drive.html) connected to [Transportsurfaces](https://game4automation.com/documentation/current/transportsurface.html). This remains the same. On the [TransportSurface ](/doc/unity/extensions/agx-physics/#transportsurface)`Use AGX Physics` needs to be turned on: \\ ![](/doc/unity/assets/agx-transportsurface.png) Transportsurface with AGX physics The main advantage of the AGX Transportsurface is, that one [MU ](/doc/unity/components-and-scripts/mu-movable-unit/)can touch multiple Transportsurfaces and the resulting movement of the MU is calculated exactly. With the Unity PhysX engine only one contact point is calculated, what means that an [MU ](/doc/unity/components-and-scripts/mu-movable-unit/)never touches multiple Transportsurface, which is a disadvantage for very detailed simulations. ### Sink [Section titled “Sink”](#sink) Sinks must detect the parts to be destroyed. Use `AGX Physics` must be enabled and an AGX Box Collider must be added to the sink. ![](/doc/unity/assets/agx-sink.png) Sink with AGX physics ### Sensors [Section titled “Sensors”](#sensors) You can also use Raycast-based sensors with AGX physics. It is necessary to add a standard Unity Collider to your MUs on the layer `g4a SensorMU`. ![](/doc/unity/assets/agx-sensor.png) Caution Do not add a RigidBody to your MUs as this would violate the AGX Physics Engine. Please make sure that raycasts are used in all sensors that need to detect AGX based MUs. realvirtual.io collider based sensors are not possible in combination with AGX Physics Engine.\ \ The sensor raycast setting (see also [Sensor](https://game4automation.com/documentation/current/sensor.html)).\\ ![](/doc/unity/assets/agx-sensorraycast.png) Use raycast based sensors with AGX Physics engine © 2025 realvirtual GmbH [https://realvirtual.io](https://realvirtual.io/) - All rights reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or by any means, including printing, saving, photocopying, recording, or other electronic or mechanical methods, without the prior written permission of the publisher. # realvirtual.io MCP Server Give AI agents full control over your Unity Editor — scenes, GameObjects, components, simulation, digital twins, and more. ![](/doc/unity/assets/mcp-overview.png) MCP Server running in Unity with 91 tools available for AI agents ## Overview [Section titled “Overview”](#overview) The realvirtual MCP Server is a free, open-source Unity package that implements the [Model Context Protocol (MCP)](https://modelcontextprotocol.io). It lets AI agents like **Claude**, **Cursor**, or any MCP-compatible client interact with Unity in real time. The package works with **any Unity project** — including industrial digital twins, robotics simulation, and virtual commissioning. ### How It Works [Section titled “How It Works”](#how-it-works) ```plaintext AI Agent (Claude Desktop / Claude Code / Cursor) | | MCP Protocol (stdio or SSE) v Python MCP Server | | WebSocket (JSON, Port 18711) v Unity Package (C# WebSocket server + tool registry) ``` The package runs a WebSocket server inside the Unity Editor. When an AI agent sends a tool call, the Python MCP server forwards it over WebSocket to Unity, which executes it on the main thread and returns the result. ### Key Features [Section titled “Key Features”](#key-features) * **Works with any Unity project** — Not tied to a specific framework or asset * **Zero Python knowledge needed** — Define tools in C#, the language you’re already using * **Auto-discovery** — Tools are found via reflection, no manual registration * **90+ built-in tools** — Scene, GameObjects, components, transforms, simulation, screenshots, and more * **Extensible in minutes** — Add `[McpTool]` to any static method and it’s available to AI agents * **Self-contained** — Ships with embedded Python 3.12, no system Python required * **One-click setup** — Download Python server and configure Claude from the Unity toolbar * **Survives domain reloads** — Auto-reconnects after Unity recompiles scripts * **Multi-instance support** — Run multiple Unity instances, each with its own MCP server ### Digital Twin Tools with realvirtual [Section titled “Digital Twin Tools with realvirtual”](#digital-twin-tools-with-realvirtual) When combined with the [realvirtual](https://realvirtual.io) framework, you get additional MCP tools purpose-built for industrial digital twins and virtual commissioning: * **Drives** — Control motors, actuators, conveyors * **Sensors** — Read industrial sensors * **PLC Signals** — Read/write PLC I/O * **Robot IK** — Inverse kinematics control This enables AI agents to operate complete virtual factory simulations — move robots, control conveyors, read sensors, and interact with PLC programs in real time. ### Toolbar Status [Section titled “Toolbar Status”](#toolbar-status) The toolbar brain icon shows connection state: | Color | Meaning | | ------ | ------------------------------------ | | Gray | Server stopped | | Yellow | Server running, no clients connected | | Green | Client(s) connected | The activity label next to it shows the currently executing tool call with elapsed time. ## Links [Section titled “Links”](#links) * **GitHub (Unity Package):** [github.com/game4automation/io.realvirtual.mcp](https://github.com/game4automation/io.realvirtual.mcp) * **GitHub (Python Server):** [github.com/game4automation/realvirtual-MCP](https://github.com/game4automation/realvirtual-MCP) * **License:** MIT Note This package is provided as-is. For commercial customers of [realvirtual](https://realvirtual.io), we offer professional services for digital twin development, virtual commissioning, and AI agent integration. # Built-in Tools The MCP Server includes 90+ tools organized by category. All tools are available to any MCP-compatible AI agent. ![](/doc/unity/assets/mcp-tools-detail.png) Tools panel showing available MCP tools with parameter descriptions ## General Unity Tools [Section titled “General Unity Tools”](#general-unity-tools) These tools work with any Unity project: ### Simulation [Section titled “Simulation”](#simulation) | Tool | Description | | --------------- | ---------------------------- | | `sim_play` | Start simulation | | `sim_stop` | Stop simulation | | `sim_pause` | Pause simulation | | `sim_resume` | Resume simulation | | `sim_status` | Get current simulation state | | `sim_set_speed` | Set simulation speed | | `sim_reset` | Reset simulation | ### Scene [Section titled “Scene”](#scene) | Tool | Description | | ---------------------- | ------------------------------- | | `scene_hierarchy` | Get full scene hierarchy | | `scene_find` | Find GameObjects by name | | `scene_get_info` | Get active scene info | | `scene_get_transform` | Get GameObject transform | | `scene_get_components` | Get GameObject components | | `scene_new` | Create new empty scene | | `scene_list` | List all scene files in project | ### GameObjects [Section titled “GameObjects”](#gameobjects) | Tool | Description | | ------------------------------ | --------------------------------------- | | `game_object_create` | Create a new empty GameObject | | `game_object_create_primitive` | Create a primitive (Cube, Sphere, etc.) | | `game_object_destroy` | Destroy a GameObject | | `game_object_duplicate` | Duplicate a GameObject | | `game_object_rename` | Rename a GameObject | | `game_object_set_active` | Set active/inactive | | `game_object_get_info` | Get GameObject info | | `game_object_set_layer` | Set layer by name | | `game_object_set_tag` | Set tag | ### Components [Section titled “Components”](#components) | Tool | Description | | ------------------- | ------------------------------------- | | `component_get` | Get component properties | | `component_set` | Set component properties | | `component_get_all` | Get all components on GameObject | | `component_set_all` | Set properties on multiple components | | `component_add` | Add component by type name | | `component_remove` | Remove component by type name | ### Transforms [Section titled “Transforms”](#transforms) | Tool | Description | | ------------------------ | ------------------------------ | | `transform_set_position` | Set position | | `transform_set_rotation` | Set rotation | | `transform_set_scale` | Set scale | | `transform_set_parent` | Set parent | | `transform_translate` | Translate a GameObject | | `transform_look_at` | Make GameObject look at target | ### Materials [Section titled “Materials”](#materials) | Tool | Description | | ---------------------- | ----------------------------- | | `material_set_color` | Set material color | | `material_get_color` | Get material color | | `renderer_set_enabled` | Set renderer enabled/disabled | ### Physics [Section titled “Physics”](#physics) | Tool | Description | | -------------------------- | -------------------- | | `physics_add_rigidbody` | Add Rigidbody | | `physics_add_collider` | Add Collider | | `physics_remove_rigidbody` | Remove Rigidbody | | `physics_remove_colliders` | Remove all Colliders | ### Prefabs [Section titled “Prefabs”](#prefabs) | Tool | Description | | -------------------- | ----------------------------- | | `prefab_instantiate` | Instantiate a prefab | | `prefab_find` | Find prefabs by name | | `prefab_open` | Open prefab for editing | | `prefab_save` | Save current prefab | | `prefab_close` | Close prefab editor | | `prefab_stage` | Get current prefab stage info | ### Editor [Section titled “Editor”](#editor) | Tool | Description | | ----------------------- | ------------------------------ | | `editor_save_scene` | Save current scene | | `editor_undo` | Undo last operation | | `editor_select` | Select GameObject in hierarchy | | `editor_open_scene` | Open scene by path | | `editor_focus` | Focus camera on GameObject | | `editor_execute_menu` | Execute Unity menu item | | `editor_invoke_method` | Invoke a static method | | `editor_read_log` | Read console log | | `editor_write_log` | Write to console log | | `editor_clear_log` | Clear console log | | `editor_recompile` | Recompile scripts | | `editor_refresh_assets` | Refresh assets | | `editor_get_status` | Get editor status | | `editor_wait_ready` | Wait until editor is ready | ### Screenshots [Section titled “Screenshots”](#screenshots) | Tool | Description | | ------------------- | -------------------------------- | | `screenshot_editor` | Capture editor window screenshot | | `screenshot_game` | Capture game view from camera | | `screenshot_scene` | Capture scene view screenshot | ## realvirtual Digital Twin Tools [Section titled “realvirtual Digital Twin Tools”](#realvirtual-digital-twin-tools) When used with the [realvirtual](https://realvirtual.io) framework, additional tools are available for industrial automation: Note The realvirtual digital twin tools will be available with the upcoming **realvirtual 6.3 LTS** release. ### Drives [Section titled “Drives”](#drives) | Tool | Description | | -------------------- | ------------------------ | | `drive_list` | List all drives in scene | | `drive_to` | Drive to target position | | `drive_jog_forward` | Jog drive forward | | `drive_jog_backward` | Jog drive backward | | `drive_stop` | Stop drive | | `drive_set_speed` | Set drive speed | ### Sensors [Section titled “Sensors”](#sensors) | Tool | Description | | --------------------- | --------------------------- | | `sensor_list` | List all sensors in scene | | `sensor_get` | Get sensor state | | `sensor_get_occupied` | Check if sensor is occupied | ### PLC Signals [Section titled “PLC Signals”](#plc-signals) | Tool | Description | | ------------------ | ------------------ | | `signal_list` | List all signals | | `signal_set_bool` | Set boolean signal | | `signal_set_int` | Set integer signal | | `signal_set_float` | Set float signal | ### Robot IK [Section titled “Robot IK”](#robot-ik) | Tool | Description | | ----------------- | ---------------------------- | | `ik_get_state` | Get robot IK state | | `ik_solve_target` | Solve IK for target position | | `ik_verify_fk` | Verify forward kinematics | # Creating Custom Tools You can extend the MCP Server with your own tools by adding a simple attribute to any C# method. No Python changes, no server restart, no tool registration — just recompile in Unity and the AI agent sees your new tool. ## Basic Example [Section titled “Basic Example”](#basic-example) ```csharp using realvirtual.MCP; public static class MyTools { [McpTool("Get current time")] public static string GetTime() { return $"{{\"time\":\"{System.DateTime.Now}\"}}"; } [McpTool("Add two numbers")] public static string Add( [McpParam("First number")] float a, [McpParam("Second number")] float b) { return $"{{\"result\":{a + b}}}"; } } ``` That’s it. After recompilation, `get_time` and `add` are available to any connected AI agent. ## Attributes [Section titled “Attributes”](#attributes) ### McpTool [Section titled “McpTool”](#mcptool) Add `[McpTool("description")]` to any public static method that returns a string. The description tells the AI agent what the tool does. ```csharp [McpTool("Spawn an enemy at position")] public static string SpawnEnemy( [McpParam("Prefab name")] string prefab, [McpParam("X position")] float x, [McpParam("Z position")] float z) { // Your Unity code here - runs on main thread return ToolHelpers.Ok("Enemy spawned"); } ``` ### McpParam [Section titled “McpParam”](#mcpparam) Add `[McpParam("description")]` to parameters to give the AI agent context about what values to provide. Optional parameters need default values. ```csharp [McpTool("Set weather")] public static string SetWeather( [McpParam("Weather type: sunny, rainy, cloudy")] string weather, [McpParam("Wind speed in m/s")] float windSpeed = 0f) { // windSpeed is optional, defaults to 0 return ToolHelpers.Ok($"Weather set to {weather}"); } ``` ## Rules [Section titled “Rules”](#rules) * Method must be `public static` and return `string` (JSON) * Tool names auto-convert from PascalCase to snake\_case (`SpawnEnemy` → `spawn_enemy`) * Methods can be in any class, in any assembly — they are found via reflection * All tool methods run on Unity’s main thread * Return JSON strings — use `ToolHelpers.Ok()` and `ToolHelpers.Error()` for standard responses ## Helper Utilities [Section titled “Helper Utilities”](#helper-utilities) The `ToolHelpers` class provides common patterns: ```csharp // Find a GameObject by hierarchy path var go = ToolHelpers.FindGameObject("Robot/Arm/Gripper"); // Return success return ToolHelpers.Ok("Operation completed"); // Return success with data return ToolHelpers.Ok(new { position = transform.position }); // Return error return ToolHelpers.Error("GameObject not found"); ``` ## Example: Custom Sensor Tool [Section titled “Example: Custom Sensor Tool”](#example-custom-sensor-tool) ```csharp using realvirtual.MCP; using UnityEngine; public static class FactoryTools { [McpTool("Get temperature from all sensors in the factory")] public static string GetTemperatures() { var sensors = Object.FindObjectsByType( FindObjectsSortMode.None); var results = sensors.Select(s => new { name = s.gameObject.name, temperature = s.CurrentTemperature, unit = "celsius" }).ToArray(); return JsonUtility.ToJson(new { sensors = results }); } } ``` After recompiling, the AI agent can call `get_temperatures` and receive structured data about all temperature sensors in the scene. # Installation & Setup ## Requirements [Section titled “Requirements”](#requirements) * **Unity 6000.0+** (Unity 6) * **Newtonsoft JSON** (`com.unity.nuget.newtonsoft-json`) — installed automatically as dependency * **git** must be installed and available in PATH — [git-scm.com](https://git-scm.com) ## Installation [Section titled “Installation”](#installation) ### Via Unity Asset Store (Recommended) [Section titled “Via Unity Asset Store (Recommended)”](#via-unity-asset-store-recommended) Install directly from the Unity Asset Store: [**realvirtual MCP Server on Unity Asset Store**](https://assetstore.unity.com/preview/361912/1260684) ### Via Unity Package Manager (Git URL) [Section titled “Via Unity Package Manager (Git URL)”](#via-unity-package-manager-git-url) 1. Open Unity **Window > Package Manager** 2. Click **+ > Add package from git URL** 3. Enter: `https://github.com/game4automation/io.realvirtual.mcp.git` Both methods install the package with all dependencies automatically. ## Setup [Section titled “Setup”](#setup) ### Automated Setup (Recommended) [Section titled “Automated Setup (Recommended)”](#automated-setup-recommended) After installing the package: 1. A **brain icon** appears in the Unity Scene View toolbar — this is the MCP status indicator 2. Click the **gear icon** next to it to open the setup popup 3. Click **Download Python Server** — this runs `git clone` to download the Python server into `Assets/StreamingAssets/realvirtual-MCP/` 4. Click **Configure Claude Code & Desktop** — this writes the MCP configuration to Claude Desktop and/or Claude Code ![](/doc/unity/assets/mcp-setup.png) Setup popup showing initial state with Python server not yet installed Once configured, the popup shows green status indicators: ![](/doc/unity/assets/mcp-configured.png) Setup popup after successful configuration You can also access setup via the Unity menu: **Tools > realvirtual > MCP** ![](/doc/unity/assets/mcp-menu.png) MCP menu in Unity Editor ### Manual Setup [Section titled “Manual Setup”](#manual-setup) If you prefer to set up manually: 1. Clone the Python server repository: ```bash cd /Assets/StreamingAssets git clone https://github.com/game4automation/realvirtual-MCP.git ``` 2. Configure your MCP client manually. For Claude Code, add to your MCP settings: ```json { "mcpServers": { "realvirtual-unity": { "command": "/Assets/StreamingAssets/realvirtual-MCP/python/python.exe", "args": ["/Assets/StreamingAssets/realvirtual-MCP/unity_mcp_server.py"] } } } ``` ## Command Line Options [Section titled “Command Line Options”](#command-line-options) The Python server takes a few optional flags. The one worth knowing about: | Flag | Effect | | ---------------- | ----------------------------------------------------------------------------------------------------- | | `--webviewer` | Starts the historic `web_*` WebSocket proxy on port 18712. **Off by default** since MCP server 1.1.2. | | `--no-webviewer` | Accepted and ignored — it was the way to switch the proxy off while it was still on by default. | The `web_*` browser tools of realvirtual WEB belong to **realvirtual CONNECT** (`http://localhost:5100/mcp`), which serves them behind its community registration. The proxy in this server offered the same tool names without any registration check, so it no longer starts on its own. The Unity Editor tools of this server are unaffected and need no registration. ## Updating [Section titled “Updating”](#updating) Caution An already installed Python server does **not** update itself — the downloader skips a directory that is already there. After updating the Unity package, click **Update Python Server (git pull)** once, or the server keeps running the version you downloaded first. ### Python Server [Section titled “Python Server”](#python-server) Click **Update Python Server (git pull)** in the toolbar popup, or run manually: ```bash cd /Assets/StreamingAssets/realvirtual-MCP git pull ``` ### Unity Package [Section titled “Unity Package”](#unity-package) 1. Open **Window > Package Manager** 2. Select **realvirtual MCP Server** 3. Click **Update** (if available) If no update button appears, remove the lock entry for `io.realvirtual.mcp` from `Packages/packages-lock.json` and reopen Unity. # Troubleshooting ## Server Not Starting [Section titled “Server Not Starting”](#server-not-starting) * Check the Unity Console for `[MCP]` log entries * Ensure port 18711 is not blocked by a firewall or another application * Toggle **Debug** mode via the toolbar popup for verbose logging * Try clicking **Restart Python Server** in the setup popup ## Tools Not Discovered [Section titled “Tools Not Discovered”](#tools-not-discovered) * Ensure methods are `public static string` with the `[McpTool]` attribute * Check for compile errors in the Unity Console — tools are only registered after successful compilation * Click **Refresh** in the toolbar popup to force re-discovery * Verify the tool class is in an assembly that references `realvirtual.MCP` ## Connection Issues [Section titled “Connection Issues”](#connection-issues) * The brain icon should be **green** when a client is connected * **Yellow** means the server is running but no client has connected yet * Check that your MCP client configuration points to the correct Python server path * Ensure **git** is installed and available in PATH ## Timeouts During Play Mode [Section titled “Timeouts During Play Mode”](#timeouts-during-play-mode) * Unity throttles editor updates during play mode — tool calls may be slower * `component_set` operations may not work during play mode * `component_get` can timeout if the Unity main thread is busy with simulation * Consider stopping simulation before performing editor operations ## Python Server Issues [Section titled “Python Server Issues”](#python-server-issues) * Click **Update Python Server (git pull)** to get the latest version * Click **Open MCP Folder** to inspect the Python server files * The Python server includes an embedded Python 3.12 runtime — no system Python is required * Check the Python server console output for connection errors ## Port Conflicts [Section titled “Port Conflicts”](#port-conflicts) The MCP Server uses port 18711 by default. If the port is busy, it auto-increments to find a free port. The actual port is shown in the toolbar popup. Ensure your MCP client configuration matches the displayed port. ## Multi-Instance Setup [Section titled “Multi-Instance Setup”](#multi-instance-setup) Each Unity instance gets a unique instance hash (shown as `#xxxxxxxx` in the toolbar). When running multiple Unity projects simultaneously, each instance runs its own MCP server on a different port. The Python server uses the instance hash to connect to the correct Unity instance. # ModelZoo > Free prepared demonstration and demo szenes The **realvirtual.io ModelZoo** is a curated collection of ready-to-use simulation models for training, testing, and demonstration. Each model is built to highlight specific capabilities of the realvirtual.io platform — from fully simulated demo scenes to advanced virtual commissioning setups with real PLC and robot controller integration. 🔗 [Modelzoo Download](https://realvirtual.io/modelzoo/) All models are delivered as standalone `.exe` applications and can be used **without a license**. Whether you’re learning PLC programming, testing robot communication, or evaluating automation workflows, the ModelZoo provides a fast, hands-on way to explore realvirtual.io in action. > ℹ️ **Note:** For models requiring PLC or robot controller integration, please refer to the individual documentation pages for setup instructions and prerequisites.\ > Pure simulation scenes that do not require special hardware or connections are **not documented** here. ![](/doc/unity/assets/image%20\(1\)%20\(1\)%20\(1\)%20\(1\)%20\(1\).png) Modelzoo scene selection ## Basic Controls [Section titled “Basic Controls”](#basic-controls) The following controls apply to all **ModelZoo** scenes: * **Rotate / Zoom / Pan** using the **middle and right mouse buttons** * Press **ESC** to close the current scene and return to the **scene selection menu** * Press **F** to **focus the camera** on the current scene if you’re lost in 3D space For more UI features and shortcuts, check out the [Runtime UI Documentation](/doc/unity/basics/runtime-ui/). ## Virtual Commissioning Interface Setup [Section titled “Virtual Commissioning Interface Setup”](#virtual-commissioning-interface-setup) For all **virtual commissioning** models, the communication interface (such as IP address, port, or NetID) must be configured before connecting. To do this: * Click the **⚙️ Settings** icon in the **top menu bar** * Enter the required connection parameters for your target system * All models start in **“Non Connected”** mode by default * After entering the parameters, click the **🔌 Connect switch** (represented by two plugs) If the switch turns **green**, the connection is successfully established. > Note: In some interfaces, the connection status may fluctuate briefly, and the simulation may experience short lags during connection or reconnection.\ > \ > After setting the interface properties once they are saved and on the next scene start they will be the same. For detailed setup instructions, refer to the individual model documentation. ## Log Window [Section titled “Log Window”](#log-window) Most scenes in the **ModelZoo** include a built-in **Log Window** at the bottom of the screen. ![](/doc/unity/assets/image%20\(1\)%20\(1\)%20\(1\)%20\(1\).png) Log Window You can open it by clicking the small **icons in the lower-left corner** of the screen. The log window allows you to: * View messages about the **current version** and **scene status** * Monitor **connection feedback** and warnings * Enter **special commands** to control simulation behavior Type `help` in the input field to see a full list of available commands. One especially useful command is: * `HideInfo` – Hides the info box that appears at the start of the scene This tool is particularly valuable for setup verification, debugging, and customizing your simulation experience. # Beckhoff TwinCAT > Demonstration cell including full TwinCAT3 project ## Introduction [Section titled “Introduction”](#introduction) This scene is a virtual commissioning setup for testing and validation with real or virtual Beckhoff PLCs programmed using TwinCAT. The PLC controls the process flow, including starting the robot, while the robot controller is fully simulated. It enables safe and flexible testing of automation logic without the need for real hardware. For prerequisites and setup instructions, please visit . This document lists all signals exchanged between **realvirtual** (Unity) and a Beckhoff TwinCAT PLC for controlling the TwinCAT Demo, following the convention that **`IO.Input`** = PLC Input (from realvirtual) and **`IO.Output`** = PLC Output (from PLC). The tables below map each signal to its purpose in the modelzoo simulation. ## Prerequisites [Section titled “Prerequisites”](#prerequisites) To use the Beckhoff ModelZoo scene, you will need an installation of **Beckhoff TwinCAT 3** (recommended version: 3.1.x or higher). You can connect either a **real PLC** or use the **local TwinCAT PLC runtime (PLCSim)** on your PC. For communication with the PLC, **TwinCAT 3 ADS** (usually part of a full TwinCAT3 installation) must be installed on the **same PC where the realvirtual.io ModelZoo is running**. Make sure TwinCAT is in **Run mode**, and that the correct **AMS NetID** and **port** are configured in the simulation settings. We provide a complete TwinCAT project for this scene, which can be imported and compiled directly in the TwinCAT environment. ## Ready-to-Run Beckhoff Project [Section titled “Ready-to-Run Beckhoff Project”](#ready-to-run-beckhoff-project) For this ModelZoo scene, we provide a complete **Beckhoff TwinCAT project**.\ You can import, compile, and run it directly within the TwinCAT environment to control the simulation seamlessly. 📎 [UnityDemoszene.tnzip](/doc/unity/assets/UnityDemoszene.tnzip) ## Interface Configuration [Section titled “Interface Configuration”](#interface-configuration) Before connecting to a Beckhoff PLC, you need to configure the **NetID** and **Port** used for communication. To do this: 1. Click the **Settings** icon (⚙️) in the toolbar. 2. Enter your **TwinCATInterface.NetId** and **TwinCATInterface.Port** as shown in the image below. 3. Make sure the values match your TwinCAT runtime setup. > 📘 Refer to the official Beckhoff documentation for details on how to find or configure your **NetID** and **Port**. ![](/doc/unity/assets/image%20\(2\).png) ## Signals [Section titled “Signals”](#signals) ### 1. Robot Signals [Section titled “1. Robot Signals”](#1-robot-signals) #### 1.1 Robot Overall Status [Section titled “1.1 Robot Overall Status”](#11-robot-overall-status) These signals tell the PLC whether the robot is in a loading or unloading state, as determined by the realvirtual simulation. | **Signal** | **Type** | **Direction** | **Description** | | --------------------------------- | -------- | ---------------------- | ------------------------------------------------------ | | `IO.Input.Robot.bStatusLoading` | `BOOL` | realvirtual → PLC (In) | Indicates that the robot is currently loading a part | | `IO.Input.Robot.bStatusUnloading` | `BOOL` | realvirtual → PLC (In) | Indicates that the robot is currently unloading a part | #### 1.2 Start Robot Programs [Section titled “1.2 Start Robot Programs”](#12-start-robot-programs) These signals come **from** the PLC and are used **by** realvirtual to trigger robot actions in the simulation. | **Signal** | **Type** | **Direction** | **Description** | | --------------------------------- | -------- | ----------------------- | ----------------------------------------------------------- | | `IO.Output.Robot.bStartLoading` | `BOOL` | PLC → realvirtual (Out) | When set by the PLC, requests the robot to start loading. | | `IO.Output.Robot.bStartUnloading` | `BOOL` | PLC → realvirtual (Out) | When set by the PLC, requests the robot to start unloading. | *** ### 2. Machine Signals [Section titled “2. Machine Signals”](#2-machine-signals) These signals handle the interaction between the simulated machine (e.g., a milling station) and the PLC. | **Signal** | **Type** | **Direction** | **Description** | | ------------------------------------- | -------- | ----------------------- | -------------------------------------------------------------------- | | `IO.Output.Machine.bStart` | `BOOL` | PLC → realvirtual (Out) | When set by the PLC, starts the machine operation in the simulation. | | `IO.Input.Machine.bMachining` | `BOOL` | realvirtual → PLC (In) | Tells the PLC that the machine is currently machining | | `IO.Input.Machine.bMachiningFinished` | `BOOL` | realvirtual → PLC (In) | Tells the PLC the machine has finished its operation | | `IO.Input.Machine.bDoorOpen` | `BOOL` | realvirtual → PLC (In) | Indicates the machine door is open in the simulation. | | `IO.Input.Machine.bDoorClosed` | `BOOL` | realvirtual → PLC (In) | Indicates the machine door is closed in the simulation. | *** ### 3. Entry and Exit Conveyor [Section titled “3. Entry and Exit Conveyor”](#3-entry-and-exit-conveyor) #### 3.1 Exit Belt Signals [Section titled “3.1 Exit Belt Signals”](#31-exit-belt-signals) | **Signal** | **Type** | **Direction** | **Description** | | ------------------------------------ | -------- | ----------------------- | ------------------------------------------------------------------------ | | `IO.Output.ExitBelt.Motor.bStart` | `BOOL` | PLC → realvirtual (Out) | PLC requests the simulation to start the exit conveyor motor. | | `IO.Input.ExitBelt.Sensor.bOccupied` | `BOOL` | realvirtual → PLC (In) | Simulation indicates whether the exit belt sensor is triggered/occupied. | #### 3.2 Entry Belt Signals [Section titled “3.2 Entry Belt Signals”](#32-entry-belt-signals) | **Signal** | **Type** | **Direction** | **Description** | | ------------------------------------- | -------- | ----------------------- | ------------------------------------------------------------------------- | | `IO.Output.EntryBelt.Motor.bStart` | `BOOL` | PLC → realvirtual (Out) | PLC requests the to start the entry conveyor motor. | | `IO.Input.EntryBelt.Sensor.bOccupied` | `BOOL` | realvirtual → PLC (In) | Simulation indicates whether the entry belt sensor is triggered/occupied. | *** ### 4. HMI (Buttons & Lights) [Section titled “4. HMI (Buttons & Lights)”](#4-hmi-buttons--lights) These signals correspond to the simulated HMI panel. Some are set by the simulation and read by the PLC (Inputs), while others are set by the PLC and read by the simulation (Outputs). | **Signal** | **Type** | **Direction** | **Description** | | --------------------------------------- | -------- | ----------------------- | ------------------------------------------------------- | | `IO.Input.HMI.OnSwitch.bOn` | `BOOL` | realvirtual → PLC (In) | Simulation indicates the main HMI switch is turned on. | | `IO.Input.HMI.Emergency.bOn` | `BOOL` | realvirtual → PLC (In) | Simulation indicates an emergency button is pressed. | | `IO.Input.HMI.AutomaticButton.bPressed` | `BOOL` | realvirtual → PLC (In) | Simulation indicates an “Automatic” button press event. | | `IO.Output.HMI.AutomaticButton.bLight` | `BOOL` | PLC → realvirtual (Out) | Turns the Lamp of the button on. | | `IO.Input.HMI.Robot.bOn` | `BOOL` | realvirtual → PLC (In) | Simulation indicates the robot button is pressed. | | `IO.Input.HMI.EntryBelt.bOn` | `BOOL` | realvirtual → PLC (In) | Simulation indicates the entry belt button is pressed. | | `IO.Input.HMI.ExitBelt.bOn` | `BOOL` | realvirtual → PLC (In) | Simulation indicates the exit belt button is pressed. | | `IO.Output.HMI.Robot.bLight` | `BOOL` | PLC → realvirtual (Out) | Turns the Lamp of the button on. | | `IO.Output.HMI.EntryBelt.bLight` | `BOOL` | PLC → realvirtual (Out) | Turns the Lamp of the button on. | | `IO.Output.HMI.ExitBelt.bLight` | `BOOL` | PLC → realvirtual (Out) | Turns the Lamp of the button on. | ### 5. TwinCAT Configuration [Section titled “5. TwinCAT Configuration”](#5-twincat-configuration) 1. **Match Each Signal**\ In your TwinCAT PLC project, create variables for every one of the signals listed here. Ensure the variable **names** match exactly (case-sensitive) and the types are all `BOOL` unless otherwise specified. 2. **Map to Physical or Virtual I/O** * If connected to real hardware, map these PLC variables to the corresponding digital inputs/outputs. * For pure simulation, keep them as internal variables in the TwinCAT PLC. 3. **Enable ADS**\ Make sure the AMS Router and ADS settings in TwinCAT are configured so Unity/realvirtual can connect. You will need the **AMS Net ID** and **Port** in your Unity project. 4. **Configure realvirtual** * In Unity, locate the **TwinCATInterface** (or similar script). * Enter the correct ADS settings (Net ID, IP Address, Port). * Assign each of the “IO.Input” and “IO.Output” strings to the matching TwinCAT variable. # Denso Cobotta 1300 > Virtual commissioning of a denso robot in a machining cell The robot in this ModelZoo scene can be controlled via **WincAPS III**.\ Please refer to our [Denso Interface Documentation](/doc/unity/components-and-scripts/interfaces/denso-robotics-pro/) for detailed information about prerequisites and setup. ## Interface Configuration [Section titled “Interface Configuration”](#interface-configuration) To connect the simulation with the DENSO robot (via **WincCAPS III**), you need to configure the IP address and project path. 1. Click the **⚙️ Settings** icon in the top menu bar. 2. Enter the following parameters: | Field | Description | | --------------------------------- | -------------------------------------------------- | | `DensoCobotta1300.ipAdress` | IP address of the robot or virtual controller | | `DensoCobotta1300.WincapsProject` | Full path to your local WincAPS III project folder | ![](/doc/unity/assets/image%20\(1\)%20\(1\)%20\(1\).png) Denso Wincaps Interface configuration ## **Signal Mapping in WincAPS Project** [Section titled “Signal Mapping in WincAPS Project”](#signal-mapping-in-wincaps-project) onfigure the following **I/O signals** in your WincAPS project to enable interaction between the robot and the simulation: | Signal Name | Type | Address | Description | | ------------------ | ------ | ------- | ----------------------------------------------------------------- | | Close Gripper | Output | EA 64 | Command from the robot to close the gripper | | Gripper Closed | Input | EA 48 | Feedback from simulation that the gripper has fully closed | | Load Cell | Input | EA 49 | **Signal from simulation to robot:** start the loading sequence | | Robot Is Loading | Output | EA 65 | **Signal from robot to simulation:** robot has started loading | | Unload Cell | Input | EA 50 | **Signal from simulation to robot:** start the unloading sequence | | Robot Is Unloading | Output | EA 66 | **Signal from robot to simulation:** robot has started unloading | | | | | | These signals provide a handshake between the robot program and the simulation, enabling synchronized operation.\ \ ℹ️ The **PLC logic** controlling the **entry and exit conveyors** is fully simulated inside the scene and does not require an external controller. # Fanuc Roboguide > Fanuc CRX-10iA_L Virtual Commissioning model This page outlines the **requirements** and **signal configuration** for using a ROBOGUIDE workcell with a FANUC CRX-10iA/L robot as part of the **Fanuc ModelZoo**. The setup enables real-time simulation of robot behavior within Unity using **SNPX-based communication**, synchronized with a **simulated PLC-controlled conveyor**. ![](/doc/unity/assets/fanucdemo.png) ### Requirements [Section titled “Requirements”](#requirements) To enable communication between Unity and ROBOGUIDE using **SNPX**, your controller must support the **Robot Interface (RobotIF / SRTP)** protocol. This is configured during the ROBOGUIDE **workcell creation** process. *** #### Enabling SNPX in ROBOGUIDE [Section titled “Enabling SNPX in ROBOGUIDE”](#enabling-snpx-in-roboguide) During **Step 7** (Robot Options) of the Workcell Wizard in ROBOGUIDE, select one of the following configurations: **Option 1: R650 FRA Params** * Select **“FANUC America Corp.”** in the *Advanced* tab * Add robot option: **R553 – HMI Device SNPX** **Option 2: R651 FRL Params** * Select **“FANUC Ltd.”** in the *Advanced* tab * No additional options required #### Network Access [Section titled “Network Access”](#network-access) Ensure the following network conditions are met: * TCP port **60008** (Robot IF Server) is **open and accessible** * The **Unity/realvirtual.io and the ROBOGUIDE controller** must be on the same network or subnet ### Signal Configuration [Section titled “Signal Configuration”](#signal-configuration) The interface between the robot and the simulated environment uses digital signals. These must be properly configured and exposed in both the Unity scene and ROBOGUIDE. #### Outputs (From Robot → robot) [Section titled “Outputs (From Robot → robot)”](#outputs-from-robot--robot) | Signal Name | Type | Description | | ------------------ | ---- | ---------------------------- | | `RobotIsLoading` | DO1 | Robot is loading the cell | | `RobotIsUnloading` | DO2 | Robot is unloading the cell | | `CloseGripper` | DO3 | Command to close the gripper | #### Inputs (From Unity / Conveyor → Robot) [Section titled “Inputs (From Unity / Conveyor → Robot)”](#inputs-from-unity--conveyor--robot) | Signal Name | Type | Description | | ---------------- | ---- | -------------------------------------- | | `StartLoading` | DI1 | Conveyor requests loading of the cell | | `StartUnloading` | DI2 | Machine requests unloading of the cell | | `GripperClosed` | DI3 | Sensor feedback: gripper is closed | Ensure these signals are defined in ROBOGUIDE’s I/O configuration and used in your Fanuc programm. # Siemens S7 Training Model > Complete S7 PLC training environment with full TIA Portal project and realistic industrial demo cell simulation **Master Siemens S7 PLC programming with a complete industrial automation training environment featuring a realistic demo cell and comprehensive TIA Portal project.** This ModelZoo entry provides a complete S7 training experience, combining: * **Complete demo cell simulation** with robot, CNC machine, and conveyor systems * **Full TIA Portal project** (S7-1500 compatible) with structured programming examples * **Real-time PLC communication** via TCP/IP (Put/Get) for authentic industrial experience * **Virtual commissioning setup** compatible with PLCSim Advanced and real S7 hardware ## Demo Cell Overview [Section titled “Demo Cell Overview”](#demo-cell-overview) The training environment simulates a modern manufacturing cell featuring: * **Entry conveyor** with part detection sensors * **6-axis robot** for pick-and-place operations with simulated kinematics * **CNC machining center** with door control and machining simulation * **Exit conveyor** for processed parts * **HMI control panel** with operator interface elements The automation sequence demonstrates typical industrial workflows: part arrival, robot loading, machining operations, robot unloading, and part discharge. All operations are coordinated through the S7 PLC program provided in the complete TIA Portal project. ## Interface Configuration [Section titled “Interface Configuration”](#interface-configuration) Before connecting to a Siemens S7 PLC, you need to configure the IP address, rack, and slot of the controller. ![](/doc/unity/assets/image%20\(1\)%20\(1\)%20\(1\)%20\(1\)%20\(1\)%20\(1\).png) Configuring S7 Settings To configure the connection: 1. Click the **Settings** icon (⚙️) in the toolbar. 2. Enter the following values based on your setup: * **SiemensS7Interface.Address** → The IP address of your PLC (e.g., `127.0.0.1` for PLCSim Advanced). * **SiemensS7Interface.Rack** → Usually `0`. * **SiemensS7Interface.Slot** → Typically `0` for PLCSim Advanced, `1` for physical PLCs. > 📘 Refer to your TIA Portal project or PLC documentation to confirm the correct rack and slot values. ## TIA Portal Project [Section titled “TIA Portal Project”](#tia-portal-project) 📎 [DemoRV6\_20250723\_1551.zap19](/doc/unity/assets/DemoRV6_20250723_1551.zap19) This complete TIA Portal project provides a fully functional S7-1500 program that demonstrates industrial automation best practices: * **Complete S7-1500 CPU configuration** with optimized block access settings * **Structured function blocks** demonstrating professional programming practices * **Comprehensive I/O mapping** for all demo cell components * **Sequence control logic** for coordinated multi-station operation * **Safety interlocks** and emergency stop implementation * **HMI integration** elements for operator interface training This S7 TIA Portal example project is provided by **Andreas Fast** from Fast Automation. Thanks a lot for this valuable contribution to the realvirtual community! 🔗 **Connect with Andreas Fast**: [LinkedIn Profile](https://www.linkedin.com/in/automation-fast-andreas/) ## Signals [Section titled “Signals”](#signals) #### 1.1 Robot Overall Status (Inputs) [Section titled “1.1 Robot Overall Status (Inputs)”](#11-robot-overall-status-inputs) | Address | Signal Name | Direction | Description | | ------- | --------------------------------- | --------- | ----------------------------------- | | `I0.0` | `IO.Input.Robot.bStatusLoading` | Input | Robot is currently loading a part | | `I0.1` | `IO.Input.Robot.bStatusUnloading` | Input | Robot is currently unloading a part | #### 1.2 Start Robot Programs (Outputs) [Section titled “1.2 Start Robot Programs (Outputs)”](#12-start-robot-programs-outputs) | Address | Signal Name | Direction | Description | | ------- | --------------------------------- | --------- | ---------------------------------- | | `Q0.0` | `IO.Output.Robot.bStartLoading` | Output | Start the robot loading sequence | | `Q0.1` | `IO.Output.Robot.bStartUnloading` | Output | Start the robot unloading sequence | *** ### 2. Machine Signals [Section titled “2. Machine Signals”](#2-machine-signals) | Address | Signal Name | Direction | Description | | ------- | ------------------------------------- | --------- | ------------------------------------- | | `Q1.0` | `IO.Output.Machine.bStart` | Output | Start the machine’s machining process | | `Q1.1` | `IO.Output.Machine.bOpenDoor` | Output | Open the machine door | | `I1.0` | `IO.Input.Machine.bMachining` | Input | Machine is currently machining | | `I1.1` | `IO.Input.Machine.bMachiningFinished` | Input | Machining process is finished | | `I1.2` | `IO.Input.Machine.bDoorOpened` | Input | Machine door is open | | `I1.3` | `IO.Input.Machine.bDoorClosed` | Input | Machine door is closed | *** ### 3. Entry and Exit Conveyor [Section titled “3. Entry and Exit Conveyor”](#3-entry-and-exit-conveyor) | Address | Signal Name | Direction | Description | | ------- | ------------------------------------- | --------- | ----------------------------------- | | `Q2.0` | `IO.Output.EntryBelt.Motor.bStart` | Output | Start the entry belt motor | | `Q2.1` | `IO.Output.ExitBelt.Motor.bStart` | Output | Start the exit belt motor | | `I2.0` | `IO.Input.EntryBelt.Sensor.bOccupied` | Input | Entry belt sensor detects an object | | `I2.1` | `IO.Input.ExitBelt.Sensor.bOccupied` | Input | Exit belt sensor detects an object | *** ### 4. HMI (Buttons & Lights) [Section titled “4. HMI (Buttons & Lights)”](#4-hmi-buttons--lights) #### 4.1 Buttons (Inputs) [Section titled “4.1 Buttons (Inputs)”](#41-buttons-inputs) | Address | Signal Name | Direction | Description | | ------- | --------------------------------------- | --------- | ----------------------------- | | `I3.0` | `IO.Input.HMI.OnSwitch.bOn` | Input | HMI main switch is on | | `I3.1` | `IO.Input.HMI.Emergency.bOn` | Input | Emergency stop is activated | | `I3.2` | `IO.Input.HMI.AutomaticButton.bPressed` | Input | Automatic mode button pressed | | `I3.3` | `IO.Input.HMI.EntryBelt.bOn` | Input | Entry belt button is on | | `I3.4` | `IO.Input.HMI.Robot.bOn` | Input | Robot enable button is on | | `I3.5` | `IO.Input.HMI.ExitBelt.bOn` | Input | Exit belt button is on | #### 4.2 Lights (Outputs) [Section titled “4.2 Lights (Outputs)”](#42-lights-outputs) | Address | Signal Name | Direction | Description | | ------- | -------------------------------------- | --------- | ----------------------------------- | | `Q3.0` | `IO.Output.HMI.AutomaticButton.bLight` | Output | Light for the automatic mode button | | `Q3.1` | `IO.Output.HMI.Robot.bLight` | Output | Light indicator for robot status | | `Q3.3` | `IO.Output.HMI.EntryBelt.bLight` | Output | Light indicator for entry belt | | `Q3.4` | `IO.Output.HMI.ExitBelt.bLight` | Output | Light indicator for exit belt | # Universal Robots UR10 In this ModelZoo scene, a **Universal Robots UR10** robot picks up pumpkins from an **entry conveyor** and loads them into **boxes** arriving on an **exit conveyor**. The robot is integrated via the **realvirtual.io Universal Robots Interface** using TCP/IP. ![](/doc/unity/assets/image%20\(1\)%20\(1\).png) Universal Robots modelzoo scene All logic for conveyor control is handled **within the simulation**. The robot must be programmed to react to and control digital I/O signals as listed below. You need to install [URSIM ](/doc/unity/components-and-scripts/interfaces/universal-robots/)as a virtual machine on your computer. ## Interface Configuration [Section titled “Interface Configuration”](#interface-configuration) To establish communication, open the **⚙️ Settings** panel in the top menu bar and enter the **IP address of your URSIM installation**. Make sure: * URSIM is running and reachable at the specified IP address * Network access is allowed (firewall, network access to the virtual machine and routing configured correctly) * The I/O signals match the configuration in your robot program ## Signal Mapping [Section titled “Signal Mapping”](#signal-mapping) **Digital Outputs (Robot → Simulation)** | Signal | Address | Description | | -------------- | ------- | ---------------------------------------- | | `CloseGripper` | DO\[0] | Robot command to close the gripper | | `RobotMoving` | DO\[1] | Robot is currently moving | | `BoxLoaded` | DO\[2] | Robot signals that a box has been loaded | **Digital Inputs (Simulation → Robot)** | Signal | Address | Description | | --------------- | ------- | --------------------------------------------- | | `LoadAvailable` | DI\[0] | Simulation signals a pumpkin is ready to load | | `BoxAvailable` | DI\[1] | Simulation signals a box is in position | # Wandelbots Nova Fanuc CRX This ModelZoo scene demonstrates the integration of a **Wandelbots NOVA** controlled robot in a virtual commissioning environment using **realvirtual.io**. The robot model used in this scene is a **Fanuc CRX-10iA/L**. All PLC logic for the **entry and exit conveyors** is handled **entirely inside the simulation**, so no external PLC is needed. To use this model, make sure you have: * Access to **Wandelbots NOVA** (cloud or local installation) * The robot controller configured for the **Fanuc CRX-10iA/L** ## Interface Configuration [Section titled “Interface Configuration”](#interface-configuration) To connect the simulation with a [**Wandelbots NOVA** ](https://www.wandelbots.com/de)instance, the following parameters must be set. Open the **⚙️ Settings** window in the top menu bar to access these fields: | Field | Description | | ------------------------------------------ | --------------------------------------------------------------------------------- | | `WandelbotsNOVAInterface.WandelbotsServer` | IP address or URL of your Wandelbots NOVA server (e.g. `http://172.28.214.72`) | | `WandelbotsNOVAInterface.MotionGroup` | The motion group identifier for the robot (e.g. `1@fanuc` for a Fanuc CRX-10iA/L) | | `WandelbotsNOVAInterface.Username` | Username for NOVA login | | `WandelbotsNOVAInterface.Password` | Password for NOVA login | | `WandelbotsNOVAInterface.AccessToken` | *Optional:* Only required when connecting to a **cloud-hosted** NOVA instance | After entering your connection data, activate the interface using the **🔌 connect switch** in the menu bar. Once the connection is active, the plug icon will turn green. > 💡 Note: The **Access Token** is not needed for local or offline installations—only for authenticated access to the cloud-based NOVA server. ![](/doc/unity/assets/image%20\(31\).png) Wandelbots NOVA interface configuration ## Signal Mapping [Section titled “Signal Mapping”](#signal-mapping) The following digital signals are used for handshaking between **realvirtual.io** and the **Wandelbots NOVA** robot: ### **Inputs (realvirtual.io → NOVA)** [Section titled “Inputs (realvirtual.io → NOVA)”](#inputs-realvirtualio--nova) | Signal | Type | Description | | ------ | ----- | -------------------------------------- | | `di1` | Input | Load Cell – triggers robot to load | | `di2` | Input | Unload Cell – triggers robot to unload | | `di3` | Input | Gripper Closed – gripper status | ### **Outputs (NOVA → realvirtual.io)** [Section titled “Outputs (NOVA → realvirtual.io)”](#outputs-nova--realvirtualio) | Signal | Type | Description | | ------ | ------ | ------------------------------------------------ | | `do1` | Output | Robot Is Loading – robot has started loading | | `do2` | Output | Robot Is Unloading – robot has started unloading | | `do3` | Output | Close Gripper – command to close gripper | *** #### Robot Programming [Section titled “Robot Programming”](#robot-programming) The robot behavior must be programmed in **Wandelbots NOVA**.\ Use the signal mapping above to define your automation logic and synchronize the robot with the simulation scene. Caution This page is under construction! # realvirtual.io Simulation realvirtual.io Simulation provides elements for creating simulation models of intra-logistic systems. It is an optional add-on module that requires realvirtual.io Starter or Professional as a base. You can obtain realvirtual.io Simulation from the [Unity Asset Store](https://u3d.as/2s8F). It includes elements for physics-based belt and roller conveyors as well as path-based path systems. Combined use of the path-based and physics-based systems is also possible. ![](/doc/unity/assets/g4aSimulationOverview.png) ## Upgrading to realvirtual.io Simulation 2022[](#general-library-structure) [Section titled “Upgrading to realvirtual.io Simulation 2022 ”](#upgrading-to-realvirtualio-simulation-2022) If you upgrade your project from 2021 you shoud follow [Upgrade to 2022](/doc/unity/advanced-topics/upgrade-to-2022/). In some cases there might be a problem with the colliders of the side guides when upgrading. You can launch `Tools > realvirtual > Update Simulation Scene to 2022`for changing all side guides in the current scene to the correct layer (rvTransport). ## General library structure[](#general-library-structure) [Section titled “General library structure ”](#general-library-structure) The library contains separate folders for belt and roller conveyors\ as well as path systems. On the main level there is one demo scene per application area, which contains all essential functions. Components used in both systems are contained in the *Common* folder. ![](/doc/unity/assets/strukturg4aSim.png) ## Physics[](#physics) [Section titled “Physics ”](#physics) The belt and roller conveyor systems are simulated based on physical movements. This means that the goods (Movable Units - MUs) have *Rigidbodies*, *Colliders* and the property *IsKinematic* is set to false. Using physics for conveyor systems produces more natural and realistic movement of goods, and is even faster than trying to do the same with a path-based animation (in our experiments, a path-based conveyor system that does not use Unity Physics has about half the performance). In path systems, no physics is used to move the moving units. Goods are moved along lines and curved paths. This is slower than using physics in terms of the computational power required, but guarantees that, for example, the AGVs stay exactly on the defined paths. In this case, IsKineamtic is set to true and the movement of the elements is performed by the [Path Mover](https://game4automation.com/documentation/current/pathmover.html). ## Installation and first steps [Section titled “Installation and first steps”](#installation-and-first-steps) Please install the realvirtual.io simulation via the Unity Asset Store or via *Assets > Import Package > Custom Package*. Then you can install the simulation library the same way. Note Please install realvirtual.io Starter or Professional first. It is best to have a look at the demo scene of the sorting system directly after the installation. You can find the demo scene at *Assets/realvirtual-Simulation/DemoPathsystem\_UseCases.unity*. Via the [Quick Edit Overlay menu](https://game4automation.com/documentation/current/userinterface.html#Quickedit) you can add components to the simulation model. The Quick Edit Overlay can be shown in scene view by hitting the key F1. ![](/doc/unity/assets/simulation-quickedit.png) Alternatively, the library objects (these are Unity prefabs) can also be placed in the scene simply by dragging and dropping them from the project folder. © 2025 realvirtual GmbH [https://realvirtual.io](https://realvirtual.io/) - All rights reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or by any means, including printing, saving, photocopying, recording, or other electronic or mechanical methods, without the prior written permission of the publisher. # Conveyor Library This library is an extension for realvirtual.io Starter or realvirtual.io Professional. This library can be obtained from the Unity Asset Store or directly from us. To use the Conveyor Library, it is mandatory to install realvirtual.io Starter or realvirtual.io Professional first. Please always use the latest versions of realvirtual.io Starter or Professional with the latest Conveyor Library. The realvirtual.io Conveyor Library is a library of parametric conveyor components. The included library elements can be used to build simulation models of intra-logistics and material flow systems. The transport of goods is physically simulated, i.e. the goods move freely on the conveyor system as in reality and can be transported and moved via physical forces. All included standard components use functions of realvirtual.io Starter or Professional. In particular, the elements of the Conveyor Library are equipped with [drives](https://game4automation.com/documentation/current/drive.html) and [sensors](https://game4automation.com/documentation/current/sensor.html). These can be controlled directly via script for simulation. For virtual commissioning, the simulation model can be connected to industrial controllers using the [automation interfaces](https://game4automation.com/documentation/current/interface.html) of the Starter or Professional version. ![](/doc/unity/assets/conveyorlibrary.png) ## Installation and first steps[](#installation-and-first-steps) [Section titled “Installation and first steps ”](#installation-and-first-steps) Please install the realvirtual.io Starter or Professional version first via the Unity Asset Store or via *Assets > Import Package > Custom Package*. Afterwards you can install the Conveyor Library via the same procedure. It is best to start viewing the demo scene of the sorter system directly after the installation. You can find the demo scene under *Assets/realvirtual-ConveyorLibrary/DemoScenes/SorterSystem.unity*. In addition to the sorter system demo scene, you will also find several smaller demos in the same folder. Using the realvirtual.io menu *Tools > realvirtual > Conveyor Library Window* an additional window can be opened, that provides special functions for the library: ![](/doc/unity/assets/rvsimwindow.png) This window can be used to control all conveyors or to set their default speed. It is also possible to speed up all drives via speed override, while keeping the simulation time. I.e. the drives become physically faster. It is also possible to change the physics timescale, so that the simulation runs faster or slower like in a time lapse. Via *Add Library Objects* the library elements can be placed in the scene. Alternatively, the library objects (these are Unity prefabs) can be placed in the scene simply by dragging and dropping them from the project folder. ## Snapping Objects [Section titled “Snapping Objects”](#snapping-objects) Some of the library components have snap points. The snap points can be used to place the objects together at the appropriate points. ![](/doc/unity/assets/snappoints.png) ## General object structure[](#general-object-structure) [Section titled “General object structure ”](#general-object-structure) All objects have a common structure. As soon as the parameters are changed in the inspector, the object is built automatically. Additional prefabs may be created automatically as subobjects for this purpose. In the standard, some subobjects are hidden in order to obtain a clearer representation. Optionally *Is Editable* can be switched on in all library elements in the inspector. All child elements will then be displayed. For [Sensor](/doc/unity/components-and-scripts/sensors/sensor/), [Drives](/doc/unity/components-and-scripts/motion/drive/), and [Transport Surfaces](/doc/unity/components-and-scripts/motion/transportsurface/) the realvirtual.io standards are used. More information can be found in the general realvirtual.io documentation. ![](/doc/unity/assets/objectstructure.png) ## Library Components[](#library-components) [Section titled “Library Components ”](#library-components) You can find all included Library components in the folder *Assets/game4automation-ConveyorLibrary*. ### Straight Conveyor [Section titled “Straight Conveyor”](#straight-conveyor) The Straight Conveyor can be displayed as either a roller conveyor or a belt conveyor. It features SnapPoints on each end and on the sides. When another conveyor is snapped to the side, the Side Guide will be removed. Each conveyor automatically includes a sensor at the end. Additionally, the conveyor offers a guided transport system along a spline situated in the middle of the transport surface. This feature can be activated by ticking the checkbox “UseGuidedTransport”. When enabled, items will follow a predefined path, ensuring precise and consistent movement along the conveyor. In this mode, Unity physics do not affect the transported object. ![](/doc/unity/assets/straightconveyor.png) Caution Release Simulation 6 for Unity 6 Due to the changes within the Unity Physics Engine decreasing transport isn’t stable. We are actively working on a fix. ### Curved Conveyor[](#curved-conveyor) [Section titled “Curved Conveyor ”](#curved-conveyor) The Curved Conveyor can be displayed as a roller conveyor or belt conveyor. It has SnapPoints on each end. Each conveyor has automatically a sensor at the end. Additionally, the conveyor offers a guided transport system along a spline situated in the middle of the transport surface. This feature can be activated by ticking the checkbox “UseGuidedTransport”. When enabled, items will follow a predefined path, ensuring precise and consistent movement along the conveyor. In this mode, Unity physics do not affect the transported object. ![](/doc/unity/assets/curvedconveyor.png) ### Straight Conveyor Group[](#straight-conveyor-group) [Section titled “Straight Conveyor Group ”](#straight-conveyor-group) The Straight Conveyor Group automatically creates multiple straight conveyors as sub components. The “UseGuidedTransport” option can also be set. ![](/doc/unity/assets/conveyorgroup.png) ### Spiral Conveyor[](#spiral-conveyor) [Section titled “Spiral Conveyor ”](#spiral-conveyor) The Spiral Conveyor displayed as a roller conveyor or belt conveyor. With the attributes “Height Start”, “Height End”, “Radius” and “Number of Turns” you can define the Conveyor. The Spiral Conveyor has snap points at the start and end. Legs are currently not included. ![](/doc/unity/assets/Spiralconveyor.png) Caution Release Simulation 6 for Unity 6 Due to the changes within the Unity Physics Engine decreasing transport isn’t stable. We are actively working on a fix. ### Crossbelt Sorter[](#crossbelt-sorter) [Section titled “Crossbelt Sorter ”](#crossbelt-sorter) The Crossbelt Sorter uses the [chain component ](/doc/unity/components-and-scripts/motion/chain-element/)to determine the transport way. You can use a spline or a simulation path to define the loop form. As a Crossbelt element you can use the pre-defined one from the demo scene or define your own Prefab. Your Prefab requires a user script which uses the interface “IChainElement”. ![](/doc/unity/assets/crossbeltconveyor.png) ### Shoe Sorter[](#shoe-sorter) [Section titled “Shoe Sorter ”](#shoe-sorter) The Shoe Sorter works with a belt conveyor and has all main attributs of the conveyor class. To depict the shoes, there is currently one prefab. The required junction will defined within the junction list. The junction of the back loop will be set automatically. The Junction also establish a snap point at the opposite side when it is created. Thus, it facilitates the linkage with other conveyors. If your shoe sorter runs at high speeds (e.g., 3000 mm/s), reduce the fixed timestep in **Project Settings > Time** to ensure proper shoe detection. ![](/doc/unity/assets/shoesorter.png) ### Aligner[](#aligner) [Section titled “Aligner ”](#aligner) The aligner is able to align the MUs (movable unity) with the pivot point of the Aligner. Additionally it is possible to add rotational or linear forces to the MU. ![](/doc/unity/assets/aligner.png) ### Chain Transfer[](#chain-transfer) [Section titled “Chain Transfer ”](#chain-transfer) The chain transfer is a chain which can lift MUs (Movable Units) and transport them to the side. The chain transfer has two drives included. One for lifting and one for transporting the goods. ![](/doc/unity/assets/chaintransfer.png) ### Guide Rolls[](#guide-rolls) [Section titled “Guide Rolls ”](#guide-rolls) The Guide Rolls can be places onto a conveyor. They are pushing the goods into a certain direction with a certain speed. Two drives are included. One for turning the rolls and another for selecting the direction. ![](/doc/unity/assets/guiderolls.png) ### Sensor[](#sensor) [Section titled “Sensor ”](#sensor) The sensor is based on the standard realvirtual.io[ Sensor](/doc/unity/components-and-scripts/sensors/sensor/). Additionaly it has some parameters specially for conveyor systems and can be places separately or as a sub component on conveyors. If a sensor is placed as a subcomponent on conveyors it is automatically aligned with the Conveyor direction and position. ![](/doc/unity/assets/sensorconveyor.png) ### Source[](#source) [Section titled “Source ”](#source) The source is based on the standard realvirtual.io[ Source](http://localhost:4000/source.html). Goods with different dimensions and weights can be automatically created. The source is always trying to keep a defined distance between the produced goods. If you want to have a different look of the goods you can create your own source and exchange the included meshes. ![](/doc/unity/assets/conveyorsource.png) ### Sink[](#sink) [Section titled “Sink ”](#sink) The sink is destroying goods which are intersecting with the Sink area, which is a box collider. ![](/doc/unity/assets/conveyorsink.png) ### SourceTote[](#sourcetote) [Section titled “SourceTote ”](#sourcetote) The SourceTote is a second source, just with a different 3d mesh than the standard source. ![](/doc/unity/assets/sourcetote.png) © 2025 realvirtual GmbH [https://realvirtual.io](https://realvirtual.io/) - All rights reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or by any means, including printing, saving, photocopying, recording, or other electronic or mechanical methods, without the prior written permission of the publisher. # Path System The Path System is part of the realvirtual.io simulation. It provides elements to construct different types of path systems based on [curves](https://game4automation.com/documentation/current/curve.html) and [lines](https://game4automation.com/documentation/current/line.html) (like AGVs, Power\&Free). The demo scene *DemoPathsystem\_UseCases* shows some possible use cases. ![](/doc/unity/assets/simulationusedcases.png) Demo realvirtual.io simulation used cases ## Implementing your own Path finding strategies[](#implementing-your-own-path-finding-strategies) [Section titled “Implementing your own Path finding strategies ”](#implementing-your-own-path-finding-strategies) In Path Systems of automation systems very often the material flow strategies are very important for throughput and very often simulation models are build for developing and optimizing these strategies. Our library open and extendable and you can implement your own strategies. Please read the section [Path finding strategy](/doc/unity/extensions/page-4/path-system/path-finding/) for more information about Path finding strategies. ## Snapping Objects [Section titled “Snapping Objects”](#snapping-objects) Elements for building path systems [curves](/doc/unity/extensions/page-4/path-system/curve/) and [lines](/doc/unity/extensions/page-4/path-system/line/) have Snap Points. Snap points allow objects to be placed exactly next to each other at the appropriate points. Note Please note that snap points require *Gizmos* to be enabled. To do this, click *Gizmos* in the upper right corner of the scene. ![](/doc/unity/assets/PathSnapPoints.png) ## Path System Components[](#path-system-components) [Section titled “Path System Components ”](#path-system-components) #### Line [Section titled “Line”](#line) The [line](/doc/unity/extensions/page-4/path-system/line/) moves the MUs along a linear path from start to finish. #### Curves [Section titled “Curves”](#curves) The [curve](/doc/unity/extensions/page-4/path-system/#curves) moves the MUs on a circular path from start to finish. #### Station [Section titled “Station”](#station) The [workstation](/doc/unity/extensions/page-4/path-system/workstation/) stops the MU on a path for a specified time. It can be extended by additional stations (e.g. to a loading or unloading station). #### Catcher [Section titled “Catcher”](#catcher) The [Catcher](/doc/unity/extensions/page-4/path-system/#catcher) catches MUs that are under “physical control” and loads them onto a path. #### PathMover [Section titled “PathMover”](#pathmover) The [Path Mover](/doc/unity/extensions/page-4/path-system/#pathmover) is responsible for moving the [MUs](/doc/unity/components-and-scripts/mu-movable-unit/) along the path. © 2025 realvirtual GmbH [https://realvirtual.io](https://realvirtual.io/) - All rights reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or by any means, including printing, saving, photocopying, recording, or other electronic or mechanical methods, without the prior written permission of the publisher. # Catcher The catcher is transferring [MUs](/doc/unity/components-and-scripts/mu-movable-unit/) from physical transport on conveyors to path based transport on. ![](/doc/unity/assets/pathcatcher.png) #### Public properties and methods[](#public-properties-and-methods) [Section titled “Public properties and methods ”](#public-properties-and-methods) # Curve The Curve is used, together with the [Line](/doc/unity/extensions/page-4/path-system/line/) to model a Path System. The [MUs](/doc/unity/components-and-scripts/mu-movable-unit/) are moved along the Line with the [Path Mover.](/doc/unity/extensions/page-4/path-system/pathmover/) ![](/doc/unity/assets/curveparameter.png) ### Path finding strategy[](#path-finding-strategy) [Section titled “Path finding strategy ”](#path-finding-strategy) Please check page [Path Finding](/doc/unity/extensions/page-4/path-system/path-finding/) for more information about path strategies and implementing your own strategies. ### Curve properties [Section titled “Curve properties”](#curve-properties) **Drive**\ For moving [MUs](/doc/unity/components-and-scripts/mu-movable-unit/) always a [Drive](/doc/unity/components-and-scripts/motion/drive/) is needed. The Drive can be on the [MU](/doc/unity/components-and-scripts/mu-movable-unit/) itself (e.g. for modelling AGVs) or the [Drive](/doc/unity/components-and-scripts/motion/drive/) can be on the Curve or Line itself (e.g. for Power\&Freee systems). If this field is kept empty, a [Drive](/doc/unity/components-and-scripts/motion/drive/) on the [MU](/doc/unity/components-and-scripts/mu-movable-unit/) is needed. **Path Strategy**\ You can assign a component of type *PathStrategy* to the line. Each time a [PathMover](/doc/unity/extensions/page-4/path-system/pathmover/) is leaving the Path the strategy can select a successor. Please check page [Path Finding](/doc/unity/extensions/page-4/path-system/path-finding/) for more information about using custom strategies. If the PathStrategy is empty, automatically the first successor is selected. **Length**\ The lengh of the Curve in meters. This value is calculated and cannot be changed **Show Path On Simulation**\ Must be set to true if path should be visible during simulation. **Thickness**\ The thickness of the path line. **Materialpath**\ The material of the path. **Direction Arrow**\ If true, the Direction arrow will be displayed. **Size Direction Arrow**\ The size of the direction arrow. **Clockwise**\ True if radius should be drawn clockwise. **Radius**\ The radius of the curve. **StartAngle**\ The start angle of the curve. **Degrees**\ The degrees of the curve. ### Path events [Section titled “Path events”](#path-events) A certain behavoir at the entrance or the exit of an path element can be defined within the section path events. Scripts which are connected there will be called during run time. ![](/doc/unity/assets/pathevents.png) © 2025 realvirtual GmbH [https://realvirtual.io](https://realvirtual.io/) - All rights reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or by any means, including printing, saving, photocopying, recording, or other electronic or mechanical methods, without the prior written permission of the publisher. # Line The Line is used to construct line in a Path System. The [MUs](/doc/unity/components-and-scripts/mu-movable-unit/) are moved along the Line with the [Path Mover](/doc/unity/extensions/page-4/path-system/pathmover/) ![](/doc/unity/assets/pathsystem-line.png) ### Path finding strategy[](#path-finding-strategy) [Section titled “Path finding strategy ”](#path-finding-strategy) Please check page [Path Finding](/doc/unity/extensions/page-4/path-system/path-finding/) for more information about path strategies and implementing your own strategies. ### Line properties [Section titled “Line properties”](#line-properties) **Drive**\ For moving [MUs](/doc/unity/components-and-scripts/mu-movable-unit/) always a [Drive](/doc/unity/components-and-scripts/motion/drive/) is needed. The Drive can be on the [MU](/doc/unity/components-and-scripts/mu-movable-unit/) itself (e.g. for modelling AGVs) or the [Drive](/doc/unity/components-and-scripts/motion/drive/) can be on the Curve or Line itself (e.g. for Power\&Freee systems). If this field is kept empty, a [Drive](/doc/unity/components-and-scripts/motion/drive/) on the [MU](/doc/unity/components-and-scripts/mu-movable-unit/) is needed. **Path Strategy**\ You can assign a component of type *PathStrategy* to the line. Each time a [PathMover](/doc/unity/extensions/page-4/path-system/pathmover/) is leaving the Path the strategy can select a successor. Please check page [Path Finding](/doc/unity/extensions/page-4/path-system/path-finding/) for more information about using custom strategies. If the PathStrategy is empty, automatically the first successor is selected. **Length**\ The lengh of the Path in meters. **Show Path On Simulation**\ Must be set to true if path should be visible during simulation. **Thickness**\ The thickness of the path line. **Materialpath**\ The material of the path. **Direction Arrow**\ If true, the Direction arrow will be displayed. **Size Direction Arrow**\ The size of the direction arrow. ![](/doc/unity/assets/lineparameter.png) #### Path events[](#path-events) [Section titled “Path events ”](#path-events) A certain behavoir at the entrance or the exit of an path element can be defined within the section path events. Scripts which are connected there will be called during run time. An expample for such a strategies is within the demo scene *DemoPathsystem\_UsedCases/DemoAGVSystemWithStations*. ![](/doc/unity/assets/pathevents.png) © 2025 realvirtual GmbH [https://realvirtual.io](https://realvirtual.io/) - All rights reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or by any means, including printing, saving, photocopying, recording, or other electronic or mechanical methods, without the prior written permission of the publisher. # Path finding In automation systems, material flow strategies are often very important for throughput and very often simulation models are created to develop and optimize these strategies. Our library is open and extensible and you can implement your own strategies. ### Basics [Section titled “Basics”](#basics) #### No successor or only one successor [Section titled “No successor or only one successor”](#no-successor-or-only-one-successor) [MUs](/doc/unity/components-and-scripts/mu-movable-unit/) automatically enter the next path if the end of the current path is connected to another path. If no path is connected, the [MU](/doc/unity/components-and-scripts/mu-movable-unit/) will normally stop at the end of the current (unconnected) path. If the *Exit Path* property of the [path mover](/doc/unity/extensions/page-4/path-system/pathmover/) is set to *true*, the [MUs](/doc/unity/components-and-scripts/mu-movable-unit/) will exit the path and be automatically controlled by physics. #### More than one successor [Section titled “More than one successor”](#more-than-one-successor) If there is more than one successor for a path, the *TryMoveNext* public method is called in the [Path Mover](/doc/unity/extensions/page-4/path-system/pathmover/). The following sequence of strategies is invoked: **Step 1: Check the SelectNextPath methods of the components on the Path Mover**. * First, all components on the [Path Mover](/doc/unity/extensions/page-4/path-system/pathmover/) that implement the *ISelectNextPath* interface are selected. In all components, the *SelectNextPath* method is called with a reference to a list (in the Path Mover) of all successor paths. * The implemented method *SelectNextPath* is able to remove paths from the list (so that this path is not taken as the next successor for sure) or to reorder the list so that a certain path is at the first position in the list. \*\* Step 2: Checking the PathStratey referenced by Path\*\*. * The next step is to check if the path has an assigned PathStrategy. If not, we proceed to step 3. The PathStrategy is a reference to a component that inherits from PathStrategy. In a PathStrategy, the public method *SelectNextPath* must be implemented. \*\* Step 3: Check the SelectNextPath methods of components on the path itself\*\*. * Next, call all components on the path itself that implement the *ISelectNextPath* interface. You will get the remaining list of successors from step2 (or a complete list of successors if no logic was found in step1) \*\* Step 4: Select remaining path and move MU to next path\*\*. * Now the remaining list of NextPaths is taken. If there is no content left because the strategies have removed all successor paths, nothing happens. Otherwise, the first path in the list is taken and the [MU](/doc/unity/components-and-scripts/mu-movable-unit/) is moved to the next path. This pictures shows the overall logic of path finding: ![](/doc/unity/assets/path-strategy.png) ### Implement your own strategies[](#implement-your-own-strategies) [Section titled “Implement your own strategies ”](#implement-your-own-strategies) You can implement your own strategies for selecting the next path. The only thing you need to do is to create a script that implements the interface *ISelectNextPath*. Note If you delete all [path movers](/doc/unity/extensions/page-4/path-system/pathmover/) from the *NextPaths* list in your logic, the [path mover](/doc/unity/extensions/page-4/path-system/pathmover/) will stop at the end of the current path. As soon as something changes in your system that could make the path strategy successful, you need to call *TryMoveNext* in the blocked [Path Mover](/doc/unity/extensions/page-4/path-system/pathmover/). You can see this in the example in Option2 below. #### Option1 - Add a component with the *ISelectNextPath* interface to a [Path Mover](/doc/unity/extensions/page-4/path-system/pathmover/) or path. [Section titled “Option1 - Add a component with the ISelectNextPath interface to a Path Mover or path.”](#option1---add-a-component-with-the-iselectnextpath-interface-to-a-path-mover-or-path) Here is an example from the DemoPathsystem\_UseCases demonstration model. The *StrategyRandom* randomly selects the next path. It is attached as a component to the [Line](/doc/unity/extensions/page-4/path-system/line/): ![](/doc/unity/assets/line-strategyrandom.png) The strategy itself looks like this: ```csharp public class StrategyRandom : realvirtual.ioBehavior,ISelectNextPath { public int Seed = 1; public void SelectNextPath(PathMover pathMover,ref List Pathes) { var max = Pathes.Count-1; int random = (int)Mathf.Round(Random.Range(-0.4999f, max+0.4999f)); var path = Pathes[random]; Pathes.Remove(path); Pathes.Insert(0,path); } private void Start() { Random.seed = Seed; } } ``` #### Option2 - Add a reference to a component that inherits from PathStrategy.[](#option2-add-a-reference-to-a-component-that-inherits-from-pathstrategy) [Section titled “Option2 - Add a reference to a component that inherits from PathStrategy. ”](#option2---add-a-reference-to-a-component-that-inherits-from-pathstrategy) Another way to define custom strategies is to reference a component in the path itself that inherits from PathStrategy. Here is an example of a strategy that limits the number in a given range. The *SelectNextPath* method is called from the [Path Mover](/doc/unity/extensions/page-4/path-system/pathmover/) located at the end of a path. If the current number in the range is greater than the allowed number, the list of paths is cleared. As a result, the [Path Mover](/doc/unity/extensions/page-4/path-system/pathmover/) is stopped. The waiting [Path Mover](/doc/unity/extensions/page-4/path-system/pathmover/) is added to the blocked list by calling *AddBlocked*. During startup, event listeners are added on all paths entering or exiting the scope, referencing the *OnPathExit* or *OnPathEntered* methods. During simulation, these methods increment or decrement the counter. If the count is below the defined threshold, *AwakeBlocked* is called. *AwakeBlocked* is implemented in the PathStrategy base class. It calls *TryMoveNext* in all blocked [path movers](/doc/unity/extensions/page-4/path-system/pathmover/). ```csharp public class PathStrategyLimitNumber : PathStrategy { [Header("Settings")] public int MaxNumber; [ReorderableList] public List AreaEnterPathes; [ReorderableList] public List AreaExitPathes; [Header("Status")] [realvirtual.io.ReadOnly] public int CurrentNumber; public override void SelectNextPath(PathMover pathMover,ref List pathes) { if (CurrentNumber >= MaxNumber) { AddBlocked(pathMover); pathes.Clear(); } } public void OnPathEntered(SimulationPath path, PathMover pathMover) { CurrentNumber = CurrentNumber + 1; } public void OnPathExit(SimulationPath path, PathMover pathMover) { CurrentNumber = CurrentNumber - 1; if (CurrentNumber < MaxNumber) AwakeBlocked(); } void Start() { CurrentNumber = 0; foreach (var enterpath in AreaEnterPathes) { enterpath.OnPathEntered.AddListener(OnPathEntered); foreach (var pred in enterpath.Predecessors) { pred.PathStrategy = this; } } foreach (var exitpath in AreaEnterPathes) { exitpath.OnPathExit.AddListener(OnPathExit); } } } ``` © 2025 realvirtual GmbH [https://realvirtual.io](https://realvirtual.io/) - All rights reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or by any means, including printing, saving, photocopying, recording, or other electronic or mechanical methods, without the prior written permission of the publisher. # Pathmover ## Pathmover[](#pathmover) [Section titled “Pathmover ”](#pathmover) The Pathmover is the basic component for moving [MUs](/doc/unity/components-and-scripts/mu-movable-unit/) along a path based on [Lines](/doc/unity/extensions/page-4/path-system/line/) and [Curves](/doc/unity/extensions/page-4/path-system/curve/). The Pathmover component must be on the same Game Object level as the [MUs](/doc/unity/components-and-scripts/mu-movable-unit/) and [Source](/doc/unity/components-and-scripts/mu-movable-unit/source/) script. The Pathmover is keeping its distance to the other Pathmovers by drawing 3 Raycasts. One straight on and two to the sides. As soon as the Distance (*Distance / Distance Sides*) is fallen below the defined values, the Pathmover starts to slow down (if the Drive has a defined acceleration) or stops immediately. As soon as the Distance is above, the Pathmover starts to speed up again. ![](/doc/unity/assets/pathmover.png) ### Public properties[](#public-properties) [Section titled “Public properties ”](#public-properties) **Create On Path**\ Defines the Path where the Pathmover should be created by the [Source](/doc/unity/components-and-scripts/mu-movable-unit/source/). **Leave Path**\ If set to true the Pathmover will leave the path whenn reaching the end of a path with no successors. The MU (Transportable) will be totally under control of Physics. **Align with Path**\ Aligns the Pathmover with the Paths tangent if true. **Distance**\ The distance in meters, the pathmover keeps for the straight raycast **Distance Sides**\ The distance in meters, the pathmover keeps for the side raycasts **Angle Side**\ The angle of the side raycat.\ **Angle Side** **Draw Ray** **Align Vector**\ The vector of the Pathmover which should be aligned with the Path. **Current Station**\ The current station of the Pathmover. The station is assigned when entering and deleted when leaving the station **Current Station Working**\ The current working station, the value is set as soon as the working time starts in a station **Is Stopping**\ true, when the Pathmover is slowing down. **Is Starting**\ true, when the Pathmover is speeding up. **Is Stopped**\ true, when the Pathmover is stopped (e.g. at the end of a path or in a station) **Is Blocked**\ true, when the Pathmover is blocked (e.g. by another Pathover ahead) **Is On Path End**\ true, when the Pathmover is on an end of a Path. **Path**\ The current Path. **Position**\ The current position in meters on the Path. ### Events [Section titled “Events”](#events) The Pathmover has several events and you can assign your custom code to these events. #### Path Events [Section titled “Path Events”](#path-events) **OnPathEntered (SimulationPath, PathMover)**\ Event is fired when a new Path is entered by Pathmover. **OnPathEnd (SimulationPath, PathMover)**\ Event is fired when a Pathmover is at the end of a Path. **OnPathExit (SimulationPath, PathMover)**\ Pathmover is leaving the Path. **OnStopping (SimulationPath, PathMover)**\ Pathmover is starting to stop (slowing down). **OnStopped (SimulationPath, PathMover)**\ Pathmover is fully stopped. **OnStart (SimulationPath, PathMover)**\ Pathmover is starting (speeding up). **OnFullyStarted (SimulationPath, PathMover)**\ Pathmover is at full speed. **OnBlocked (SimulationPath, PathMover)**\ Pathmover is blocked. #### Station Events [Section titled “Station Events”](#station-events) **OnStationEntered (BaseStation, PathMover)**\ Pathmover has entered a Station. **OnStationWorkStarting(BaseStation, PathMover)**\ Pathmover has started the work in a Station. **OnStationWorkFinished(BaseStation, PathMover)**\ Pathmover has finished work in a Station. **OnStationExit(BaseStation, PathMover)**\ Pathmiver has left a Station. # Workstation The Workstation is used to model work processes inside of a path system. The Workstation is detecting the Pathmovers by a box collider. As soon as the distance between the pivot point of the [Path Mover](/doc/unity/extensions/page-4/path-system/pathmover/) is not decreasing any more the [Path Mover](/doc/unity/extensions/page-4/path-system/pathmover/) is starting to be stopped (depending of the drive with an deceleration). When the [Path Mover](/doc/unity/extensions/page-4/path-system/pathmover/) is stopped and the work process is started. #### Public properties and methods [Section titled “Public properties and methods”](#public-properties-and-methods) ![](/doc/unity/assets/workstation.png) **Dimension**\ The Dimension of the Workstation (the visualized collider) **Distribution**\ The Distribution of the worktime. If the distribution is not constant you need to define additional parameters. Also it is necessary to define the random seed to get deterministic random seeds. **Mean Time**\ The mean time of the worktime in seconds (on distributed worktime) **Worktime**\ The worktime in seconds (on constant worktime) **Availability**\ The Station is able to simulate failures. The failures are defined by the Availability in percent of the station and the mean time to repair in seconds. For both, the failure distance and for the failure duration a random seed must be defined. The distribution function for the failure distance is negative exponential and the distribution of the failure duration is Erlang. These are the most common distributions to describe technical failures. During a failure the Pathmovers are able to continue entry and exit out of a station. A current work process will be interrupted by a failure and the Pathmover will not be able to leave before the full time of the workprocess is done. #### Defining custom working times [Section titled “Defining custom working times”](#defining-custom-working-times) The working time can be defined with custom component scripts implementing the interface *IGetStationTime*. First on the [Path Mover](/doc/unity/extensions/page-4/path-system/pathmover/) a component which implements the interface *IGetStationTime* is searched. If there is no implementation on the PathMover an implementation of the interface on the Station itself is searched. If there is no implementation of *IGetStationTime* available the stationtime the standard worktime which is defined in the properties is used. #### Public Methods [Section titled “Public Methods”](#public-methods) The public methods can be for example used in your custom workstation processes. **void OpenWorkstationEntry()**\ Opens the Workstation Entry, if before the [Path Mover](/doc/unity/extensions/page-4/path-system/pathmover/) has been blocked by *AllowEntry* **void StartWorking()**\ Starts the working process in the workstation. Needs to be started by using this method if it has been blocked by *AllowStart*. #### Defining custom workstation processes [Section titled “Defining custom workstation processes”](#defining-custom-workstation-processes) To define your totally custom defined workstation you can define your own component, that implements the Interface IWorkstationProcess. These methods can totally control the workstation behavior.\ The *LoadWorkstationProcess.cs* and *UnloadWorkstationProcess* shows you an example. ![](/doc/unity/assets/interfaceworkprocess.png) **bool AllowEntry(WorkStation station, PathMover pathMover)**\ If true is returned the [Path Mover](/doc/unity/extensions/page-4/path-system/pathmover/) can enter the workstation. If false is returned the entry needs to be started by calling the public Method *OpenWorkstationEntry()* **bool AllowStart(WorkStation station, PathMover pathMover)**\ If true is returned the working process on [Path Mover](/doc/unity/extensions/page-4/path-system/pathmover/) can start. If false is returned, the start needs to be started by calling the public Method *StartWorking()* **void OnFailureStart(WorkStation station)**\ Is called when a failure is starting. **void OnFailureEnd(WorkStation station)**\ Is called when a failure is ending. **void OnStart(WorkStation station,float time)**\ Is called when the work process is started. **void OnEnd(WorkStation station, PathMover pathMover)**\ Is called when the work process is ended and the [Path Mover](/doc/unity/extensions/page-4/path-system/pathmover/) starts leaving the Workstation. **void OnExit(WorkStation station, PathMover pathMover)**\ Is called when the the [Path Mover](/doc/unity/extensions/page-4/path-system/pathmover/) has totally left the Workstation © 2025 realvirtual GmbH [https://realvirtual.io](https://realvirtual.io/) - All rights reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or by any means, including printing, saving, photocopying, recording, or other electronic or mechanical methods, without the prior written permission of the publisher. # realvirtual.io WEB (Pro) Note realvirtual.io WEB export requires **realvirtual.io Professional**. The browser-based viewer itself is open source (AGPL-3.0) and available at [github.com/game4automation/realvirtual-WEB](https://github.com/game4automation/realvirtual-WEB). ![](/doc/unity/assets/realvirtual-web-demo.jpg) realvirtual WEB — browser-based 3D HMI with KPI dashboards, drive monitoring, and alarm messages ## Overview [Section titled “Overview”](#overview) realvirtual.io WEB is a browser-based 3D HMI and digital twin viewer. It loads GLB files exported from Unity and runs interactive transport simulation, drive animation, sensor collision, and LogicStep sequencing directly in the browser — no installation required. **One link. Any device. Live Digital Twin.** The Unity Editor provides the authoring tools to export your digital twin as a single GLB file containing all 3D geometry, component metadata, signal bindings, kinematic definitions, and drive parameters. The browser viewer reads this metadata and recreates the full interactive simulation. ## The Two-Platform Strategy [Section titled “The Two-Platform Strategy”](#the-two-platform-strategy) | | Unity (Engineering Platform) | realvirtual WEB (Delivery Platform) | | ------------------ | ---------------------------------------------------- | ----------------------------------------------- | | **Purpose** | CAD import, behavior modeling, virtual commissioning | Browser-based 3D HMI, monitoring, collaboration | | **Technology** | Unity Engine, C#, Unity Industry | Three.js, TypeScript, React | | **Deployment** | Desktop application, XR headsets, mobile devices | Any modern browser | | **PLC connection** | Native protocol drivers | WebSocket / MQTT gateway | | **Target user** | Automation engineer, simulation expert | Operator, service tech, sales, customer | The GLB file is the bridge between the two platforms. ## Quick Start [Section titled “Quick Start”](#quick-start) Note **Prerequisite — UnityGLTF package.** The GLB export builds on the open-source [UnityGLTF](https://github.com/KhronosGroup/UnityGLTF) package (Khronos Group). Since realvirtual **6.3.5** the **realvirtual WEB** entry under **Tools > realvirtual > Export** is always available: if UnityGLTF is not yet installed, selecting it offers to install the package with one click. After Unity recompiles, the realvirtual WEB window opens and GLB export becomes available. You can also install it manually via **Window > Package Manager > Add package from git URL** using `https://github.com/KhronosGroup/UnityGLTF.git`. ### 1. Open WebViewer Tools [Section titled “1. Open WebViewer Tools”](#1-open-webviewer-tools) Open via **Tools > realvirtual > Export > WebViewer Tools**. The window has five tabs for the complete export-to-publish workflow. ### 2. Export Your Scene [Section titled “2. Export Your Scene”](#2-export-your-scene) ![](/doc/unity/assets/webviewerexport.png) Export tab — export selected GameObjects or the entire scene as GLB In the **Export** tab, you have three options: * **Export Selected to WebViewer** — Exports the currently selected GameObject and its children * **Export Scene to WebViewer** — Exports all root GameObjects in the current scene * **Export Selected as…** — Opens a file save dialog to choose any output path The exported GLB is placed in the WebViewer’s `public/models/` folder and contains: * All 3D geometry (meshes, materials, textures) * All realvirtual component data (drives, sensors, transport surfaces, sources, sinks, grippers, logic steps) * Signal bindings (PLCInput/PLCOutput connections) * Kinematic hierarchies and axis configurations * Group definitions for visibility control * Camera presets ### 3. Preview in Browser [Section titled “3. Preview in Browser”](#3-preview-in-browser) ![](/doc/unity/assets/webviewer-devserver.png) Dev Server tab — start the local preview server and open the browser Start the local development server by clicking **Start Dev Server**. The browser opens automatically at `http://localhost:5173`. Select your exported model from the model selector. You can also open the WebViewer and Models folders directly from this tab. ### 4. Publish [Section titled “4. Publish”](#4-publish) ![](/doc/unity/assets/webviewerpublish.png) Publish tab — one-click deployment to Bunny CDN The **Publish** tab provides integrated deployment to **Bunny CDN** at `web.realvirtual.io`. Configure your Bunny CDN credentials (Storage Key, Account API Key, Pull Zone ID), set a demo name, and click **Publish Scene** or **Publish Selected**. **Publishing options:** * **Publish Selected** — Exports and uploads the selected GameObject * **Publish Scene** — Exports and uploads the entire scene * **Publish Last Export** — Uploads a previously exported GLB without re-exporting Note Bunny CDN publishing is the integrated one-click solution. You can also **manually deploy** to any web server or cloud platform — the export produces a standard `dist/` folder (via `npm run build`) that can be uploaded to any static hosting service: your own web server, AWS S3, Azure Blob Storage, Netlify, Vercel, or any internal infrastructure. The GLB files and the built viewer are fully self-contained. ### 5. Private Projects [Section titled “5. Private Projects”](#5-private-projects) ![](/doc/unity/assets/webviewerprivateexort.png) Private tab — create and manage private customer deployments with secure URLs The **Private** tab manages customer-specific deployments: * **Create** new private projects with auto-generated secure URLs (128-bit entropy) * Each project has its own GLB models, settings, and optional plugins * **Export Scene** directly into the project’s models folder * **Publish** to an unguessable URL at `web.realvirtual.io/{code}/` * **Copy** the secure link to share with customers Private projects are ideal for customer-specific digital twins that should not be publicly accessible. ### 6. Manage Deployments [Section titled “6. Manage Deployments”](#6-manage-deployments) ![](/doc/unity/assets/webviewermanage.png) Manage tab — overview of all published deployments with usage statistics The **Manage** tab shows all published deployments (public and private) on Bunny CDN: * File sizes and last update timestamps * **Copy Link** to share deployment URLs * **Open** in browser to preview * **Delete** to remove deployments * Usage statistics: page views, unique visitors, bandwidth, and cache hit rate ## WebViewer Settings [Section titled “WebViewer Settings”](#webviewer-settings) ![](/doc/unity/assets/webviewersettings.png) WebViewerSettings asset — configure paths for the WebViewer installation The **WebViewerSettings** asset controls paths for the WebViewer installation: | Setting | Default | Description | | ------------------- | --------------------------------------- | ------------------------------- | | **Web Viewer Path** | `Assets/realvirtual-WebViewer~` | Path to the WebViewer source | | **Private Path** | `Assets/realvirtual-WebViewer-Private~` | Path to private projects folder | These paths determine where exported GLB files are placed and where the dev server runs. ## What Gets Exported [Section titled “What Gets Exported”](#what-gets-exported) The export pipeline embeds all realvirtual component data into the GLB file using the `rv_extras` extension. The browser viewer reads this metadata to reconstruct the simulation. ### Supported Components [Section titled “Supported Components”](#supported-components) A selection of the most common components: | Component | Exported Data | | --------------------- | -------------------------------------------------------- | | **Drive** | Direction, speed, acceleration, limits, current position | | **Sensor** | AABB dimensions, signal connections | | **TransportSurface** | Speed, direction, dimensions | | **Source** | Spawn interval, MU template reference | | **Sink** | Signal connections | | **Grip / GripTarget** | Grip positions, pick/place configuration | | **LogicStep** | Step type, parameters, signal conditions, hierarchy | | **Group** | Visibility group assignments | | **Kinematic** | Joint hierarchy, axis definitions | | **Signals** | PLCInput/PLCOutput bindings with names and types | For the complete list — including drive behaviors, robotics / IK, the 3D-HMI markers (WebSensor, WebError, …) and digital-twin links (AAS, CAD) — see [Supported Components](/doc/unity/extensions/realvirtual-web/supported-components/). To author the browser 3D-HMI in Unity, see [Building a 3D-HMI](/doc/unity/extensions/realvirtual-web/3d-hmi/). ## Export Settings [Section titled “Export Settings”](#export-settings) Export behavior is configured via the **AssetManagerSettings** asset (`Packages/io.realvirtual.professional/Runtime/AssetManager/Resources/AssetManagerSettings.asset`): | Setting | Default | Description | | ------------------------------ | ------- | --------------------------------------------------------------------------- | | **Export Material Properties** | Off | Embeds full shader property values (textures, colors). Increases file size. | | **Enable Mesh Deduplication** | On | Removes duplicate meshes to reduce GLB file size | | **Export Thumbnails** | On | Generates and embeds a PNG preview thumbnail | | **Export Decal Projectors** | On | Includes URP DecalProjector data | | **ScriptableObject Export** | On | Serializes ScriptableObject fields into the GLB | ## Browser Viewer [Section titled “Browser Viewer”](#browser-viewer) The exported GLB files are loaded by the browser-based viewer. For full documentation on the viewer itself, see the [realvirtual WEB GitHub repository](https://github.com/game4automation/realvirtual-WEB). Key viewer capabilities: * Live 3D HMI with PLC connectivity via WebSocket or MQTT * In-browser transport simulation at 60 Hz * KPI dashboards with Apache ECharts * WebXR support (VR/AR) * Plugin system for custom extensions * AI-enabled via [MCP Server](https://github.com/game4automation/realvirtual-MCP) ## MultiplayerWEB (Beta) [Section titled “MultiplayerWEB (Beta)”](#multiplayerweb-beta) ![](/doc/unity/assets/multiplayerweb-inspector.png) MultiplayerWEB component — relay client mode with session and sync settings The **MultiplayerWEB** component (Pro) enables real-time multiuser sessions between Unity and browser clients. It runs a WebSocket server inside Unity on port 7000, streaming drive positions, MU states, and signal values to all connected browser viewers. Browser clients connect via the Multiuser panel in the WebViewer and see shared avatars, camera positions, and live machine state. Roles (Operator/Observer) control who can interact with the simulation. MultiplayerWEB supports two connection modes: * **Direct** — Browser clients connect directly to Unity’s WebSocket server (local network) * **Relay** — Browser clients connect via a hosted relay server (internet access, no port forwarding needed) Caution MultiplayerWEB is currently in **Beta**. The relay server is hosted via the realvirtual customer portal. ## See Also [Section titled “See Also”](#see-also) * [realvirtual WEB on GitHub](https://github.com/game4automation/realvirtual-WEB) — Open-source browser viewer (AGPL-3.0) * [realvirtual MCP Server](https://github.com/game4automation/realvirtual-MCP) — AI agent bridge for Unity and WebViewer * [Publishing the Digital Twin](/doc/unity/basics/publishing-the-digital-twin/) — Other deployment options (Windows, WebGL, VR) # Building a 3D-HMI > Authoring the browser-based 3D-HMI in Unity with the Web* components ## Overview [Section titled “Overview”](#overview) ![Browser-based 3D-HMI with KPI tiles, an OEE chart and a live message panel](/doc/unity/assets/web-hmi-oee-dashboard.png) A realvirtual WEB 3D-HMI — live KPIs, drive monitoring, message panel and document links, running in the browser realvirtual WEB delivers the interactive 3D-HMI in the browser. You author it in Unity by adding lightweight **`Web*` marker components** to your GameObjects, binding them to PLC signals, and exporting the scene as GLB. The browser viewer reads these markers from the GLB and renders status indicators, error highlights, safety-zone overlays, operator instructions and digital-twin links — connected to live signals. These components replace the deprecated Unity uGUI [HMI components](/doc/unity/components-and-scripts/scene-interaction/hmi-components-pro/). Instead of building a 2D operator panel inside the Unity scene, you annotate the 3D model itself, and the HMI runs in any browser. Note Most `Web*` components are **pure markers** — they have no Unity runtime function and only describe how a node is visualized in realvirtual WEB. Add them, bind a signal, set a label, and export. ## From Virtual Commissioning to 3D-HMI [Section titled “From Virtual Commissioning to 3D-HMI”](#from-virtual-commissioning-to-3d-hmi) A realvirtual 3D-HMI is not built from scratch — it is the delivery form of the model you already built for simulation and virtual commissioning. In the typical engineering workflow the behavior model comes first, and the HMI is the last step: 1. **Engineering / virtual commissioning** — import the CAD, add drives, sensors, kinematics and signals, and test the control logic against the physics-based model with a virtual or real PLC, before the machine is built. 2. **Delivery / 3D-HMI** — add the `Web*` markers below to the finished model, export it as GLB, and deliver it to any browser as a live operator HMI connected to the running machine. The same drives, sensors, signals and kinematics that drive the simulation drive the HMI. You reuse the validated commissioning model rather than rebuilding it — the 3D-HMI is a natural continuation of the engineering work, not a separate project. ## Quick Start [Section titled “Quick Start”](#quick-start) 1. Select the GameObject you want to annotate (a machine part, a sensor, a door). 2. Add a `Web*` component from the **realvirtual → WebHMI** component menu (for example **Web Sensor**). 3. Bind the relevant PLC signal(s) and set a label or text. 4. Export the scene with **Tools → realvirtual → Export → WebViewer Tools** and open it in the browser. ## Showing Machine Motion [Section titled “Showing Machine Motion”](#showing-machine-motion) The core of a 3D-HMI is the machine moving as it really does. realvirtual [drives](/doc/unity/components-and-scripts/motion/drive/) animate the model directly from live PLC signals, so the browser shows the true machine state — there is no separate animation to maintain, and the same drives you use for virtual commissioning drive the HMI. | Component | HMI use | | ------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | **Drive** | Moves an axis (linear or rotational) to visualize live position or motion. | | **Drive\_FollowPosition** | Mirrors a real axis 1:1 — the drive follows a PLC position signal (for example an encoder value) directly, with scale and offset. The best choice for reflecting the actual machine position in the HMI. | | **Drive\_Cylinder** | Shows a pneumatic actuator moving between its two end positions from a bool signal, with end-position feedback — ideal for cylinders, clamps and stoppers. | | **Drive\_Speed** | Moves or rotates a component at a live commanded speed, for example a conveyor. | See [drive behaviors](/doc/unity/components-and-scripts/motion/drive-behavior/) for the full list. Combine motion with the markers below: the drive shows what the machine is doing, while WebSensor and WebError overlay its status. ## Web Sensor [Section titled “Web Sensor”](#web-sensor) **Component menu:** realvirtual → WebHMI → Web Sensor Visualizes a signal as a color-coded 3D status indicator with four states — Low, High, Warning, Error — using ISA-101 aligned colors (grey / blue / amber / red, with amber blinking at 1 Hz and red at 2 Hz). Bind **either** a bool signal (2 states) **or** an int signal (4+ states). | Property | Description | | ------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | **Signal Bool** (PLCOutputBool) | Binary input: false = Low, true = High. Use for two-state indicators. | | **Signal Int** (PLCOutputInt) | Integer input mapped to a state through the Int State Map. Wins if both signals are set. | | **Int State Map** (string) | Maps integer values to states. Empty = default (0=Low, 1=High, 2=Warning, 3=Error). Format: comma-separated `value:state` pairs, e.g. `0:low,1:high,5:warning,99:error`. Unlisted values map to Low. | | **Label** (string) | Optional label shown in the tooltip and the sensor list. | ## Web Error [Section titled “Web Error”](#web-error) **Component menu:** realvirtual → WebHMI → Web Error Marks a part as an error source. While the signal is high, the part is highlighted, the error text appears as a badge next to it, and the error is listed as a card in the message panel (clicking it focuses the part). Can also be used without a signal as a static hint. | Property | Description | | -------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | | **Signal Error** (PLCOutputBool) | true = error active, false = OK. Leave empty for a static hint marker. | | **Error Text** (string) | Human-readable error message shown as a 3D badge and in the message panel. | | **Highlight Style** (Auto / Flash Object / Circle) | How the part is highlighted. Auto lets the viewer choose by part size; Flash Object glows the mesh red at 2 Hz; Circle draws a red floor ring. | ## Web Visibility [Section titled “Web Visibility”](#web-visibility) **Component menu:** realvirtual → WebHMI → Web Visibility Shows or hides parts from a signal, with an optional error state. Unlike the other markers this component also works inside Unity at runtime. | Property | Description | | -------------------------------------------------- | ------------------------------------------------------------ | | **Signal Visible** (PLCOutputBool) | true = visible, false = hidden. Empty = use Default Visible. | | **Invert Signal** (boolean) | Inverts the visibility logic (signal false = visible). | | **Default Visible** (boolean) | Visibility used when no visibility signal is bound. | | **Additional Targets** (list) | Extra GameObjects shown / hidden together with this object. | | **Signal Error** (PLCOutputBool) | true = error active (red, flashing). Empty = no error state. | | **Error Text** (string) | Error message shown as a 3D badge and in the message panel. | | **Highlight Style** (Auto / Flash Object / Circle) | How the faulty part is highlighted. | | **Error Color** (color) | Color of the error highlight (Unity overlay and WEB). | | **Blink Speed** (float) | Blink speed of the error highlight. Higher = faster. | ## Web Safety Door [Section titled “Web Safety Door”](#web-safety-door) **Component menu:** realvirtual → WebViewer → Web Safety Door Adds a safety-door overlay: an amber outline around the door mesh, a translucent hazard-zone halo on the floor, and a billboard label. Overlay only — the door mesh is never recolored. | Property | Description | | ---------------------------------- | --------------------------------------------------------------------------------------------------- | | **Hazard Zone Radius** (float, mm) | Radius of the floor halo that visualizes the hazard zone below the door. | | **Label Height** (float, mm) | Height of the billboard label above the floor. Sits low by default so it does not occlude the door. | ## Custom Runtime Instruction [Section titled “Custom Runtime Instruction”](#custom-runtime-instruction) Signal-activated operator instruction shown in the message panel. Supports a single message or an ordered list of steps; each step can highlight and frame target objects in the 3D scene and link a document. | Property | Description | | --------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | | **Type** (Info / Maintenance / Warning / Error / Success) | Determines the title, icon and border color. | | **Dismissible** (boolean) | If true, the operator can acknowledge the message; it reappears on the next rising signal edge. If false it stays while the signal is high. | | **Isolate** (boolean) | realvirtual WEB only: clicking the message isolates the step’s targets (dims the rest of the scene) in addition to camera focus and highlight. | | **Signal** (PLCOutputBool) | Optional. Rising edge pushes the message, falling edge dismisses it. | | **Steps** (list) | Ordered instruction steps. Each step has instruction text, target objects (highlighted in parallel and framed), and an optional document URL. | ## AAS Link [Section titled “AAS Link”](#aas-link) **Component menu:** realvirtual → AAS → AAS Link Links a part to an Asset Administration Shell. In the browser the AAS identifier is resolved against a local AASX index (or fetched from a server URL) and the Nameplate and Technical Data are shown as a tooltip on hover or selection. | Property | Description | | ------------------------ | ----------------------------------------------------------------------------- | | **AAS Id** (string) | AAS identifier, e.g. `http://smart.festo.com/aas/99920200623113326000013225`. | | **Description** (string) | Optional description shown in the tooltip header. | | **Server Url** (string) | Optional AAS server URL. Empty = load the AASX from the local `aasx/` folder. | ## Web Collision Role [Section titled “Web Collision Role”](#web-collision-role) **Component menu:** realvirtual → WebHMI → Web Collision Role Assigns a collision role to a part for the collision detection in realvirtual WEB. Roles can also be set in the browser, but a role set there is lost when the model is exported from Unity again. Setting it with this marker in the Unity scene keeps it across any number of re-exports. If a part has both, the role set in the browser wins. Parts with the **same** role never collide with each other - only parts with **different** roles are checked against each other. | Property | Description | | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | **Collision Role** (None / Tool / Workpiece / Machine / Robot / Environment / Cutter) | Role of this part. **Tool** for grippers and end effectors, **Workpiece** for handled or machined parts, **Machine** for doors, guards and frames, **Robot** for robot arms, **Environment** for walls, fences and floor, **Cutter** for milling cutters and saw blades. **None** takes part in no collision pair. | MUs created by a [Source](/doc/unity/components-and-scripts/mu-movable-unit/source/) get their role from the Source property **Collision Role For MUs** instead of this marker. Note Web Collision Role was added in realvirtual **6.3.6** (Professional). ## Web Pivot [Section titled “Web Pivot”](#web-pivot) **Component menu:** realvirtual → WebHMI → Web Pivot Defines the explicit pivot point of a library object for realvirtual WEB. Place it on an empty child GameObject; the child’s transform position becomes the pivot the viewer uses for gizmos, layout snapping and rotation, instead of the default auto pivot (bottom-center of the bounding box). Use exactly one per library object. This component has no properties — only its position matters. ## Tooltips and Metadata [Section titled “Tooltips and Metadata”](#tooltips-and-metadata) **RuntimeMetadata** carries per-part information such as article numbers and descriptions. In realvirtual WEB it drives hover tooltips and is the key that links a part to its documentation. See [Runtime Metadata](/doc/unity/components-and-scripts/scene-interaction/runtime-metadata/) for the content syntax and the Excel import. ## Attaching Documents [Section titled “Attaching Documents”](#attaching-documents) You can attach documentation — data sheets, maintenance instructions, spare-part lists — directly to the parts of the 3D model. The link is made by **article number**: each part carries its article number in `RuntimeMetadata`, and a document index maps article numbers to PDF files. In the browser, parts that have documentation are highlighted, a document button opens the PDF browser, and hovering a part reveals its document link. This is how production 3D-HMIs use it in practice: every CAD part carries its article number, and the operator opens the matching data sheet or maintenance PDF straight from the 3D model. ![A machine manual PDF opened inside the browser 3D-HMI, deep-linked from an alarm](/doc/unity/assets/web-hmi-pdf-manual-viewer.png) The machine manual opens directly inside the 3D-HMI, deep-linked to the relevant page Note Documents are served alongside the deployment — no document content is embedded in the GLB. The GLB only carries the article numbers via `RuntimeMetadata`. ## Outlook — AI-Assisted Diagnosis [Section titled “Outlook — AI-Assisted Diagnosis”](#outlook--ai-assisted-diagnosis) Attaching documents also opens the door to AI-assisted operation. When the attached PDFs are indexed in a **vector database**, a large language model can answer questions and diagnose faults against your own documentation: ![AI assistant panel diagnosing an alarm with cause, recommended steps and cited manual sources](/doc/unity/assets/web-ai-assistant-alarm.png) AI-assisted diagnosis of an alarm — cause, recommended steps and cited sources with page-level deep links into the manuals * **WebDiagnostics** couples a PLC error signal to an AI diagnosis. On a fault it returns the likely cause, a suggested remedy, and the exact PDF sources — with page-level deep links into your manuals. * The AI runs server-side through realvirtual CONNECT: the LLM keys, the vector index and the PDF full text stay on the server, and the browser only sends the request and shows the result. This turns the 3D-HMI from a monitoring view into an assistance system grounded in the machine’s real documentation. Caution AI-assisted diagnosis is an advanced, evolving capability. The `WebDiagnostics` marker is available today as a realvirtual WEB feature; the Unity authoring component is planned. ## See Also [Section titled “See Also”](#see-also) * [Supported Components](/doc/unity/extensions/realvirtual-web/supported-components/) — full list of components read by realvirtual WEB * [realvirtual WEB](/doc/unity/extensions/realvirtual-web/) — export and publish workflow * [HMI components (deprecated)](/doc/unity/components-and-scripts/scene-interaction/hmi-components-pro/) — the legacy Unity uGUI HMI these components replace # Supported Components > Which realvirtual components are exported to GLB and run in realvirtual WEB ## Overview [Section titled “Overview”](#overview) realvirtual WEB reconstructs a running digital twin in the browser from a single GLB file. All component configuration is embedded in the GLB using the `rv_extras` (REALVIRTUAL) extension during Unity export, and the browser viewer reads this metadata to recreate the simulation, the 3D-HMI and the digital-twin links — no separate configuration files. This page lists the Unity C# components that are exported and supported in realvirtual WEB, grouped by area. Component names in the browser match their Unity counterparts, so a scene authored in Unity behaves the same way in the browser. Note Support is defined by the **rv-ODT v1** interchange schema. Everything below is read from the GLB and reconstructed automatically. Components not listed here are either Unity-only or belong to a runtime layer outside the interchange format (for example the in-browser DES engine and library behaviors). ## Motion & Drives [Section titled “Motion & Drives”](#motion--drives) The `Drive` component and its drive behaviors are fully supported, including position, speed and acceleration control with limits. | Component | What runs in realvirtual WEB | | ------------------------------------ | ---------------------------------------------------------------------------- | | **Drive** | Linear (X/Y/Z) and rotational motion, limits, acceleration, current position | | **Drive\_Simple** | Jog forward/backward with speed and position feedback | | **Drive\_Speed** | Speed-controlled motion from a PLC target-speed signal | | **Drive\_DestinationMotor** | Point-to-point positioning (start → destination) with feedback | | **Drive\_FollowPosition** | Drive directly follows a PLC position signal (scale + offset) | | **Drive\_Cylinder** | Two-position pneumatic cylinder with end-position feedback | | **Drive\_Gear** | Slave a drive to a master drive with gear ratio and offset | | **Drive\_PositionSwitch** | Bool output while the drive is inside configured position areas | | **Drive\_ErraticPosition** | Random / alternating motion between min and max | | **DrivesRecorder / ReplayRecording** | Record and replay drive motion sequences, signal-triggered | Caution `Drive_CAM` (cam-disc coupling) is reserved in the schema and is **not** simulated in realvirtual WEB yet. ## Kinematics & Robotics [Section titled “Kinematics & Robotics”](#kinematics--robotics) | Component | What runs in realvirtual WEB | | ------------- | ------------------------------------------------------------------------------------------------------------------ | | **Kinematic** | Kinematic hierarchy re-parenting (integrate group / kinematic parenting, hierarchy simplification) applied on load | | **RobotIK** | Inverse-kinematics solver configuration on the robot root (spherical / non-spherical wrist) | | **IKPath** | Ordered list of IK targets forming a robot path, with start/end signals and looping | | **IKTarget** | Target pose, interpolation and blending, pick/place configuration | ## Transport & Material Flow [Section titled “Transport & Material Flow”](#transport--material-flow) | Component | What runs in realvirtual WEB | | -------------------- | ----------------------------------------------------------------------------------------------------------------- | | **TransportSurface** | Conveyor surface moving MUs along a direction at the referenced drive’s speed; accumulation and radial turntables | | **Source** | Spawns MUs by interval or distance and places them on the transport system | | **Sink** | Destroys MUs that reach it | | **MU** | Movable-Unit template that the Source clones | | **Grip** | Pick-and-place gripper (1-bit or pick/place signals, auto / static / physics place modes) | | **GripTarget** | Snap / align marker for precise MU placement | | **Path** | Arc-length path for path-based movement (AGV / overhead conveyors); line and arc segments with graph chaining | ## Sensors [Section titled “Sensors”](#sensors) | Component | What runs in realvirtual WEB | | ---------- | ------------------------------------------------------------------------------ | | **Sensor** | Presence sensor (AABB overlap or raycast); occupied / not-occupied PLC signals | ## Signals & Logic [Section titled “Signals & Logic”](#signals--logic) | Component | What runs in realvirtual WEB | | ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | **PLC Signals** | `PLCInputBool/Float/Int` and `PLCOutputBool/Float/Int` are registered in the browser SignalStore and drive all components | | **ConnectSignal** | One-way signal bridge that copies a source signal onto its own signal | | **LogicStep** | Sequencing steps: serial / parallel containers, delay, set/wait signal (bool & float), wait for sensor, drive-to / start-drive / set-drive-speed, wait for drives at target, enable, grip pick / place, IK path, jump on signal | Note Live signals arrive over WebSocket, MQTT or REST and always override local behavior immediately. Signal direction follows the PLC convention — PLC Outputs are read by the viewer, PLC Inputs are written by the viewer. ## 3D-HMI [Section titled “3D-HMI”](#3d-hmi) Marker components authored in Unity that build the browser-based 3D-HMI. For field-level details and authoring workflow see [Building a 3D-HMI](/doc/unity/extensions/realvirtual-web/3d-hmi/). | Component | What runs in realvirtual WEB | | ------------------------------ | -------------------------------------------------------------------------------------------------------------------------------- | | **WebSensor** | Signal-bound status indicator with Low / High / Warning / Error states (ISA-101 colors, blink) and optional label | | **WebError** | Bool-signal error state: 3D badge + entry in the message panel; configurable highlight | | **WebVisibility** | Show / hide parts from a bool signal, plus an optional error state | | **WebSafetyDoor** | Safety-door overlay with hazard-zone halo and label | | **CustomRuntimeInstruction** | Signal-activated operator instruction: multi-step, per-step 3D highlight / isolate, optional document link | | **RuntimeMetadata** | Tooltip / annotation content (article numbers, descriptions) shown on hover and used for document linking | | **WebDiagnostics** *(preview)* | Couples a PLC error signal to AI error diagnosis — currently a realvirtual WEB feature; the Unity authoring component is planned | Message panels, KPI dashboards and drive / sensor tooltips are provided by realvirtual WEB itself and are driven by the components above and by live signals. ## Digital Twin Integration [Section titled “Digital Twin Integration”](#digital-twin-integration) | Component | What runs in realvirtual WEB | | ----------- | ----------------------------------------------------------------------------------------------------------------------------------------- | | **AASLink** | Links a part to an Asset Administration Shell (AASX from a local folder or a server URL); shows Nameplate and Technical Data as a tooltip | | **CADLink** | CAD-import provenance metadata and in-browser re-import | ## Scene & Structure [Section titled “Scene & Structure”](#scene--structure) | Component / feature | What runs in realvirtual WEB | | ------------------------------- | ----------------------------------------------------------------------------- | | **Group** | Named group membership drives visibility groups | | **WebPivot** | Explicit pivot point for a library object (used at import / placement time) | | **Connections** | Self-describing typed connections (for example sensor → station stop-on-exit) | | **Camera presets, Measurement** | Provided by the viewer at runtime (camera views, distance measurement) | ## Extensibility [Section titled “Extensibility”](#extensibility) | Feature | What runs in realvirtual WEB | | ---------------------------------- | -------------------------------------------------------------------------------------------------------------- | | **WebComponent (GLB-embedded JS)** | Sandboxed `setup(self)` behavior scripts embedded in the GLB, executed in a secure in-browser sandbox (opt-in) | ## See Also [Section titled “See Also”](#see-also) * [realvirtual WEB](/doc/unity/extensions/realvirtual-web/) — export and publish workflow * [Building a 3D-HMI](/doc/unity/extensions/realvirtual-web/3d-hmi/) — authoring the `Web*` 3D-HMI components in Unity # realvirtual.io AIBuilder > Develop, train, test, and deploy your AI vision-based industrial process. Training AI models in a digital twin environment offers significant benefits by replicating real-world systems virtually. This approach enables safe, efficient, and scalable AI development. Key advantages include: * **Cost Efficiency**: Reduces expenses by avoiding the need for physical setups and minimizing downtime. * **Safety**: Eliminates risks associated with real-world testing, especially in hazardous applications. * **Rapid Data Generation**: Synthetic data can be generated in minutes, allowing AI models to be trained on diverse scenarios quickly—whereas collecting equivalent real-world data could take months. * **Accelerated Development**: Allows rapid iteration and testing, speeding up the AI development cycle. * **Seamless Integration**: Facilitates real-time testing with automation systems like PLCs, robots, and sensors. * **Scalability**: Easily simulates complex or large-scale systems for diverse AI training scenarios. The realvirtual.io AI Builder is a platform designed to simplify and accelerate the development, training, testing, and deployment of AI-driven solutions for industrial processes. Utilizing Unity’s real-time 3D engine and cutting-edge AI technologies like deep learning and convolutional neural networks, AI Builder enables the creation of synthetic training data, advanced simulations, and seamless integration into automation systems. This document will guide you through each step of leveraging AI Builder to optimize industrial vision-based applications. ![](/doc/unity/assets/aibuilderui2.png) realvirtual.io AI Builder based on Unity ## AI Builder Workflow [Section titled “AI Builder Workflow”](#ai-builder-workflow) The AI Builder workflow shown in the image outlines the process of creating and deploying AI-based solutions using realvirtual.io AI Builder and Unity. ![](/doc/unity/assets/ai-builderworkflow.png) AI Builder Workflow Here is a breakdown of each step in the workflow: 1. **CAD**: * This step involves designing the product or machine in CAD software. The 3D data generated from this design is used as the foundation for creating synthetic training data. 2. **Generate Training Data**: * Once the CAD data is available, the AI Builder automatically generates 3D, photorealistic, randomized, and annotated training data. * This process is fast, allowing the generation of around 1000 pictures in just 2 minutes. * The training data is saved with associated annotations (such as in `.bmp` or YAML format), and it is ready to be used for training the AI model. * The generated datasets are compatible with multiple training frameworks, providing flexibility in AI model development. 3. **Train**: * With one click, the AI model can be trained using the generated training data within the realvirtual.io environment. * The training pipeline is flexible and supports multiple AI frameworks - while YOLO integration is built-in, the generated datasets can be used with other training pipelines and machine learning frameworks. * The trained AI model is then exported as a standard [ONNX ](https://onnx.ai)model, which is a popular format for machine learning models that allows for interoperability between different platforms. 4. **Test**: * After training, the AI model can be tested within the realvirtual.io Professional platform. * The AI model is tested in a full Digital Twin setup, which includes automation interfaces, PLC systems, robotics, and other components. This ensures that the AI model works as expected in a virtual environment before being deployed to a real-world scenario. 5. **Deploy**: * The trained neural network is then deployed as an executable application that runs on platforms like Windows, Linux, macOS, and iOS or it can be deployed as an ONNX model to a system which is able to run the ONNX model. * This deployment can also include industrial communication interfaces such as S7 TCPIP, OPCUA, ADS, Websocket, MQTT, and more. ## Installation and Prerequisites [Section titled “Installation and Prerequisites”](#installation-and-prerequisites) AI Builder from realvirtual.io is built on **Unity 6** (Unity 6000.0.28f1 or later), requiring a valid Unity license and installation on Windows systems. It delivers a fully prepared project, including a complete AI training and testing pipeline based on Convolutional Neural Networks (CNNs) and PyTorch. ### System Requirements [Section titled “System Requirements”](#system-requirements) * **Unity Version**: Unity 6 LTS (6000.0.28f1 or later) * **Operating System**: Windows (required for AI training pipeline) * **Unity License**: Valid Unity license (Personal or Pro) With just one click, you can run the entire AI process seamlessly. Upon purchasing AI Builder, you will receive detailed instructions on accessing the project and utilizing it for your industrial AI solutions. Besides the downloaded realvirtual.io AI Builder project and a Unity license no additional installation is needed. ## Training Pipeline Flexibility [Section titled “Training Pipeline Flexibility”](#training-pipeline-flexibility) AI Builder is designed with a flexible training architecture that supports multiple AI frameworks: ### Built-in YOLO Integration [Section titled “Built-in YOLO Integration”](#built-in-yolo-integration) For advanced object detection capabilities, AI Builder includes built-in integration with Ultralytics YOLO: 🔗 [YOLO Integration for realvirtual.io AI Builder](https://github.com/game4automation/io.realvirtual.aibuilder-ultralytics) Note **Licensing Notice**: The YOLO integration repository and Ultralytics YOLO are licensed under AGPL-3.0. Please review licensing requirements for commercial use. See [Ultralytics YOLO](/doc/unity/extensions/realvirtual.io-aibuilder/ai-training/ultralytics-yolo/) for detailed licensing information. ### Custom Training Pipelines [Section titled “Custom Training Pipelines”](#custom-training-pipelines) The synthetic training data generated by AI Builder can be used with various machine learning frameworks and training pipelines: * **Standard Formats**: Training data is exported in industry-standard formats (images + annotations) * **Framework Compatibility**: Compatible with TensorFlow, PyTorch, Detectron2, and other popular ML frameworks * **Custom Workflows**: Developers can integrate their own training pipelines using the generated datasets * **External Tools**: Data can be exported for use with cloud-based training services or specialized AI development platforms This flexibility allows you to leverage the power of realvirtual.io’s synthetic data generation while using your preferred AI training approach. # AI Training > Training the Vision AI The AI training process in **AI Builder** involves using synthetic data generated in **Step 1 - Data Recorder** to fine-tune a pre-trained AI model. While AI Builder provides built-in integration with YOLO (You Only Look Once) for real-time object detection, the training pipeline is flexible and designed to work with multiple AI frameworks and training approaches. ## Prerequisites [Section titled “Prerequisites”](#prerequisites) * **realvirtual.io License**: Requires realvirtual.io Starter or Professional edition * **Unity 6**: Unity 6000.0.28f1 or later * **Ultralytics YOLO Pipeline**: Automatically installable through the AI Builder interface ## YOLO Integration and Licensing [Section titled “YOLO Integration and Licensing”](#yolo-integration-and-licensing) Before you can start a training session, you need to install our [Ultralytics](https://docs.ultralytics.com/) pipeline. In the inspector of **Select Step 2 - Training** simply click the install Ultralytics pipeline. The pipeline is open source and released on our [GitHub](https://github.com/game4automation/io.realvirtual.aibuilder-ultralytics). Caution **Important Licensing Notice** The YOLO integration uses Ultralytics YOLO, which is licensed under **AGPL-3.0**. This means: * **Open Source Use**: Free for open source projects under AGPL-3.0 * **Commercial Use**: Requires careful review of licensing terms * **Distribution**: Any software using this integration must comply with AGPL-3.0 requirements For commercial licensing options, please review [Ultralytics licensing terms](https://ultralytics.com/license) or contact Ultralytics directly. For detailed information, see [Ultralytics YOLO](/doc/unity/extensions/realvirtual.io-aibuilder/ai-training/ultralytics-yolo/) documentation. ![](/doc/unity/assets/Screenshot%202025-07-17%20190337.png) ## Training Pipeline Flexibility [Section titled “Training Pipeline Flexibility”](#training-pipeline-flexibility) AI Builder supports multiple training approaches: ### Built-in YOLO Integration [Section titled “Built-in YOLO Integration”](#built-in-yolo-integration) * **One-Click Training**: Integrated YOLO pipeline for immediate object detection model training * **Multiple Model Sizes**: Support for Nano, Small, Medium, Large, and XLarge YOLO variants * **Automatic Configuration**: Pre-configured training parameters optimized for industrial scenarios ### Custom Training Pipelines [Section titled “Custom Training Pipelines”](#custom-training-pipelines) The synthetic training data generated by AI Builder can be used with external training frameworks: * **Standard Export Formats**: Training data exported in industry-standard formats (images + annotations) * **Framework Compatibility**: Compatible with TensorFlow, PyTorch, Detectron2, and other ML frameworks * **Cloud Training**: Data can be exported for use with cloud-based AI training services * **Custom Workflows**: Developers can integrate their own training pipelines and methodologies ## Overview [Section titled “Overview”](#overview) To perform AI training: 1. **Select Step 2 - Training** under **AI Builder**. 2. Use the synthetic data generated in **Step 1 - Data Recorder (Generate AI Training Data)** for training. The built-in training fine-tunes a pre-trained YOLO model, allowing the selection of different model sizes suitable for various applications. 3. Alternatively, export the generated training data for use with your preferred AI training framework. ![](/doc/unity/assets/ai-training.png) AI Training ## AI Training Properties [Section titled “AI Training Properties”](#ai-training-properties) The **AI Training** component has several key parameters and settings that must be configured to initiate the training process: * **Data Folder**:\ Specifies the path to the folder where the recorded training data is stored. This folder should contain the images and annotations generated during **Step 1**. These files are used as input for the training process. * **Base Model**:\ Allows for the selection of a YOLO pre-trained model to serve as the starting point for the training. Various model sizes can be chosen based on the application’s requirements. The options include: 1. **Nano**: * **Description**: The Nano model is the smallest and most lightweight version of YOLO. It has a minimal number of layers and parameters, making it highly efficient for real-time inference on devices with limited computational power, such as embedded systems or mobile devices. * **Use Case**: Ideal for applications where speed is critical and hardware resources are constrained. Suitable for low-power devices, real-time applications, or scenarios where only basic object detection is required. * **Performance**: Fastest inference time but lower accuracy compared to larger models. 2. **Small**: * **Description**: The Small model is slightly larger than the Nano version, with more layers and parameters to improve detection accuracy. It still maintains a relatively low computational footprint, making it suitable for scenarios that require a balance between speed and accuracy. * **Use Case**: Suitable for edge devices that need real-time detection but can afford a bit more computational load than Nano. It’s a good choice for moderately complex tasks on devices like drones or industrial robots. * **Performance**: Faster than larger models with moderate accuracy improvements over Nano. 3. **Medium**: * **Description**: The Medium model offers a more significant improvement in accuracy by utilizing a larger network with more parameters. It requires more processing power than Nano and Small but provides a better balance between performance and accuracy for general-purpose tasks. * **Use Case**: Suitable for desktop GPUs or powerful embedded devices where real-time performance is still required but with a higher accuracy demand. Ideal for applications like automated quality inspection or surveillance. * **Performance**: Offers a good trade-off between speed and detection accuracy. 4. **Large**: * **Description**: The Large model is a more complex version of YOLO, featuring a significantly higher number of layers and parameters. It is designed for scenarios where detection accuracy is crucial, even if it means sacrificing some real-time performance. * **Use Case**: Suitable for systems with powerful GPUs where high accuracy is essential, such as in medical imaging, autonomous driving, or detailed industrial inspection tasks. * **Performance**: Higher accuracy than Medium, but requires more computational resources and has slower inference times. 5. **XLarge**: * **Description**: The XLarge model is the largest and most powerful version of YOLO, with the highest number of layers and parameters. It provides the best detection accuracy at the cost of increased computational demands. * **Use Case**: Ideal for server-grade hardware or cloud-based AI services where maximum accuracy is the priority, and real-time performance is less of a concern. Suitable for complex tasks like high-resolution video analysis, research, or scenarios requiring fine-grained object detection. * **Performance**: Most accurate model but also the slowest in terms of inference speed due to its complexity. #### Summary Table for Base Models [Section titled “Summary Table for Base Models”](#summary-table-for-base-models) | Model | Size & Complexity | Inference Speed | Accuracy | Use Case | | ---------- | ----------------- | --------------- | -------- | ---------------------------------------- | | **Nano** | Very Small | Fastest | Lower | Low-power devices, basic real-time tasks | | **Small** | Small | Faster | Moderate | Edge devices, moderately complex tasks | | **Medium** | Medium | Balanced | Good | General-purpose, desktop GPUs | | **Large** | Large | Slower | High | High-accuracy tasks, powerful GPUs | | **XLarge** | Very Large | Slowest | Highest | Maximum accuracy, server or cloud | * **Model Name**:\ The name assigned to the new model being created and trained. It is used to identify the model within the system, particularly when managing multiple training sessions. * **Epochs**:\ Specifies the number of training epochs. An epoch represents one complete pass through the entire training dataset. Increasing the number of epochs may improve the model’s performance but will also increase training time. Usually, depending on your vision task, you should select something between 30 and 200 epochs. ## Starting the Training [Section titled “Starting the Training”](#starting-the-training) 1. **Choose Data Folder**:\ Set the path to the folder containing the synthetic data generated in **Step 1**. 2. **Configure the Model**: * Select a **Base Model** (YOLO variant) that fits your requirements. * Provide a **Model Name** for easy identification. * Set the desired number of **Epochs** for the training. 3. **Start Training**:\ Click **Start New Session** to begin the training process. The AI model will be trained using the specified settings, updating its parameters with each epoch to improve its performance on the given dataset. ## During the Training [Section titled “During the Training”](#during-the-training) When the training process begins, a Windows command line window will open, displaying the progress of the training session. Note It may take some time before the first training epoch starts, as the system prepares the data and initializes the model. ![](/doc/unity/assets/ai-training-commandline.png) Command line during the training showing the training status For more advanced analysis during training, you can use **TensorBoard** to monitor various metrics. TensorBoard is a powerful visualization tool that provides insights into the model’s performance by displaying: * **Loss and Accuracy Graphs**: Shows how the model’s loss decreases and accuracy improves over time, helping to assess whether the model is learning effectively. * **Scalars**: Provides numerical data such as training speed, memory usage, and other custom metrics. * **Histograms and Distributions**: Visualizes the distribution of weights and biases in the model, indicating how these parameters change during training. * **Graphs**: Displays the computational graph, which helps in understanding the structure and flow of the neural network. Note that **TensorBoard** does not automatically refresh its data during the training process. To see the latest updates, you need to restart TensorBoard periodically for refreshed statistics. For more details on how to use TensorBoard and its various features, you can refer to the [TensorBoard documentation](https://www.tensorflow.org/tensorboard). ![](/doc/unity/assets/ai-tensorboard.png) Tensorboard showing the training statistics ## After the training [Section titled “After the training”](#after-the-training) Once training is complete, you will find the results in the “ONNX” folder. Each trained model will be stored in its own subfolder, containing the trained **ONNX model** and associated files. This ONNX model can now be used in subsequent steps, such as deploying it in a Unity application or exporting it for use in an external inference system. ![](/doc/unity/assets/ai-training-onnx.png) TensorBoard can also be used after training to analyze the results more thoroughly, providing insights into the model’s final performance and areas where additional tuning or retraining may be beneficial. ## See Also [Section titled “See Also”](#see-also) * [Generate AI Training Data](/doc/unity/extensions/realvirtual.io-aibuilder/generate-ai-training-data/) - Creating synthetic datasets * [Ultralytics YOLO](/doc/unity/extensions/realvirtual.io-aibuilder/ai-training/ultralytics-yolo/) - Detailed YOLO integration information * [Testing AI in a Digital Twin](/doc/unity/extensions/realvirtual.io-aibuilder/testing-ai-in-a-digital-twin/) - Model validation * [Deploying the AI](/doc/unity/extensions/realvirtual.io-aibuilder/deploying-the-ai/) - Production deployment # Ultralytics YOLO > YOLO integration for realvirtual.io AI Builder with licensing information The realvirtual.io AI Builder includes built-in integration with Ultralytics YOLO (You Only Look Once) for state-of-the-art object detection capabilities. While YOLO provides fast and accurate real-time object detection for industrial automation scenarios, it represents just one option among many training frameworks that can use AI Builder’s synthetic data. ## Overview [Section titled “Overview”](#overview) YOLO is a popular real-time object detection system that can detect multiple objects in images with high speed and accuracy. While realvirtual.io AI Builder includes built-in YOLO integration for convenience, the synthetic training data generated by AI Builder can be used with various machine learning frameworks including TensorFlow, PyTorch, Detectron2, and other training pipelines. The built-in YOLO integration allows you to: * Train custom YOLO models using synthetic training data * Deploy trained models for real-time object detection * Test models within digital twin environments * Export models in ONNX format for cross-platform deployment For alternative training approaches, the synthetic data can be exported in standard formats for use with your preferred AI framework. ## GitHub Repository [Section titled “GitHub Repository”](#github-repository) The YOLO integration is available as a separate repository that works with realvirtual.io AI Builder: 🔗 [YOLO Integration for realvirtual.io AI Builder](https://github.com/game4automation/io.realvirtual.aibuilder-ultralytics) ## Licensing Information [Section titled “Licensing Information”](#licensing-information) Caution **Important Licensing Notice** This repository includes example pipelines that are licensed under **AGPL-3.0**. Ultralytics YOLO is also licensed under **AGPL-3.0**. If you plan to use this integration for commercial purposes, please review the Ultralytics license conditions carefully. For commercial licensing options, please contact Ultralytics directly or review their licensing terms at . ## Key Features [Section titled “Key Features”](#key-features) ### YOLO Model Variants [Section titled “YOLO Model Variants”](#yolo-model-variants) * **YOLOv8 Nano**: Fastest inference, smallest model size * **YOLOv8 Small**: Balanced speed and accuracy * **YOLOv8 Medium**: Higher accuracy with moderate speed * **YOLOv8 Large**: Best accuracy, larger model size * **YOLOv8 Extra Large**: Maximum accuracy for complex scenarios ### Training Capabilities [Section titled “Training Capabilities”](#training-capabilities) * **Custom Dataset Training**: Train on your specific industrial objects * **Transfer Learning**: Fine-tune pre-trained models * **Synthetic Data Integration**: Use AI Builder generated training data * **Multi-class Detection**: Detect multiple object types simultaneously ### Export Options [Section titled “Export Options”](#export-options) * **ONNX Format**: Cross-platform deployment * **TensorRT**: NVIDIA GPU acceleration * **OpenVINO**: Intel hardware optimization * **CoreML**: Apple device deployment ## Integration Workflow [Section titled “Integration Workflow”](#integration-workflow) 1. **Generate Training Data**: Use realvirtual.io AI Builder to create synthetic training datasets 2. **Choose Training Approach**: * Use built-in YOLO integration for immediate training * Export data for use with external training frameworks 3. **Configure YOLO** (if using built-in integration): Set up YOLO training parameters and model selection 4. **Train Model**: Execute training using the YOLO integration or your preferred framework 5. **Test in Digital Twin**: Validate model performance in virtual environment 6. **Deploy**: Export trained model for production use ## Installation [Section titled “Installation”](#installation) The Ultralytics YOLO integration is automatically handled by AI Builder: ### Automatic Installation [Section titled “Automatic Installation”](#automatic-installation) 1. **Open AI Builder Scene**: Load your AI Builder scene in Unity 2. **Navigate to Training Component**: Select the AI Training component in the Inspector 3. **Install Pipeline**: When you see “Ultralytics training pipeline not found. Please install the package.”, click the **“Install Ultralytics Pipeline”** button 4. **Package Manager**: The Ultralytics dependency will be automatically installed and will appear in Unity’s Package Manager 5. **Ready to Use**: Once installed, the YOLO training capabilities will be available ### Manual Repository Access [Section titled “Manual Repository Access”](#manual-repository-access) For advanced users or custom implementations, the YOLO integration source is available at: * Repository: ## Getting Started [Section titled “Getting Started”](#getting-started) To use the YOLO integration: 1. **Install the pipeline** using the automatic installation method above 2. **Ensure you comply** with the AGPL-3.0 licensing requirements for your use case 3. **Configure your training parameters** in the AI Training component 4. **Start training** with your synthetic training data ## See Also [Section titled “See Also”](#see-also) * [Generate AI Training Data](/doc/unity/extensions/realvirtual.io-aibuilder/generate-ai-training-data/) - Creating synthetic datasets * [Testing AI in a Digital Twin](/doc/unity/extensions/realvirtual.io-aibuilder/testing-ai-in-a-digital-twin/) - Model validation * [Deploying the AI](/doc/unity/extensions/realvirtual.io-aibuilder/deploying-the-ai/) - Production deployment * [AI Training](/doc/unity/extensions/realvirtual.io-aibuilder/ai-training/) - General training information # Deploying the AI > Deploying the AI to external systems with ONNX or run it within a Unity Build After training and testing an AI model within a digital twin environment, the final step is deployment. Deployment involves making the trained model available for real-time inference, where it can be used to perform tasks such as object detection, classification, or decision-making in production environments. There are two primary ways to deploy the AI model: as part of a Unity application or in an external inference system. 1. **Unity Application Deployment**:\ In this approach, the trained AI model is converted to an ONNX (Open Neural Network Exchange) format and included directly in a Unity executable. The Unity app performs the inference using the embedded ONNX model, allowing the AI to process data in real time within the simulation or a deployed Unity application. This method is suitable for scenarios where the entire solution, including AI inference, needs to run as a standalone Unity application, offering an integrated experience with the digital twin. Deployment to a Unity application can be done for any available Unity destination platform by starting a Unity build process. This enables the AI-powered application to be deployed on various platforms, including **Windows**, **Linux**, **macOS**, **Android**, **iOS**, and many more. This cross-platform flexibility ensures that the AI model can be used in a wide range of environments, from desktop applications to mobile devices and specialized hardware. 2. **External Inference System Deployment**:\ Alternatively, the ONNX model can be exported from Unity and used in an external inference system. This setup involves deploying the model on a separate inference platform, such as a cloud-based AI service, an edge device, or a custom-built inference server. The external system can perform the AI computations and send the results back to the Unity application or other control systems. This approach is beneficial for leveraging specialized hardware, integrating with existing AI infrastructure, or scaling inference across multiple devices. ## Deployment blueprint - Camera Device Demo [Section titled “Deployment blueprint - Camera Device Demo”](#deployment-blueprint---camera-device-demo) We provide a simple example application called **CameraDeviceDemo**, which can be found in the main **AI Builder** folder. This app demonstrates how to use a trained ONNX model for real-time inference together with a webcam or an integrated camera on a mobile device, such as a phone or tablet. The **CameraDeviceDemo** app showcases the deployment process by allowing the AI model to perform object detection or classification using live camera feeds. The example app is versatile and can be used on various platforms, supporting real-time inference on desktop systems with webcams or mobile devices equipped with built-in cameras. This flexibility enables quick usage of AI models in different environments, making it easy to test, validate, and utilize the trained model for practical applications in diverse settings. # Generate AI Training Data > Generate synthetic training data for AI vision tasks Creating large, diverse datasets is a crucial step in training AI models, especially for tasks like image recognition, object detection, and classification. However, collecting and labeling real-world data can be time-consuming, costly, and sometimes impractical. This is where **synthetic AI training data** comes in as a powerful alternative. **Synthetic AI training data** involves generating artificial data that mimics real-world conditions. Using simulation environments like Unity and tools such as **realvirtual.io AIBuilder**, developers can create vast amounts of synthetic data by varying parameters such as object position, lighting, textures, and camera angles. This process helps generate robust datasets that improve AI model performance without the need for large, manually-collected datasets. #### Benefits of Synthetic AI Training Data [Section titled “Benefits of Synthetic AI Training Data”](#benefits-of-synthetic-ai-training-data) * **Cost-effective**: Eliminates the need for expensive data collection processes and reduces manual labeling time. * **Control over variables**: Allows developers to adjust conditions like lighting, camera perspective, and object configurations to cover a wide range of scenarios. * **Faster iterations**: Enables rapid creation of diverse training sets, leading to quicker AI model training cycles. * **Enhanced robustness**: By simulating edge cases and varying environments, AI models trained on synthetic data tend to generalize better to real-world conditions. * **Training pipeline flexibility**: Generated datasets are exported in standard formats, making them compatible with various AI training frameworks beyond the built-in YOLO integration. In **realvirtual.io AI Builder**, the **Variators** are responsible for dynamically adjusting various parameters during the training process, helping generate a wide variety of synthetic data automatically. This method allows AI models to learn from a range of inputs and ensures the model performs well under different conditions. ## Components for Training [Section titled “Components for Training”](#components-for-training) The AI Builder Demo scene demonstrates how to create synthetic AI training data and train object detection models using the realvirtual.io AI Builder framework. This demo is designed to showcase key functionalities like camera placement, data recording, and AI model training, using a conveyor belt and sorting system with different colored Lego bricks. ### AI Camera [Section titled “AI Camera”](#ai-camera) The **AI Camera** is a vital component in the synthetic training process. It allows you to position the camera within the scene to capture images from different angles, lighting conditions, and perspectives. The camera’s primary role is to record synthetic data, which is then used for training the AI model. Once set up, the AI Camera continuously captures images of the objects (e.g., bricks) on the conveyor belt, which will be used to train the AI to recognize and sort these objects. The AI Camera is straightforward to use, requiring no additional configuration. Simply place it in the desired position where synthetic images should be generated. ![](/doc/unity/assets/ai-camera.png) AI Camera in the scene ### AIBuilder [Section titled “AIBuilder”](#aibuilder) The **AIBuilder** component is designed to manage the entire process of AI training and data recording. ![](/doc/unity/assets/ai-builder.png) AI Builder main setup (Training, Detection, Deployment) The AI Builder needs to be set to the desired mode, depending on the current stage of your workflow: **Training Mode:** In this mode, synthetic training data can be generated using the AI Camera. Once enough data has been recorded, you can start the training process based on the generated data. This mode is used to prepare and[ train the AI model ](/doc/unity/extensions/realvirtual.io-aibuilder/ai-training/)for object detection. **Detection Mode:** In detection mode, the AI performs object detection based on the previously trained model. The detection is still done using the AI Camera (not a real one), making it ideal for testing and developing the entire AI-based process within a fully digital twin. This allows you to test the detection capabilities and refine the AI integration with PLC and robotics interfaces before deploying it to a physical system. See section [Testing AI in a Digital Twin](/doc/unity/extensions/realvirtual.io-aibuilder/testing-ai-in-a-digital-twin/). Additionally, you can activate the use OBB flag. When activated, the system will use Oriented Bounding Boxes for both data generation and object detection. ![](/doc/unity/assets/Screenshot%202025-07-17%20230356.png) ### ### Training Data Recorder [Section titled “Training Data Recorder ”](#training-data-recorder) The Data Recorder, located under “Step 1 - Data Recorder” in the AIBuilderDemo scene, is responsible for capturing synthetic data that will later be used for training AI models. This component collects labeled data from the scene and saves it into a designated folder. In the scene, the Data Recorder works in combination with the AI Camera and other variators (such as Sky and Light Variators) to create a wide variety of training data. You can configure key parameters like timing, sample count, and validation ratio to control how the synthetic data is generated and stored. ![](/doc/unity/assets/ai-datarecorder.png) Training Data Recorder In the Inspector panel of the Training Data Recorder, you can: * Set **Labels** for the objects being captured (e.g., Lego brick types). * Adjust the **Timing** settings, including **Time Scale** and **Delay** between captures. * Specify the number of **Samples** to collect and the **Validation Ratio** for splitting the dataset. * Choose the folder to **Export** the data to, ensuring the synthetic data is saved for later training use. Additionally, variators such as **Sky** and **Light Variator** are also present to introduce variation in lighting conditions, ensuring the AI becomes robust across different environments. **Starting the Training Process** To begin the AI training process: 1. Open the scene in Unity and ensure that the **Data Recorder** is properly configured with the labels, timing, and samples as needed. 2. Start the scene by entering **Play Mode**. 3. In the **Inspector** panel under the **Data Recorder**, click on **Start Recording**. ![](/doc/unity/assets/ai-startrecording.png) Starting the training in Play mode Once selected, the Data Recorder will begin capturing synthetic data according to the defined settings. The images and their corresponding labels will be saved in the specified folder for later use in training the AI model. ### Variators [Section titled “Variators”](#variators) #### **Sky Variator** [Section titled “Sky Variator”](#sky-variator) The **Sky Variator** is responsible for varying the sky conditions during the synthetic data recording process. By changing the sky settings, the AI model is exposed to different lighting conditions, making it more robust to real-world variability. In the **Inspector**, you can configure the following options: * **Apply On Init**: Enables the sky variation when the recording starts. * **Apply On Snapshot**: Applies the sky variation each time a snapshot of synthetic data is recorded. * **Step**: Defines the number of different sky conditions that will be applied during the recording. #### **Light Variator** [Section titled “Light Variator”](#light-variator) The **Light Variator** is responsible for adjusting the lighting conditions during data recording, helping to expose the AI to various lighting intensities and temperatures. In the **Inspector**, you can configure the following options: * **Apply On Init**: Enables light variation at the start of the recording. * **Apply On Snapshot**: Applies light variation during each snapshot. * **Min/Max Intensity**: Defines the range of light intensity that will be applied. * **Min/Max Temperature**: Defines the range of light temperature (from cooler to warmer tones) to be used. * **Light**: Specifies the light source to be varied, such as the sun in the scene. ![](/doc/unity/assets/AI-sourcevariator.png) Object and Transform Variator on the Source **Object Variator**: * **Apply On Init**: This option is unchecked, meaning the variation of objects will not happen immediately when the scene starts. * **Apply On Snapshot**: This option is unchecked, indicating that variations won’t automatically occur when snapshots are taken. * **Objects**: There are four types of objects configured for variation: * **2x2 Brick** * **3x2 Brick** * **4x2 Brick** * **6x2 Brick** * **Weights**: Each object has an equal weight of 0.25, meaning each object has an equal chance of being selected during the variation process. **Transform Variator**: * **Apply On Init**: Checked, meaning that variations in position, rotation, and scale will be applied when the scene is initialized. * **Apply On Snapshot**: Unchecked, so variations will not happen automatically with each snapshot. * **Position Variation**: The position of the object can vary between -0.5 and 0.5 units on each of the X, Y, and Z axes. * **Rotation Variation**: The object’s rotation can vary by up to 360 degrees along the X, Y, and Z axes. * **Scale Variation**: The object’s scale remains fixed (no scaling variation), as indicated by the zero values for scale variation. ### Making objects detectable [Section titled “Making objects detectable”](#making-objects-detectable) When AI Builder is recording training data, it needs to know which objects belong to which class and looks at their bounding boxes to generate appropriate annotation for the training data. #### Detectables [Section titled “Detectables”](#detectables) In order to make an object detectable (e.g a brick), it requires the Detectable component. You can add the Detectable component to any 3D object. ![](/doc/unity/assets/Screenshot%202025-07-17%20193036.png) Once the detectable is added, you can compute the 3D bounds of the object by clicking the respective button in the inspector of the detectable component. The computed bounds are then shown as yellow gizmo box encapsulating the object. Later in the process, these 3D bounds will be projected in the 2D space of the AiCamera and used as the bounding box for data labelling when recording training data. ![](/doc/unity/assets/Screenshot%202025-07-17%20192934.png) Additionally to computing the bounds of the target object, the system also needs information on the class label of the object. In order to define such class labels, you first need to generate a LabelDefinition object. In your project window, right click and navigate to Create > realvirtual > AiBuilder > LabelDefinition. This generates the LabelDefinition object. ![](/doc/unity/assets/Screenshot%202025-07-17%20193936.png) In the inspector of the LabelDefinition object, you can define your classes, name them and give them a color. Once your LabelDefinition object is set up, you need to add a label condition to your detectable object. The standard label condition is the FixedCondition. This Component gives your detectable object a fixed class label. Other components such as the OrientationCondition switches the class label of the object based on its rotation/orientation. This can for instance be useful if you want to detect if the bricks are facing upwards or if they are flipped. ![](/doc/unity/assets/Screenshot%202025-07-17%20194928.png) In the FixedCondition component you can set the class id of your object. This id is an integer representing the index of the respective class in the LabelDefinition object mentioned above. Following these steps your detectable object is ready. The system will recognize it and automatically label it during data recording. In play mode, with the system set to training mode, you can verify your set up throgh the Data Recording preview. You should see an encapsulating bounding box in the respective color, labeled with the class name defined in your LabelDefinition. ![](/doc/unity/assets/Screenshot%202025-07-17%20195752.png) # realvirtual.io AI Builder Overview The **AI Builder** can be found in the Unity Packages directory under **realvirtual-AIBuilder**. This directory includes several key components and demo scenes. Below is an overview of the folder structure and its contents. ![](/doc/unity/assets/Screenshot%202025-07-17%20191133.png) AI Builder Structure The Demo folder contains example scenes that demonstrate how to use AI Builder for various tasks, such as object detection and automation. These scenes showcase how AI models can be trained, tested, and deployed for virtual commissioning. The source folder contains the prefabs to set up an AI Builder Scene. See the respective section for their documentation. ![](/doc/unity/assets/Screenshot%202025-07-17%20191433.png) ## **AI Builder Demo scene** [Section titled “AI Builder Demo scene”](#ai-builder-demo-scene) This scene demonstrates the full AI workflow using a brick sorting system. In the demo, four different types of bricks are detected and automatically sorted into four corresponding boxes by a robotic arm. The scene can be used for: * **Data Generation**: Generating synthetic, labeled data for AI model training. * **Training**: Preparing the AI model to recognize different types of bricks. * **Testing**: Verifying the model’s detection capabilities within a virtual environment (Digital Twin). * **Virtual Commissioning**: Testing the real robot control system in conjunction with the trained AI model to ensure accurate sorting in real-world conditions. ## **CameraDeviceDemo scene** [Section titled “CameraDeviceDemo scene”](#cameradevicedemo-scene) The **CameraDeviceDemo** scene is designed for real-world detection tasks using a trained **ONNX** model from the **AI Builder** demo. In this scene, you can perform object detection (inference) by leveraging live video input from a device camera, such as a webcam. This scene extends the functionality of AI Builder from simulated environments into real detection scenarios. ## Folders [Section titled “Folders”](#folders) The **LabelConditions** folder contains label definitions and conditions that are used during the training process. These labels represent the categories that the AI model needs to recognize, such as different types of objects or Lego bricks in the demo. The **ONNX** folder contains **ONNX** models, which are pre-trained or exportable AI models used for object detection and recognition. The AI Builder leverages the ONNX format for running AI inferences within Unity, allowing the system to make real-time decisions based on visual data. The **Variators** folder contains a collection of scripts that are designed to introduce variations into the training process. These variations help in generating large amounts of synthetic AI training data, making the AI model more robust and better equipped to handle real-world scenarios with diverse data. The **Demo** folder contains all the assets and scripts required to run the demo scenes in realvirtual.io AI Builder. These assets showcase the core functionalities of AI Builder, including object detection, sorting, and AI training within Unity. # Testing AI in a Digital Twin > Virtual commissioning and testing of the entire AI-driven process ## Introduction [Section titled “Introduction”](#introduction) After training an AI model, the next (optional) step is to test the model within a digital twin environment. This step involves using the AI model to perform object detection in real-time to evaluate its accuracy and performance in recognizing objects or patterns. Testing can be conducted in a comprehensive digital twin environment that simulates various industrial and automation components, including PLC interfaces, robotics, drives, sensors, and more. In the provided Lego example, the AI detection system is used to track Lego bricks and sort them into designated boxes. The testing process begins with the AI performing object detection to identify Lego bricks in the scene, recognizing their position and classifying their type or color. The system then continuously tracks the detected bricks across frames, maintaining information about their positions and identities. Testing within a digital twin environment offers several benefits. It provides a safe, simulated space to test AI algorithms before real-world deployment, ensuring that the trained model performs as expected. It also allows for integration testing, verifying that the AI system works seamlessly with other components, such as PLCs, robots, and sensors. Additionally, it provides an opportunity to fine-tune the AI model and system parameters to optimize performance before actual deployment. ![](/doc/unity/assets/ai-detectionmodel.png) Object detection and tracking in the Digital Twin ## Object Detection [Section titled “Object Detection”](#object-detection) The **Object Detection** script is responsible for identifying objects within the digital twin environment using a trained AI model. The configuration properties for this component include: * **Model**:\ The trained AI model asset used for detection. In this example, the model is set to `lego-demo-n`, which has been trained before in [AI Training](/doc/unity/extensions/realvirtual.io-aibuilder/ai-training/). * **Labels**:\ The label definitions associated with the model, such as `LegoLabels`. These labels specify the classes that the model can recognize (e.g., different types of objects or components) and the colors for the classes used in the Detection preview. ![](/doc/unity/assets/ai-lagels.png) Labels used for object detection * **Backend**:\ Specifies the computational backend used for running the detection. It can be set to `CPU` or `GPU`, depending on the available hardware and performance requirements. Note Please note for GPU CUDA needs to be installed * **Confidence**:\ The confidence threshold for detecting objects. The AI will only recognize objects with a confidence score equal to or above this value. For example, if set to `0.25`, only detections with at least 25% confidence will be considered valid. * **Margin**:\ Defines additional margin settings for the detection area: * **X**: The horizontal margin. * **Y**: The vertical margin. These margins can be adjusted to expand or contract the area considered for detection. Margin of 0.1 means 10% of camera side length. * **Detections**:\ Indicates the number of detected objects. You can open the table for more information about the detections. ## Object Tracker [Section titled “Object Tracker”](#object-tracker) The **Object Tracker** script manages the tracking of detected objects across multiple frames, maintaining their identity over time. The configuration settings include: * **Tracking Parameters**:\ Several parameters control the tracking algorithm: * **Required Frames**: The minimum number of frames an object must be detected to be considered a valid tracked object. * **Max Missing Frames**: The maximum number of frames an object can be undetected before it is considered lost. * **Max Distance X / Max Distance Y**: The maximum distance (in X and Y directions) that an object can move between frames to still be considered the same object. * **Box Loss Weight**: A weight factor used in the tracking algorithm for the bounding box size. * **Horizontal Loss Weight / Vertical Loss Weight**: Weight factors used to prioritize tracking accuracy in horizontal and vertical directions, respectively. * **Tracked Objects**:\ Displays information about currently tracked objects, including: * **Time Stamp**: The current time frame or step in the simulation. * **Ids**: Unique identifiers assigned to tracked objects. * **Centers**: The central position of the tracked objects in the scene. * **Sizes**: The size of each detected object’s bounding box. * **Labels**: The class label of each detected object. ## AI Tracking PLC Interface [Section titled “AI Tracking PLC Interface”](#ai-tracking-plc-interface) The **AI Tracking PLC Interface** script integrates AI-based tracking with a Programmable Logic Controller (PLC) to enable real-time automation control based on visual data. * **Active**:\ Indicates when the AI Tracking PLC Interface is active. In this case, it is set to **Always**, meaning the interface is continuously monitoring and sending tracking information. * **Signal Tracking**:\ Specifies the PLC input or signal that is used for tracking purposes. For example, `DemoSignalTrackingToPLC` represents a signal that communicates object tracking data to the PLC. In the Example all tracking data is send as a JSON to the PLCInputText signal. * **Debug Mode**:\ Enables or disables debugging logs. When enabled, additional information about the tracking and PLC interface is logged, which can help with troubleshooting. # realvirtual.io Industrial Metaverse (Deprecated) > Sepping into the Industrial Metaverse Danger **Deprecated — moving to realvirtual WEB.** The Unity-based XR (VR/AR) and Multiuser modules of the Industrial Metaverse extension are deprecated. Immersive viewing and collaboration now run in **[realvirtual WEB](/doc/unity/extensions/realvirtual-web/)**, which delivers your digital twin to any browser with built-in **WebXR (VR/AR)** support and browser-based multiuser sessions — one link, any device, no installation and no XR toolchain setup. Caution The **realvirtual.io Industrial Metaverse** package, which is available on the [Unity Asset Store](https://assetstore.unity.com/packages/tools/integration/realvirtual-io-industrial-metaverse-2022-277602), provides XR, AR, and Multiuser functionalities as an extension to realvirtual.io Professional. It’s crucial to ensure version compatibility between realvirtual.io Professional and realvirtual.io Industrial Metaverse (e.g., both should be version 2022.12) for optimal performance and stability. Installing and using AR and VR devices in Unity can often be complex due to the wide range of solutions, frameworks, and packages.**realvirtual.io Industrial Metaverse** simplifies this process, offering nearly a one-click installation that automatically includes all necessary dependencies and development frameworks. **realvirtual.io Industrial Metaverse** empowers developers with user-friendly tools and frameworks to effortlessly port realvirtual.io Digital Twin experiences onto **Meta Quest 3** (and soon Apple Vision Pro) devices. Moreover, it introduces robust multiuser capabilities, enabling the creation of dynamic, interactive scenes where users can collaborate, interact, and share experiences in real-time. Key features of **realvirtual.io Industrial Metaverse** include: * Compatibility with realvirtual.io Drives, MUs, Sources for dynamically moving, placing, and zooming industrial components during simulation mode. * Simplified drag-and-drop VR and AR user interfaces and navigation elements, ready to use out of the box. * Multiuser communication capabilities within local industrial networks, enabling synchronization across different models similar to a multiplayer game setup. [](/doc/unity/assets/vlc_4Ad5DxMdVO.mp4) AR Application with realvirtual.io XR ## Hardware requirements [Section titled “Hardware requirements”](#hardware-requirements) Apple Vision Pro. The multiuser functionality is compatible across various devices, including Windows and within the Unity Editor, allowing for flexible usage scenarios. ## Package Overview [Section titled “Package Overview”](#package-overview) ![](/doc/unity/assets/Screenshot%202024-03-06%20031054.png) Package content ### Package Structure [Section titled “Package Structure”](#package-structure) **realvirtual.io Industrial Metaverse** can be found in the Unity folder realvirtual-XR. It is structured into key modules that cater to various aspects of XR development, ensuring users have access to all necessary tools for their projects. Here’s an overview of the primary components. ### Scenes [Section titled “Scenes”](#scenes) The package includes several demo scenes that showcase the capabilities of Realvirtual.io XR & Multiuser. These demos are designed to provide a hands-on experience, demonstrating how to implement various features within your XR projects. * **DemoMultiuser**: This scene highlights the multiuser networking capabilities, showing how multiple users can interact with each other and the virtual environment in real time. * **DemoRealvirtualAR**: Focuses on augmented reality features, illustrating how digital content can be superimposed over the real world to create immersive AR experiences. * **DemoRealvirtualVR**: Dedicated to virtual reality, demonstrating the immersive VR environments that can be created, along with detailed interactions and realistic physics. #### Prefabs [Section titled “Prefabs”](#prefabs) Prefabs are essential components within Realvirtual.io XR & Multiuser, providing ready-made objects that can be easily customized and integrated into your projects. #### Features [Section titled “Features”](#features) Realvirtual.io XR & Multiuser is equipped with a wide array of features designed to facilitate the creation of XR projects that are both immersive and interactive. Below are some of the core features that users can leverage: **Networking** * **Seamless Multiuser Support:** Enables multiple users to join and interact within the same virtual environment, across various platforms. * **Real-Time Synchronization:** Ensures that all users’ actions and interactions are updated and visible to others in real-time. **Augmented Reality (AR)** * **AR Object Placement:** Users can place and manipulate digital objects in the real world. * **AR Navigation:** Incorporate real-world navigation and object recognition to enhance user interaction. **Virtual Reality (VR)** * **Immersive Environments:** Create detailed and immersive virtual environments that users can explore. * **Realistic Physics:** Apply real-world physics to objects in the VR space for more natural interactions. These features, combined with the included demos and prefabs, provide a comprehensive toolkit for developers to create advanced XR applications. For more information and documentation, visit our website: [Realvirtual.io](https://realvirtual.io) *** © 2025 realvirtual GmbH - All rights reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or by any means, including printing, saving, photocopying, recording, or other electronic or mechanical methods, without the prior written permission of the publisher. # AR Modules (Deprecated) Danger **Deprecated — moving to realvirtual WEB.** The Unity-based AR modules are deprecated. Augmented viewing now runs in **[realvirtual WEB](/doc/unity/extensions/realvirtual-web/)** with built-in **WebXR** support — open your digital twin in a browser and enter AR on any compatible device, no Unity build and no XR toolchain setup. This page describes how to use the AR modules of the [Realvirtual.io XR & Multiuser](/doc/unity/extensions/realvirtual.io-industrial-metaverse/) extension in your realvirtual scene. Make sure you have correctly set up your device as described in the [Setup Guide](/doc/unity/extensions/realvirtual.io-industrial-metaverse/setup-guide/). [Example application created with Meta Quest 3 ](https://www.youtube-nocookie.com/embed/JIZQmuc4O2Y) Example application created with Meta Quest 3 ## realvirtual-ar-player [Section titled “realvirtual-ar-player”](#realvirtual-ar-player) The realvirtual-ar-player prefab enables AR development in your scene. ![](/doc/unity/assets/Screenshot%202024-03-06%20070926.png) Search for **realvirtual-vr-player** and simply drag the prefab into your hierarchy. This initializes the AR development environment in your scene. * The **OVRPlayerController** manages device tracking and user Input detection. Please refer to the official documentaion of the [Meta XR SDK](https://developer.oculus.com/documentation/unity/unity-gs-overview/).\\ * The **PlayerUI** holds the main AR user interface enabling the user to trigger various functionalities.\ The player can toggle the main user menu by pressing the **A** button on the right controller.\ Besides the functionality described in [VR Modules](/doc/unity/extensions/realvirtual.io-industrial-metaverse/vr-modules/), the main menu in AR has some additional features described below.\ \ ![](/doc/unity/assets/Screenshot%202024-03-06%20071510.png)\ \ \ ![](/doc/unity/assets/meshtoggle%20\(1\).png)This button toggles the scene mesh. This is the mesh placeable objects can be placed on.\ \ ![](/doc/unity/assets/depth%20\(1\).png)This button toggles depth occlusion. In order to use depth occlusion a separate installation of the Meta Depth API for Unity is required. Please refer to the official [Installation Guide](https://developer.oculus.com/documentation/unity/unity-depthapi/). Once the Meta Depth API is installed navigate to File > Build Settings > Player Settings > Other Settings > Script Compilation, add the `META_DEPTH_API` compile switch and press Apply.\\ ![](/doc/unity/assets/Screenshot%202024-03-06%20072537.png) Adding compile switch for depth occlusion * The **Passthrough** object contains the OVR Passthrough Layer component required for enabling passthrough. Refer to the official [Meta XR SDK](https://developer.oculus.com/documentation/unity/unity-gs-overview/) for details.\\ * The **Placer** object controlls the behaviour of the placement and allows to adjust the parameters for the placement.\\ * The **TransformManager** persists the transforms of all the placeables in the scene between multiple runtime sessions. To disable this feature, disable the TransformManager game object.\\ * The AR game object contains the OVRSceneManager documented in the [Meta XR SDK](https://developer.oculus.com/documentation/unity/unity-gs-overview/) and the EnvironmentDepthOcclusion game object documented in the [Depth API for Unity](https://developer.oculus.com/documentation/unity/unity-depthapi/). Both objects control interactions with the real world environment.\\ * The **XR Environment** object initializes the scene setup for optimal use with VR or AR. It manages lighting and core environmental aspects such as ground and sky. # Multiuser (Deprecated) > Multiuser Functionality in realvirtual.io Danger **Deprecated — moving to realvirtual WEB.** The Unity-based multiuser system (Mirror networking) is deprecated. Real-time multiuser collaboration now runs in **[realvirtual WEB](/doc/unity/extensions/realvirtual-web/)** via the browser-based **MultiplayerWEB** relay: shared avatars, camera positions and live machine state across Unity and any browser client — one link, any device, no networking setup. ## Overiew [Section titled “Overiew”](#overiew) realvirtual.io offers multiuser functionality, enabling seamless collaboration and synchronization across multiple computers or running Unity instances. This feature synchronizes drive positions, signals, and multi-user (MU) positions between a designated host and connected clients. Here’s how it works: **Key Features:** * **Synchronization:** All drive positions, signals, and MU positions are synchronized between the host and clients in real-time. * **Host Configuration:** There is always one designated host in the system responsible for physics simulation, including collision detection and resolution. * **Networking Setup:** Currently utilizes Mirror networking framework (visit [Mirror](https://mirror-networking.com)) for local network communication, ensuring efficient data exchange within local environments. Note Development is underway for a Socket.io-based communication layer, expanding connectivity capabilities beyond local networks. This upcoming feature will enable cross-boundary communication, facilitating connections across different networks and environments. ## First steps with the demo model [Section titled “First steps with the demo model”](#first-steps-with-the-demo-model) For a quick start, we recommend using the demo model located at Assets/realvirtual-XR/DemoMultiuser.unity. Follow these steps: 1. **Compile the Demo Model to Build:** * Add the demo scene to the build settings in Unity. * Build the project as a Windows executable. 2. **Connecting to Unity Editor:** * Start the built executable. * Switch to client mode using the UI at the bottom of the screen by selecting “Client”. * The scene will operate in standalone mode until a host joins. ![](/doc/unity/assets/xr-demoscene%20\(1\).png) Demo scene as windows build in client mode, waiting for a host connection Note For more advanced users and custom development, consider using Parallelsync, available on GitHub at [ParrelSync](https://github.com/VeriorPies/ParrelSync). Parallelsync allows running multiple Unity instances on the same project simultaneously. However, for basic functionality, compiling the build as instructed above is sufficient. Now start the same scene in your Unity editor and switch, if necessary, to “Host” mode. Once the client is connected, you will see a message similar to this:\\ ![](/doc/unity/assets/image%20\(19\).png) Message on the host after client is connected Now you can control the scene in the Unity editor. For instance, move some MUs using your mouse in scene mode, and you will see that the client exactly follows these positions. ## Multiuser components [Section titled “Multiuser components”](#multiuser-components) ### Multiuser Connection [Section titled “Multiuser Connection”](#multiuser-connection) The main component of the multiuser functionality is the “MultiuserConnection,” which is available as a prefab located at `Assets/realvirtual-XR/MultiuserConnection.prefab`. #### Imverse Controller [Section titled “Imverse Controller”](#imverse-controller) Within this prefab, the “ImverseController” automatically adds “Imverse” components to all necessary components in the scene that require synchronization. This process occurs dynamically based on whether the client is entering as a host or when clients are connecting to the host. #### Imverse Communication Mirror [Section titled “Imverse Communication Mirror”](#imverse-communication-mirror) The “ImverseCommunicationMirror” component within the Multiuser Connection handles the Mirror connection setup. Here’s how you can configure it: * **IsHost:** Set this to true if you want this instance to act as the host. Set it to false if it should act as a client. * **AutoConnect:** When enabled on the client side, it automatically attempts to connect to a host when the application starts. * **Network Address:** On the client side, specify the network address where the host is running. For example, use “127.0.0.1” for localhost. This setting is ignored on the server side. ### Imverse Components [Section titled “Imverse Components”](#imverse-components) Once the connection is established, components such as Drives in the scene are equipped with an additional “ImverseDrive” component. These components manage key information including an ID (e.g., /ConveyorBox) and a Status (e.g., “Owner”). The ID uniquely identifies synchronized components based on their path within the scene. It’s crucial to maintain unique naming conventions within each path to avoid conflicts. This uniqueness is automatically verified at the simulation’s start, and any issues with non-unique naming are logged in the console. When a component acts as an owner, it sends information to all connected clients. Conversely, if a component acts as a consumer, it receives information from the owner. The following Imverse Components are available: * **ImverseDrive**: Added to all Drives for syncing their position, represented as a float value. * **ImverseMU**: Added to all MUs (Moving Units) for syncing their position (Vector3) and rotation (Quaternion). * **ImverseUser**: Added to the User, syncing their position and rotation. The position of the local User is always synchronized to the camera’s position in the local instance. For other users, their positions are synchronized to their respective positions. * **ImverseSignal**: Syncs signal values across connected instances. These Imverse components facilitate seamless synchronization of positions, rotations, and signals across the networked environment, ensuring consistent simulation experiences for all connected users. ### Multiuser Connection Status [Section titled “Multiuser Connection Status”](#multiuser-connection-status) The “MultiuserConnectionStatus” prefab, found at Assets/realvirtual-XR/MultiuserConnectionStatus.prefab, serves as a UI display element for managing Client and Host modes within your scene. To integrate this prefab, simply drag it into your scene where required. This prefab is responsible for managing Host and Network settings within the “ImverseCommunication.” If you opt not to use this prefab, you’ll need to manually configure these settings within the Multiuser Connection component. # Setup Guide (Deprecated) Danger **Deprecated — moving to realvirtual WEB.** This Unity XR toolchain setup is deprecated. XR (VR/AR) viewing now runs in **[realvirtual WEB](/doc/unity/extensions/realvirtual-web/)** via built-in **WebXR** — no device SDKs, XR plugins or framework installation required; open your exported digital twin in a browser and enter VR/AR on any compatible headset or device. ## XR Setup [Section titled “XR Setup”](#xr-setup) This guide will help you through the basic setup process for your XR (Extended Reality) system, including Virtual Reality (VR) and Augmented Reality (AR) components. Follow the steps below to ensure a successful installation. **Requirements for VR Modules** Ensure that you have a Meta Quest 2 or 3 headset. These are currently among the most popular and widely supported VR headsets for both gaming and professional applications. **Requirements for AR Modules** Ensure that you have a Meta Quest 3 headset. It is currently among the most popular and widely supported VR headsets for both gaming and professional applications. ## Prepare Meta Quest Account and Meta Quest Device settings [Section titled “Prepare Meta Quest Account and Meta Quest Device settings”](#prepare-meta-quest-account-and-meta-quest-device-settings) ### 1. Meta Developer Account Setup [Section titled “1. Meta Developer Account Setup”](#1-meta-developer-account-setup) To deploy applications to your Meta Quest 3, it is essential to have a Meta Developer Account. Follow these steps to set up your account and ensure proper permissions for deploying Unity applications. 1. **Account Creation or Login:** * Visit [Meta Auth Portal](https://auth.meta.com/) to create a new account or log in to an existing one. 2. **Account Configuration on Meta Quest 3:** * Add your developer account to the Meta Quest 3 device. * Ensure that the account possesses admin privileges, particularly for Unity app uploads. ### 2. Developer Mode Activation [Section titled “2. Developer Mode Activation”](#2-developer-mode-activation) Developer Mode needs to be activated on your Meta Quest 3 to enable development features and app deployment. The Meta Quest mobile app is required for this process. 1. **Meta Quest App Installation:** * Install the Meta Quest App on your mobile phone from the respective app store. 2. **Activate Developer Mode:** * Follow the detailed instructions provided here to activate Developer Mode on your Meta Quest 3 via the Meta Quest App. ### 3. Meta Quest Developer Hub Installation - optional [Section titled “3. Meta Quest Developer Hub Installation - optional”](#3-meta-quest-developer-hub-installation---optional) The Meta Quest Developer Hub is a crucial tool for managing your development workflow, including app deployment and performance monitoring. 1. **Device Connection:** * Connect your Meta Quest 3 to your PC using a compatible USB cable. 2. **Software Installation:** * Download and install the Meta Quest Developer Hub from [Meta Quest Developer Hub](https://developer.oculus.com/meta-quest-developer-hub/). ### 4. USB Driver for Debugging (Windows) - optional [Section titled “4. USB Driver for Debugging (Windows) - optional”](#4-usb-driver-for-debugging-windows---optional) For adb (Android Debug Bridge) debugging on Windows, the Google USB Driver is required. This driver facilitates the connection and communication between your Meta Quest 3 and the PC. 1. **Driver Download and Installation:** * Download the Google USB Driver from [Google USB Driver](https://developer.android.com/studio/run/win-usb). * Follow the installation instructions provided on the website. ### 5. Add Android Build Support [Section titled “5. Add Android Build Support ”](#5-add-android-build-support) **Unity Hub**: Use UnityHub to add Android build support to your specific Unity version. ### 6. Switch to Android Platform [Section titled “6. Switch to Android Platform ”](#6-switch-to-android-platform) Make sure your project is configuredto build for android. Navigate to File > Build Settings and switch to the android platform. ![](/doc/unity/assets/Screenshot%202024-03-08%20121200.png) ## **Setting the Renderpipeline to Universal Render Pipeline** [Section titled “Setting the Renderpipeline to Universal Render Pipeline”](#setting-the-renderpipeline-to-universal-render-pipeline) For Meta Quest XR and AR, use the URP. Our XR and AR examples are URP-based. Switch to URP via `Tools > realvirtual > RenderPipeline > Switch to Universal Render Pipeline (URP)` in the main menu. Find more on render pipelines in the [Render Pipelines](/doc/unity/advanced-topics/render-pipelines/) documentation. Once your Setup is complete your projectis ready to use the [VR Modules](/doc/unity/extensions/realvirtual.io-industrial-metaverse/vr-modules/) and the [AR Modules](/doc/unity/extensions/realvirtual.io-industrial-metaverse/ar-modules/). ## Import the realvirtual.io Industrial Metaverse package [Section titled “Import the realvirtual.io Industrial Metaverse package”](#import-the-realvirtualio-industrial-metaverse-package) 1. Import the .unitypackage file to your Assets folder and make sure to select all the required content. You will be asked to install package dependencies. Press Install/Upgrade and in the importer window make sure to select all the required content.\ \ ![](/doc/unity/assets/Screenshot%202024-03-07%20175533.png)\ \ ![](/doc/unity/assets/Screenshot%202024-03-07%20180218.png)\\ 2. Once all the Assets are imported, restart the editor. The editor should prompt you to restart a second time in order to initialize the Meta XR SDK.\ \ ![](/doc/unity/assets/Screenshot%202024-03-07%20180849.png)\\ ## # VR Modules (Deprecated) Danger **Deprecated — moving to realvirtual WEB.** The Unity-based VR modules are deprecated. Immersive VR viewing now runs in **[realvirtual WEB](/doc/unity/extensions/realvirtual-web/)** with built-in **WebXR** support — open your digital twin in a browser and enter VR on any headset, no Unity build and no XR toolchain setup. This page describes how to use the VR modules of the [Realvirtual.io XR & Multiuser](/doc/unity/extensions/realvirtual.io-industrial-metaverse/) extension in your realvirtual scene. Make sure you have correctly set up your device as described in the [Setup Guide](/doc/unity/extensions/realvirtual.io-industrial-metaverse/setup-guide/). [](/doc/unity/assets/Videoprojekt%201.mp4) Some of the basic VR functionalities ## realvirtual-vr-player [Section titled “realvirtual-vr-player”](#realvirtual-vr-player) ![](/doc/unity/assets/Screenshot%202024-03-06%20034553.png) The realvirtual-vr-player prefab enables VR development in your scene. Search for **realvirtual-vr-player** and simply drag the prefab into your hierarchy. This initializes the VR development environment in your scene. * The **OVRPlayerController** manages device tracking and user Input detection. Please refer to the official documentaion of the [Meta XR SDK](https://developer.oculus.com/documentation/unity/unity-gs-overview/).\\ * The **PlayerUI** holds the main VR user interface enabling the user to trigger various functionalities.\ The player can toggle the main user menu by pressing the **A** button on the right controller.\ \ ![](/doc/unity/assets/Screenshot%202024-03-06%20041728.png)\ \ The user can switch between 3 operational modes allowing either to navigate in the scene or to reposition placeable objects. Placeables are a special type of object that can be moved, rotated and scaled in VR and AR at runtime. For further information on placeables please refer to\ \ ![](/doc/unity/assets/walk%20\(1\).png) In the navigation mode, the user can move around the scene and rotate the view using the thumbsticks on the controllers.\ \ ![](/doc/unity/assets/placemesh%20\(1\).png) In the scene placement mode, the user can pick placeable objects and place them on predefined scene meshes. Any game object in the layer **rvSceneMesh** having a collider is recognized for placement.\ \ ![](/doc/unity/assets/placefree%20\(1\).png) In the free placement mode, the user can pick placeable objects and place them freely. The picked object follows the players hand movement. This mode allows high precision placements.\ \ In both placement modes, the controller thumbsticks can be used to rotate and scale the object during placement.\ \ \ Further buttons and toggles enable additional features:\ \ ![](/doc/unity/assets/scale1%20\(1\).png) This button resets the scale of each placeableobject in the scene.\ \ ![](/doc/unity/assets/hide%20\(1\).png) This toggle hides or shows a predefined overlay object. This feature is used to quickly toggle some parts of the scene.\ \\ * The **Placer** object controlls the behaviour of the placement and allows to adjust the parameters for the placement.\\ * The **TransformManager** persists the transforms of all the placeables in the scene between multiple runtime sessions. To disable this feature, disable the TransformManager game object.\\ * The **XR Environment** object initializes the scene setup for optimal use with VR or AR. It manages lighting and core environmental aspects such as ground ans sky. ## Placeable Objects [Section titled “Placeable Objects”](#placeable-objects) Placeable objects are game objects that can be moved, rotated and scaledat runtimein VR and AR. Their transforms are persisted across multiple runtime sessions. The previous section describes how the placeables can be manipulated by the user. In this section, the structure and setup of placeable objects is described. #### Placeable Object Structure and Setup [Section titled “Placeable Object Structure and Setup”](#placeable-object-structure-and-setup) ![](/doc/unity/assets/Screenshot%202024-03-06%20052904.png) The **SelectionFrame** marks the selectable area for picking by the user. The **Content** object holds the actual placeable content. To add a new placeable object simply drag the Placeable prefab into your scene. Add all the gameobjects that sould be affected by this placeable as children under the **Content** game object. ![](/doc/unity/assets/Screenshot%202024-03-06%20065643.png) Sample setup of a placeable object Optionally you can select the SelectionFrame game object and press the recompute button to recompute the bounds of the selection area. To preview the selection area activate the **Visual** child game object of SelectionFrame. # VR Builder With VR Builder’s production-ready toolkit, you can define workflows, implement interactions, and have a working prototype ready within minutes. Whether you’re creating VR training, product demos, or other immersive experiences, VR Builder provides the perfect solution. By leveraging VR Builder’s user-friendly graphical interface, you can significantly reduce development time and streamline processes, allowing you to focus on creating high-quality VR content faster and more efficiently. VR Builder is designed specifically for VR training applications, making it an ideal add-on solution. You can get VR Builder on the Unity Asset Store: [VR Builder - Open Source Toolkit for VR Creation](https://assetstore.unity.com/packages/tools/visual-scripting/vr-builder-open-source-toolkit-for-vr-creation-201913). [VR Builder and realvirtual](https://www.youtube-nocookie.com/embed/gk6IIjuwH2w) VR Builder and realvirtual ## Steps for Setting up VR Builder [Section titled “Steps for Setting up VR Builder”](#steps-for-setting-up-vr-builder) **1. Get VR Builder from the Unity Asset Store** * Open the Unity Asset Store and search for **“VR Builder - Open source toolkit for VR creation.”** * Add it to your asset library. **2. Project Setup** * Open your Unity project. * **Download and import** the VR Builder package into your project. ![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXe3SwbqnnS1TV8E4ZZlHncssv4c47oWcipVNy-2HrB1kOIPrvzP6WngvuGEjwP2K5dbKBFF7lULRC7efk0o108wgC7CedBozlMMmBeIyMoVUlR6xoxSsBcFSkB9q8H7T-EbVD3LWpwSTDuNf0R5AnKMr4Ul?key=aCaNtG-CD2EP5Jw8UatYig) * Confirm to import everything when prompted. * **Restart Unity** when asked.\ ![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXc_v0Dj8S4Kn_yMNbWbQxllW505Asdp9um8GobM981fgnfJR0BWf29xKXW0cLmLOesm790kUyiSqGUWYP1VJgT0UBxQYq4SCipeI7VWEYbgfC-FvH_WjmPBjNudfmYVIGcz5e0ZFTAuEg0hJnk-U771jF_x?key=aCaNtG-CD2EP5Jw8UatYig) **3. Update XR Interaction Layer Mask** * After restarting, Unity will prompt you to update the **XR InteractionLayerMask**. Confirm this update.\ ![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXecJNsfhwwrEBID2ydt5DZvp6HBZHO9B8-qGBJnZwC0UHF5F7WCI_ngJ96Q7rC3C25qAvG_JiAVKNObhORlQStVfimUS-UdcEA0ndSuJLGgWLdCpHOtEydKtJzdeYmxhkus6IkAqoDa9PGXBbQWuRHymhw?key=aCaNtG-CD2EP5Jw8UatYig) **4. Go through the Project Setup Wizard** * During the setup process, you can make choices such as whether to make newly created grabbables ignore physics.\ ![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXeOVEdDPbKYvM704hbFVkzpUoYkB_9PwVv8d1ipQBfac-NOrxNjsksVu1dfd_lcsQZUyF0PngpxJxcVLRN2Fu5tKUQLLXtXZw5je0UEyrz345co7joIQuBfHM9NxIvnHuGuuoDKHSJ0Sf9Vm6a6uVDW9hs?key=aCaNtG-CD2EP5Jw8UatYig) * Select your hardware from the options available. * Uncheck **“Load the demo scene after closing the wizard”** since we don’t need the demo for this setup.\ ![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXdqWFxI18znVUzVw5NUNdUra94YTc_X0vSAm3Gs7KydiCDInGOg-VvZbq7CliluiYYUPLP_PclTiQ110XXbIMzrzqRu7KLZFnWOIqqzIYWOar8L3740OzwEG_3A-NshC0Gg6vyav18YcRTeqC-K3sB6h_c?key=aCaNtG-CD2EP5Jw8UatYig) * Press **Finish** and save the scene when prompted. **5. Fixing Issues during Project Validation** * If any issues arise during the project validation process, click **“Fix All.”** * Unity will recompile the scripts, and the issues should be resolved automatically. *** ## Scene Setup [Section titled “Scene Setup”](#scene-setup) **1. Start the Scene Setup Wizard** * Open the Scene Setup Wizard in VR Builder.\ ![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXcoEeGn11ryLCFIbdSjdnCvJlX_nhqe69i8VRLRYeyqXpKTt1JeqMmxj9iWWDBr0TNBkP5QItaTtWbng0vXWWAATTEom1eRG0s7ef7SY4itd6LYB5JUMp5kU0P1GrEZTreXX42IQAVOicHhsuhVTlORk8eG?key=aCaNtG-CD2EP5Jw8UatYig) * Select **“Take my current scene”** and give your process a name.\ ![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXc9wnO_kRJwZTHnrYlhMjFaBSJ3Bm9gxKJWiZtdgiEukXJHFUUXNDoTAgJ51Jlj91UJ6j3hT2jnikPxRNTy0CfuaVXxy58dNmRAuRwMZ4RDTd3-BvbalZupRwDmw0w16vHBQbZ9JV-v_JvNxO0oPftjL66H?key=aCaNtG-CD2EP5Jw8UatYig) * Press **Finish** to complete the setup. **2. Disable the Main Camera** * In the Unity **Hierarchy** panel, navigate to `realvirtual> Main Camera` and disable it.\ ![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXdGBrsrPHDN-gdAfmFpUcOetHDonvwl98j-jY_4mv-zIwu5d708DL14Bgx69DS_78GSGkHm3wR5ji9be0ji5eGtXEZjGUghR8mHBLRfqzNfwLHqmTE3rleEqJO4uvpTE3hTq9LLHSb4Ct9dNA7qC6b9ub4?key=aCaNtG-CD2EP5Jw8UatYig) Now your scene is ready to work in VR, but you need to add interactivity, such as movement via teleportation. *** ## Adding Teleportation for VR Movement [Section titled “Adding Teleportation for VR Movement”](#adding-teleportation-for-vr-movement) **1. Select Your XR Rig** * In the **Hierarchy**, find and select the XR rig (likely named **“XR\_Setup\_Action\_Based\_Hands”**).\ ![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXe-vC9z-BVkvD9ekb_C8ZYiQQ_CG8_Ht2ZUexADR_GSJ7mz4XKSjxsIapNOoy6dZOt6AnD7UeP2J3JiEbwWyCkd2iCGCHUA4nrCXhphnrAYQxs5tizS2Cb-btwTvV8Sv05z6rVuuVo0f8-74TqdgIGnjx_w?key=aCaNtG-CD2EP5Jw8UatYig) * Move and rotate the rig to set a good starting point for the VR player. **2. Create a Teleportation Area** * **Add a plane** to your scene and name it **“Teleportation Area.”** * ![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXel3Or9wHHXzNvXOkcIa9BLqYxYYlVH5ewoRUxECyi_TP6pgWUE-HzUsI6nc4cn85WhUYV6QXCftlPpRfPWob2HNDCe6SHrkwIazBItE8pETsETSb9sdXB7fMstUOprqep0cVrdJccW_NG4ID5cuKG2HOkn?key=aCaNtG-CD2EP5Jw8UatYig)\\ * Add the **“Teleportation Area (VR Builder)”** component to the plane. **3. Set Layer for Teleportation** * Set the plane’s layer to **#8** (regardless of its name).\ ![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXcf7KNEpiDEABSrUaRzcZXl0QfaCqW6RP9T_HgB-dwD0pWHwaqFT85xBbDYlTu1xQiqWxBFbs-AFhbnDdxNbKVEYaUuMrVe9phG8xSNsrC5l8NCiXGh3DWk0YIWDWNfi68JVn0Sw-WP1vbC5_ZvQmvwTCU?key=aCaNtG-CD2EP5Jw8UatYig) * In the **Teleportation Area** component, set the **Interaction Layer Mask** to the same layer. For simplicity, you can select “Everything,” but specifying the correct layer is recommended for cleaner setups.\ ![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXclAt-0iLv_PQvvmMyYmUEaYOiLsOQ5y-U4ltxHuBeBlfxBORYSpoBFcryo6ncBTz51eYigHudV-4zRmA-EEZt9V9vyYBdqND06iSQ-xVTS0ELRM_aPz6-Owz14KN0kLnmtTay0BZToxlMjqXd3tWLTSySz?key=aCaNtG-CD2EP5Jw8UatYig) **4. Disable Mesh Renderer** * Disable the **Mesh Renderer** on the plane so that the teleportation area is functional but not visible in the scene.\ ![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXdyyGCUfSh2_NBY6nquclB0akKpHaZD54GzSKdimMTJUi38oo_qjlysxU111tpLjuBj52ipXl_ZcB7SP7_7Y4WfWD8Xow2Fh_HyJBEE0JAIF0XUqbUstQGZHvDnE6UxPavUZ51H5_9uQMlqDqeP5ZyC3WDT?key=aCaNtG-CD2EP5Jw8UatYig) *** #### Final Notes [Section titled “Final Notes”](#final-notes) Your scene should now allow teleportation and basic VR functionality! You can continue building your VR experience using VR Builder’s extensive toolkit. # Login & Download Updates (Pro) Customers using the **Professional version** of realvirtual can access the **User Hub**, an in-app tool to manage your license, download updates, and activate the UPM registry. The User Hub has four tabs: **News**, **Login**, **Downloads**, and **Packages**. ## Opening the User Hub [Section titled “Opening the User Hub”](#opening-the-user-hub) Access the User Hub from the Unity main menu:\ **`Tools > realvirtual > User Hub`** Or via the realvirtual toolbar dropdown in the editor toolbar. ## Login [Section titled “Login”](#login) The **Login** tab offers two login methods, selectable at the top: ### Invoice + ZIP [Section titled “Invoice + ZIP”](#invoice--zip) Use this method if you purchased realvirtual directly or via the Unity Asset Store: 1. Select **Invoice + ZIP** as the login method 2. Enter your **Invoice Number** — a realvirtual invoice or Unity Asset Store invoice number 3. Enter your **Billing ZIP Code** — required for realvirtual invoices, leave empty for Unity Asset Store invoices 4. Enter your **Email** address 5. Check the **License Agreement** checkbox 6. Click **Login** ### Temporary License Key [Section titled “Temporary License Key”](#temporary-license-key) Use this method if you received a **Partner Key** (`PK-XXXX-XXXX-XXXX`) or a **Temporary Code** (`SUB-XXXX-XXXX-XXXX-XXXX`) from your sales partner or license administrator: 1. Select **Temporary License Key** as the login method 2. Enter your key or code in the **Code** field 3. Enter your **Email** address 4. Click **Login** Your license activates immediately. Keys and codes track concurrent sessions — when you close Unity, your seat is freed for others. Note Temporary codes are generated by your license administrator via the [Customer Portal](/doc/unity/customer-portal/). Partner Keys are provided by your sales partner. Once logged in, the **Account Status** shows **You are logged in** in green. ![](/doc/unity/assets/hub-login.png) User Hub — Login tab with Invoice + ZIP method ## Downloads [Section titled “Downloads”](#downloads) The **Downloads** tab lists all packages available for your license. Click **Refresh** to update the list. Available packages include: * **UPM packages** (`.tgz`) — For Unity 6 projects (e.g., `io.realvirtual.professional`, `io.realvirtual.starter`) * **Legacy packages** (`.unitypackage`) — For older Unity versions * **Archived versions** — Previous releases for backward compatibility Click **Download** next to any package to download it. ### One-Click Install [Section titled “One-Click Install”](#one-click-install) Note This feature was added in realvirtual **6.3.5** (Professional). UPM packages (`.tgz`) additionally show an **Install** button. Click it to download the package and install it directly into the open project — no manual **Package Manager → Add package from tarball** step needed. The status line below the file list shows the download progress and the installation result. The package is installed as a local tarball in your project’s `Packages` folder. If you use the UPM registry (see below), activating the registry switches the package back to registry-based updates. When installing realvirtual for the first time into a project, install `io.realvirtual.starter` before `io.realvirtual.professional`. ![](/doc/unity/assets/hub-downloads.png) User Hub — Downloads tab with available packages ## Packages [Section titled “Packages”](#packages) Note This feature was added in realvirtual **6.3**. The **Packages** tab manages the realvirtual UPM scoped registry for automatic package updates. ### UPM Registry [Section titled “UPM Registry”](#upm-registry) After logging in, click **Activate Registry** to configure the realvirtual scoped registry in your project. Once active, the status shows **Active** in green along with the current channel. Select a **Channel**: * **Stable** — Production-ready releases * **Beta** — Early access to upcoming features ### Installed Packages [Section titled “Installed Packages”](#installed-packages) Click **Check for Updates** to see if newer versions are available on the registry. ### What’s New [Section titled “What’s New”](#whats-new) Shows the latest package versions available on the registry. Click **Release Notes** to open the full release notes in your browser. ![](/doc/unity/assets/hub-registry.png) User Hub — Packages tab with UPM registry and channel selection Once the registry is activated, realvirtual packages also appear in **Window > Package Manager** under “My Registries” and can be updated like any other UPM package. ### Updates Behind Corporate Proxies [Section titled “Updates Behind Corporate Proxies”](#updates-behind-corporate-proxies) Note This feature was added in realvirtual **6.3.5** (Professional). Some corporate networks use TLS-inspection proxies that replace server certificates with a company-internal certificate. The Unity Package Manager validates certificates against its own certificate store, so registry updates can fail with a certificate error even though the realvirtual registry certificate is valid. The User Hub handles this automatically: when a package update fails with a certificate or network error, it downloads the package directly using the operating system trust store, saves it as a tarball in your project’s `Packages` folder, and installs it from there. The status line shows the download progress. No manual steps are required — just click **Update** as usual. After a fallback installation, the package is referenced as a local tarball in your `manifest.json`. As soon as the registry is reachable again (for example after your IT adds an exception), click **Activate Registry** to switch the package back to registry-based updates. For a permanent solution, ask your IT department to exclude `download.realvirtual.io` from TLS inspection — the same exception commonly configured for npm or NuGet registries. ## News [Section titled “News”](#news) The **News** tab displays release notes and information about new features for each version. It appears automatically once when you start the Unity Editor. Each release entry includes a summary of new features, improvements, and bug fixes along with a **Release Notes** button linking to the full documentation. ![](/doc/unity/assets/hub-releasenotes.png) User Hub — News tab with release information ## See Also [Section titled “See Also”](#see-also) * [Customer Portal](/doc/unity/customer-portal/) — Web-based license management, temporary code generation, and invoice access at [download.realvirtual.io](https://download.realvirtual.io) # Multiplayer (Pro, Deprecated) Danger **Deprecated — moving to realvirtual WEB.** Unity-based multiplayer (Netcode for GameObjects / Unity Relay) is deprecated. Real-time multiuser collaboration now runs in **[realvirtual WEB](/doc/unity/extensions/realvirtual-web/)** via the browser-based **MultiplayerWEB** relay: shared avatars, camera positions and live machine state across Unity and any browser client, with no networking setup and no port forwarding. Note Multiplayer functionality is only available in the Professional version and requires Unity Netcode for GameObjects and Unity Services. Real-time collaborative industrial automation simulation with support for multiple users and VR/AR integration. ## Overview [Section titled “Overview”](#overview) The realvirtual Professional Multiplayer system enables multiple users to simultaneously interact with the same virtual commissioning scenario. Built on [Unity Netcode for GameObjects](https://docs.unity3d.com/Packages/com.unity.netcode.gameobjects@latest/) with [Unity Relay Service](https://docs.unity.com/ugs/manual/relay/manual/introduction), it provides synchronized automation components, real-time material flow, and collaborative design review capabilities. ## Key Features [Section titled “Key Features”](#key-features) * **Multi-user Collaboration**: Scalable concurrent users in the same simulation * **Real-time Synchronization**: All automation components (Drives, Sensors, MUs, Sources) synchronized across clients * **VR/AR Support**: Full XR controller tracking and avatar representation * **Industrial Integration**: PLC signal synchronization and automation logic sharing * **Cloud-based Connection**: [Unity Relay Service](https://docs.unity.com/ugs/manual/relay/manual/introduction) for secure peer-to-peer connections ## System Requirements [Section titled “System Requirements”](#system-requirements) ### Unity Packages [Section titled “Unity Packages”](#unity-packages) * **[Unity Netcode for GameObjects](https://docs.unity3d.com/Packages/com.unity.netcode.gameobjects@latest/)**: Core networking framework * **[Unity Transport (UTP)](https://docs.unity3d.com/Packages/com.unity.transport@latest/)**: Network transport layer with DTLS encryption * **Unity Services Core**: Authentication and Unity Services integration * **XR Interaction Toolkit** (optional): For VR/AR functionality ## Setup [Section titled “Setup”](#setup) ### 1. Unity Services Configuration [Section titled “1. Unity Services Configuration”](#1-unity-services-configuration) 1. **Enable Unity Services** in Project Settings → Services 2. **Create Unity Project ID** or link to existing project 3. **Enable [Relay Service](https://docs.unity.com/ugs/manual/relay/manual/introduction)** in Unity Dashboard → Multiplayer → Relay 4. **Enable [Authentication](https://docs.unity.com/ugs/en-us/manual/authentication/manual/overview)** for anonymous user sessions ### 2. Scene Setup [Section titled “2. Scene Setup”](#2-scene-setup) 1. **Add the Multiplayer Prefab** to your scene from the realvirtual Professional package * The prefab contains all necessary components: NetworkManager, RelayConnectionManager, NetworkInitializer, and MultiuserWindow * All network prefabs are pre-configured and registered automatically ![NetworkManager Configuration](/doc/unity/assets/multiplayer-networkmanager-settings.png) NetworkManager configuration showing Unity Transport settings, Relay Connection Manager, and network prefab registration ### 3. Automation Component Setup [Section titled “3. Automation Component Setup”](#3-automation-component-setup) The system automatically creates networked versions of: * **Drives**: Position and speed synchronization * **Sensors**: Occupancy state synchronization * **MUs (Moving Units)**: Transform and identity synchronization * **Sources**: Material generation events * **Signals**: PLC signal values and states ## Usage [Section titled “Usage”](#usage) ### Starting a Host Session [Section titled “Starting a Host Session”](#starting-a-host-session) 1. **Open Multiuser Window** via realvirtual → UI toolbar 2. **Enter Player Name** (stored locally) 3. **Click “Host”** to create session 4. **Share Join Code** with other users ### Joining as Client [Section titled “Joining as Client”](#joining-as-client) 1. **Open Multiuser Window** 2. **Enter Player Name** 3. **Input Join Code** received from host 4. **Click “Client”** to join session ![Multiuser Window Interface](/doc/unity/assets/multiplayer-ui-window.png) Multiuser window showing Code input field, Name field, and Host/Client connection buttons with status display ### Connection Status [Section titled “Connection Status”](#connection-status) * **Connected**: Successfully connected to multiplayer session * **No Connection**: Not connected or connection failed ## Synchronized Components [Section titled “Synchronized Components”](#synchronized-components) ### NetworkDrive [Section titled “NetworkDrive”](#networkdrive) * **Position Values**: Current drive positions * **Speed Values**: Current drive speeds * **Authority**: Host controls drives, clients receive updates * **Override Mode**: Clients use PositionOverwrite and SpeedOverwrite ### NetworkMU (Moving Units) [Section titled “NetworkMU (Moving Units)”](#networkmu-moving-units) * **Transform**: Position and rotation * **Identity**: LocalID, GlobalID, Name * **Physics**: Host maintains physics authority, clients use kinematic mode * **Source Tracking**: References to creating Source component Caution Physics objects must be kinematic on client machines to prevent conflicts with the host’s authoritative physics simulation. ### NetworkSensor [Section titled “NetworkSensor”](#networksensor) * **Occupancy State**: Boolean occupied/free status * **Network Mode**: Clients automatically switch to network-controlled mode * **Real-time Updates**: Immediate sensor state propagation ### NetworkSignal [Section titled “NetworkSignal”](#networksignal) * **Signal Values**: All PLC signal types (PLCInputBool, PLCOutputFloat, etc.) * **Bidirectional**: Host-to-client signal synchronization * **String-based**: Universal value representation ### NetworkPlayer [Section titled “NetworkPlayer”](#networkplayer) * **Player Names**: Persistent player identification * **XR Controllers**: Left and right controller position/rotation sync * **Avatar Visibility**: First-person view (own avatar hidden) * **Camera Tracking**: Remote user viewpoint synchronization ## VR/AR Integration [Section titled “VR/AR Integration”](#vrar-integration) ### XR Setup [Section titled “XR Setup”](#xr-setup) 1. **Install XR Interaction Toolkit** 2. **Configure XR Controllers** as “LeftController” and “RightController” Groups 3. **Enable XR Support** in realvirtual-XR package 4. **Test Controller Tracking** before multiplayer sessions ### Supported VR Systems [Section titled “Supported VR Systems”](#supported-vr-systems) * **Meta Quest 2/3**: Fully tested with Touch controllers * **Other OpenXR Devices**: Compatible through Unity XR system * **Mixed Reality**: Combine VR users with desktop users ## Performance Considerations [Section titled “Performance Considerations”](#performance-considerations) ### Network Optimization [Section titled “Network Optimization”](#network-optimization) * **Change Detection**: Only synchronizes data when values change * **Update Frequency**: FixedUpdate (50Hz) for smooth synchronization * **Interpolation**: Client-side smooth movement for controllers * **Authority Model**: Host maintains physics, clients display only ### Best Practices [Section titled “Best Practices”](#best-practices) * **Monitor Simultaneous MUs**: High MU counts can impact network performance depending on bandwidth * **Use Appropriate Update Rates**: Balance responsiveness with bandwidth (50Hz default) * **Test Network Conditions**: Verify performance under realistic network latency * **Monitor Connection Quality**: Use Unity Profiler for network analysis * **Unity Transport Configuration**: Use default settings for optimal Relay performance ## Troubleshooting [Section titled “Troubleshooting”](#troubleshooting) ### Connection Issues [Section titled “Connection Issues”](#connection-issues) * **Unity Services Authentication**: Verify anonymous authentication is enabled in Project Settings → Services * **Relay Allocation**: Check Unity Dashboard for Relay service status and CCU limits * **Firewall Settings**: Ensure UDP traffic is allowed (Unity Transport uses UDP) * **Join Code Validity**: Join codes expire after a timeout period (typically 10 minutes) * **Package Installation**: Verify Unity Netcode for GameObjects is properly installed Note Use Unity Profiler → Networking tab to monitor connection quality and bandwidth usage during multiplayer sessions. See [Unity Netcode Profiler documentation](https://docs.unity3d.com/Packages/com.unity.netcode.gameobjects@latest/index.html?subfolder=/manual/troubleshooting/profiler-tools.html) for detailed analysis. ### Synchronization Problems [Section titled “Synchronization Problems”](#synchronization-problems) * **Network Prefabs**: Verify all automation components have corresponding network prefabs * **Scene Path Resolution**: Check that GameObject hierarchy matches between clients * **Authority Conflicts**: Ensure only host modifies authoritative data * **Physics Conflicts**: Verify client MUs are using kinematic rigidbodies ### Performance Issues [Section titled “Performance Issues”](#performance-issues) * **Bandwidth Usage**: Monitor network traffic in Unity Profiler * **Update Frequency**: Reduce FixedUpdate rate if needed * **Object Count**: Limit number of synchronized objects * **Connection Stability**: Test with realistic network conditions ## API Integration [Section titled “API Integration”](#api-integration) ### Custom Component Synchronization [Section titled “Custom Component Synchronization”](#custom-component-synchronization) To synchronize custom automation components: ```csharp public class CustomNetworkComponent : NetworkBehaviour { [SerializeField] private NetworkVariable customValue = new NetworkVariable(); public override void OnNetworkSpawn() { if (IsHost) { // Initialize host-controlled values customValue.Value = GetComponentValue(); } } private void FixedUpdate() { if (IsHost) { // Update network variable when value changes float newValue = GetComponentValue(); if (Math.Abs(customValue.Value - newValue) > 0.001f) { customValue.Value = newValue; } } else { // Apply received values on clients ApplyNetworkValue(customValue.Value); } } } ``` ## See Also [Section titled “See Also”](#see-also) * [Industrial Metaverse](/doc/unity/extensions/realvirtual.io-industrial-metaverse/) - VR/AR setup and configuration * [Drive Components](/doc/unity/components-and-scripts/motion/drive/) - Synchronized drive systems * [Sensors](/doc/unity/components-and-scripts/sensors/) - Networked sensor components * [MU System](/doc/unity/components-and-scripts/mu-movable-unit/) - Moving unit synchronization * [Interfaces](/doc/unity/components-and-scripts/interfaces/) - PLC communication in multiplayer scenarios # Release Notes Please check our [Troubleshouting](/doc/unity/advanced-topics/troubleshooting/) guide in case of problems when upgrading. Caution For existing projects with earlier realvirtual versions than 2022.15 please install first the package Update202215.unitypackage into your existing project for preparing the update (see below). ## Version History [Section titled “Version History”](#version-history) > **⚠️ Important — Version Numbering System** To align with the Unity version numbering system and provide better traceability, we use the following numbering scheme: > > * **First two numbers** (e.g., `6.3`) match the Unity LTS base version (`6000.3.XX`). > * The **third number** is our release counter. > * **Changeset number** (e.g., `-8701`) provides exact source code traceability. > * Format: **`6.3.0-8701`** where `8701` is the ever-increasing changeset number. > * Changeset numbers always increase, providing clear chronological ordering. **6.3.6-10298** — *6 October 2026* **Available for:** realvirtual **Professional & Starter** **Unity Support:** Unity 6000.3 LTS (Unity 6.3 LTS) *** 🚀 **New Features** * **Move Pivot – Exact bore, shaft and cylinder centers from one click** – A new **Move to Circle / Bore Center** method determines the true center, axis and radius of a round feature on imported CAD from a single click on the surface. This closes a long-standing gap: bounding-box center, single vertex and triangle centroid all lie systematically beside the real center, because CAD tessellation is unevenly dense and any averaged position drifts toward the more finely tessellated area. The tool grows over the clicked surface, derives the axis from the face normals — which works regardless of whether the part is longer or wider than it is tall — and fits the circle numerically. The pivot can be placed at the clicked height, in the middle of the feature or at either end, and a local axis can be aligned to the detected axis in the same step, which is the fastest way to prepare a part for a rotational Drive. When no reliable circle can be determined the tool reports the reason instead of placing the pivot somewhere plausible. The same detection is available headless as the MCP tool `transform_circle_center`, so interactive and automated results are identical. See [Move Pivot Points](/doc/unity/basics/user-interface/move-pivot-points-pro/) *(Professional)* * **Ribbon (Web) Handling – Endless web over rollers, from unwinder to rewinder** – A new component family simulates paper, film, foil, textile or sheet metal running over rollers: **Ribbon Roller**, **Ribbon Winder**, **Ribbon Dancer** and **Ribbon Path**, ticked by one **Ribbon Manager**. The web is moved only by a rotational **Drive** on a roller, followers turn at `v / r`, winder diameters grow and shrink with the wound length, a dancer stores web between two sections, and a path can be slit into strips. While you place rollers, the Scene view shows the same solve as a live preview. The **Winder Speed Control** lets a winder follow the line speed or a dancer position, and the **Web Tension** model cuts the line into zones between driven rollers, computes strain, force and sag per zone, colours the band accordingly and reports **Tension N**, **Is Slack** and **Is Broken** as signals. Materials are picked by **name** from a **Ribbon Material Library** with an Inspector dropdown; a roller can optionally override its CAD materials at simulation start and gets them back at stop, and the GLB export carries the result into realvirtual WEB, where the same components run unchanged. Two samples, *DemoRibbonSlitter* and *DemoRibbonTension*, are included. See [Ribbon (Web) Handling](/doc/unity/components-and-scripts/motion/ribbon-handling/) *(Professional)* * **PLCSIM Advanced Interface – Data block tags on demand** – Variables in global data blocks can now be imported next to the process image. Enter the block names in the new **Import Data Blocks** list and the coupler loads exactly those blocks through the Siemens tag list filter; leave the list empty and only inputs and outputs are exchanged, as before. A data block tag has no inherent direction, so the signal component decides, exactly as in the S7 TCP/IP interface: newly imported tags are **PLCOutput** (read from the PLC); swap the component for the matching **PLCInput** to have the simulation write the tag. Requires *PLCSimAdvancedCoupler.exe* 6.1.11 or newer, which the setup downloads automatically. See [PLCSIM Advanced](/doc/unity/components-and-scripts/interfaces/plcsim-advanced/#importing-data-block-tags) *(Professional)* * **Modbus TCP Interface – Client and server in one interface** – A new **Modbus TCP** interface connects Unity signals to Modbus TCP devices in both directions. In **Client** mode Unity reads and writes the coils and registers of a PLC or I/O device (for example Inovance, Wago or Schneider); in **Server** mode Unity simulates a Modbus device that external masters such as a PLC, HMI or SCADA connect to. Addresses and data types are defined as signal metadata, identical to realvirtual WEB and CONNECT, and signal lists can be imported from CSV. The previous server-only interface remains available as *Modbus TCPRTU (Legacy)*, so existing scenes keep working unchanged. See [Modbus](/doc/unity/components-and-scripts/interfaces/modbus/) *(Professional)* * **PLCSIM Advanced Native Interface (Preview) – No external coupler process** – A second PLCSIM Advanced interface talks to the virtual controller in-process through a native plugin instead of the external coupler. It imports signals, re-synchronizes after a download from TIA Portal and handles pausing the Unity editor. See [PLCSIM Advanced Native](/doc/unity/components-and-scripts/interfaces/plcsim-advanced-native/) *(Professional)* * **Runtime Metadata – Part information from an Excel parts list** – The new **Excel Metadata Setup** creates the **Runtime Metadata** components for a complete CAD assembly from a parts list, so article numbers, technical data and document links no longer have to be entered part by part. At runtime the operator searches this information in a toolbar, and matching parts are highlighted and show their data in a window; the same content is exported to realvirtual WEB for hover tooltips and document links. See [Runtime Metadata](/doc/unity/components-and-scripts/scene-interaction/runtime-metadata/) *(Professional)* * **Performance Optimizer – Keep selected meshes out of the optimization** – The new **Performance Optimizer Exclude** component keeps the meshes of a GameObject, optionally including all children, out of mesh combining. They stay visible as they are and survive **Finalize Optimization** – useful for parts whose material or visibility changes at runtime or that scripts refer to. Parts below a **Runtime Interactable** are combined into a separate mesh of their own, so highlighting and picking them keeps working in an optimized scene. See [Performance Optimizer](/doc/unity/components-and-scripts/performance-tools/performance-optimizer-pro/#keeping-meshes-out-of-the-optimization) *(Professional)* ✨ **Enhancements** * **Signal Force Set – HMI pushbuttons apply and release a whole set** – A `SignalForceSet` can now be wired to HMI pushbuttons directly in the Inspector: **Apply Button** applies all enabled entries with one click and, with **Toggle With Apply Button** enabled, releases them on the next click; an optional **Release Button** only releases. While the set is active the apply button switches to **Button Active Color**, so the operator sees at a glance which force scenario is currently held. Force sets keep working for every signal direction, including PLC inputs that the simulation sends to the controller. See [Signal Force Sets](/doc/unity/components-and-scripts/interfaces/signal-force-set/) *(Professional)* * **HMI – Individual colors survive the UI skin** – HMI elements have a new **Use Skin Colors** option. Switched off, the active light or dark skin no longer overwrites **Color** and **Color Mouse Over** on play start, so pushbuttons and other HMI elements keep the colors set in the Inspector, for example red for acknowledge, blue for automatic and green for open *(Professional & Starter)* * **MCP – Built-in components are readable and writable** – `component_get`, `component_get_all` and `component_set` now cover Unity’s built-in components such as `RectTransform`, `Canvas`, `CanvasScaler`, `Image`, `Camera` and `Light`, which carry their state in properties instead of serialized fields. Simple property types (numbers, strings, enums, vectors, colors, rects) are returned, read-only properties are listed under `_readOnly`, and unknown or read-only keys are reported as errors instead of being ignored. Positioning HMI elements by anchors and sizes is therefore possible without an editor script *(Professional & Starter)* * **MCP – `screenshot_game` can include the HMI overlay** – The new `includeUI` parameter renders Screen Space Overlay canvases through the capture camera, so the returned image shows the 3D scene together with the on-screen HMI. Canvases are restored to their original mode right after the capture *(Professional & Starter)* * **Kinematic Joints – Drive axis validation** – The validation panel and `kinematic_doctor` now catch the single most common setup mistake in a kinematic mechanism: a `Drive` that moves its link about a different world axis than the joint it drives. Previously this produced a mechanism that looked correctly configured, converged cleanly in the solver and still moved wrongly, because the solver only reads the Drive’s scalar position value while the Drive itself writes the link pose. Two new findings are reported before the first Play start, each with a one click **Fix**: **Drive Axis Mismatch** (axes differ in world space, including the sign — an anti-parallel axis on a driven joint displaces every downstream passive link by twice the angle) and **Drive Type Mismatch** (a linear Drive on a Revolute joint or vice versa). `Reverse Direction` is taken into account, and the fix sets both `Direction` and `Reverse Direction`. See [Kinematic Joints](/doc/unity/components-and-scripts/motion/kinematic-joints/) *(Professional)* * **PLCSIM Advanced – Signal import filter and much faster import** – Large PLC programs no longer have to be imported completely: with **Use Signal Filter**, include and exclude lists of regular expressions decide which signals are imported at all. Independently of the filter, creating the signal objects is now much faster – in a project with 12,000 signals, entering play mode went from several minutes to seconds. See [PLCSIM Advanced](/doc/unity/components-and-scripts/interfaces/plcsim-advanced/) *(Professional)* * **Cable – Direction Length for cable glands and clips** – A cable point can now hold the cable straight over a given length along its local Z axis. On an **Anchor** the cable is rigidly fixed in that direction, like in a cable gland; on a **Guide** the direction is held but the cable can still slide through, like in a clip. Cable points are shown with their own colored gizmos and can be selected and moved with the standard Unity tools. See [Cable](/doc/unity/components-and-scripts/motion/cable/) *(Professional)* * **Interfaces – Clean pause and resume** – Interfaces based on the FastInterface framework now close their connection when the Unity editor is paused, loses focus or leaves play mode, and reopen it on resume, instead of continuing to run in the background *(Professional & Starter)* * **realvirtual WEB – Collision roles and chains from Unity** – The new **Web Collision Role** marker sets the collision role of a part for the collision detection in realvirtual WEB directly in the Unity scene, so it survives every re-export; a Source assigns a role to its MUs with **Collision Role For MUs**. Chains are now exported to realvirtual WEB as well, and the realvirtual WEB window shows the status of the connected realvirtual CONNECT gateway. See [Building a 3D-HMI](/doc/unity/extensions/realvirtual-web/3d-hmi/#web-collision-role) *(Professional)* 🐛 **Bug Fixes** * **MCP – Second Unity Editor no longer hides behind the first one** – When two editors with the MCP package run at the same time, the second one now moves to the next free port as intended. Previously the socket option that lets the bridge survive domain reloads also masked the port of the already running editor, so both instances reported port 18711 and every MCP call reached only the first editor *(Professional & Starter)* * **realvirtual WEB – Instruction steps find targets with special characters again** – Fixed instruction and maintenance steps doing nothing when their target object carries a name with special characters (spaces, `:` or `.`) **and** occurs more than once in the CAD model: the step card appeared, but the object was not highlighted and the camera did not move to it. Such targets are highlighted and framed again — including in models that were exported before this version, without a re-export. A target that genuinely does not exist in the model is now reported on the step card, on the disabled view button and in the Problems panel instead of being ignored silently *(Professional)* * **Drive – Jogging stops exactly at the jog speed** – Fixed a jogging Drive overshooting and oscillating around the jog speed after **Target Speed** was lowered while it was moving. Jogging with smooth acceleration was made more robust as well *(Professional & Starter)* * **Drive – No more prefab overrides in edit mode** – Fixed Drives in prefab instances showing an override of the realvirtual controller reference as soon as the scene was edited *(Professional & Starter)* * **Performance Optimizer – Scene Selectables survive the optimization** – Fixed the optimizer baking the renderers that a **Scene Selectable** refers to into the combined mesh and destroying them on **Finalize Optimization**, which broke selection and highlighting in the optimized scene *(Professional)* * **Machining Volume – Colliders keep their size** – Fixed Box, Sphere and Capsule colliders on a workpiece shrinking when the Machining Volume bakes the transform scale into the workpiece – a scaled paper roll sank into the conveyor. A Mesh Collider cannot be adjusted automatically; the Inspector now shows a warning with the exact dimensions to use instead. See [Machining Volume](/doc/unity/components-and-scripts/csg/machining-volume/) *(Professional)* * **PLCSIM Advanced Interface – Only active, imported inputs are written to the PLC** – Fixed the coupler writing every PLC input it knew, including signals that the import filter had excluded or that were set inactive in Unity, and writing zeros before Unity had published its first values. The shared-memory protocol now carries a write permission per signal and a handshake that is granted only after a complete data set, so excluding a signal from the import or disabling it really stops the write. Also fixed the last tag of the table being imported with the wrong data type, the coupler stalling the PLC after a Unity crash, and the tag list request failing with `NotEnoughMemory` on large safety projects — the coupler now requests inputs and outputs only and falls back to HMI-visible tags if the Siemens limit of 500 000 entries is still exceeded. The setup no longer copies the Siemens API DLL into StreamingAssets, because that copy shadowed the installed API; delete an existing copy. Coupler 6.1.12 serves older realvirtual versions unchanged *(Professional)* - [Documentation](/doc/unity/components-and-scripts/interfaces/plcsim-advanced/) * **PLCSIM Advanced Interface – Large projects and 64-bit inputs** – Fixed the `-43 NotEnoughMemory` error on large projects, the last row of the signal table losing its data type, and 64-bit inputs (LINT, ULINT, LREAL) being transported incompletely. The coupler 6.1.12 also keeps serving realvirtual versions before 6.3.6 unchanged *(Professional)* * **MU – No error for MUs created by script** – Fixed a NullReferenceException when an MU that was created at runtime with `AddComponent` (for example by a custom script) entered a sensor or got another MU loaded onto it *(Professional & Starter)* * **Runtime Metadata – Preset search applied at start** – A search pattern preset in the **Metadata Manager** is now applied at play start, so the matching parts are highlighted and hoverable right away instead of only after the first search *(Professional)* * **OPC UA Interface – Timeouts** – Fixed the connection timeout being interpreted in milliseconds instead of seconds, and the socket linger time is now limited to 60 seconds on macOS *(Professional)* * **KUKA and Keba Interfaces – No false error on close** – Closing the interface no longer logs a communication error, and a threading issue in the KUKA interface is fixed *(Professional)* * **GLB Export – No false renaming of same-named parts** – Fixed an export root and a direct child with the same name being reported as duplicates and renamed to `_rv1` / `_rv2`, a common pattern in CAD imports *(Professional)* * **Package installation – Compiles in a new project** – Added the missing package dependencies `com.unity.behavior` (Starter) and `com.unity.modules.assetbundle` (Professional); without them the packages did not compile when installed into a clean project from the registry *(Professional & Starter)* ⚠️ **Known Issues** * **Machining Volume – Occasional pinholes in the machined surface** – With the default **Marching Cubes** meshing, a machined surface can show a tiny hole of about one voxel at single spots in certain cut states. The material removal itself is correct; only the displayed surface has the gap. Switching **Meshing** to **Dual Contouring** avoids it. A fix is planned for the next version *(Professional)* Note **Behavior change – signal names in realvirtual WEB.** A signal whose object name occurs more than once in the model and that has no explicit **Name** set is now registered under its original name (for example `MC04.01I00W`) instead of a stripped version (`MC0401I00W`). This is the spelling the control side (MQTT / realvirtual CONNECT) addresses, so signals of this kind become reachable. A layout planner binding that was saved **before** this version against such a signal shows up as orphaned afterwards and has to be bound again in the bindings overview. No signal in any of the project models we checked was affected. *** **6.3.5-9348** — *13 July 2026* **Available for:** realvirtual **Professional & Starter** **Unity Support:** Unity 6000.3 LTS (Unity 6.3 LTS) *** 🚀 **New Features** * **Kinematic Joints – Deterministic parallel kinematics** – A new, purely kinematic constraint solver (`KinematicJoint`/`KinematicMechanism`, menu **realvirtual/Kinematics**) solves closed kinematic chains — Delta robots, four-bar linkages, scissor lifts, parallel grippers — without Unity physics, jitter or drift. Existing `Drive` components keep driving the active joints exactly as before; the solver moves every passive link to satisfy the mechanism’s constraints each FixedUpdate, with live Converged/Residual Error diagnosis and an Edit Mode “Solve Now” preview. See [Kinematic Joints](/doc/unity/components-and-scripts/motion/kinematic-joints/) *(Professional)* * **FMI / FMU Interface – Co-simulation with 150+ engineering tools, completely rebuilt** – The FMI interface is back, rebuilt from scratch on a new high-performance native co-simulation core (the previous integration was deprecated). Load **FMI 2.0 Co-Simulation** FMUs exported from Modelica, Dymola, Simulink, Amesim and 150+ other tools, and couple validated physics and controls models — hydraulic axes, electrical drives, controllers — directly into your scene. One click on **Import Signals** creates all FMU inputs, outputs and tunable parameters as ordinary realvirtual PLC signals in Edit Mode, initialized with the FMU’s own start values and ready to wire to Drives and Behaviors. The FMU steps in exact sync with the Unity physics timestep (pause and time scaling included), with an optional free-running mode for faster-than-realtime co-simulation. FMU files live in `StreamingAssets/FMU/` and ship with your builds. See [FMI / FMU](/doc/unity/components-and-scripts/interfaces/fmi/) *(Professional)* * **Machining Volume & Machining Tool – Real-time material removal** – Simulate CNC milling, drilling and grinding with real-time, voxel-based material removal: a **MachiningTool** carves a **MachiningVolume** workpiece (box, cylinder, or any closed mesh as stock) with watertight, continuously updated live geometry. Multiple tools, PLC **Reset** and **Machining Active** signals, and a two-station demo scene (CSG Machining sample) are included. See [Machining Volume](/doc/unity/components-and-scripts/csg/machining-volume/) and [Machining Tool](/doc/unity/components-and-scripts/csg/machining-tool/) *(Professional)* ✨ **Enhancements** * **Fanuc Interface – Multi-robot cells and background operation** – The Fanuc interface now has a **Port** field, so a ROBOGUIDE cell with several virtual robots on one PC works. Add one Fanuc interface per robot, all on the same address (`127.0.0.1` for a local ROBOGUIDE), with the robot’s Robot IF port — ROBOGUIDE assigns an incrementing port per virtual robot (robot 1 = `60008`, robot 2 = `60009`, …), as listed in each `robot_x/services.txt` of the workcell. The connection now also keeps running and exchanging signals while the Unity window is in the background *(Professional)* - [Documentation](/doc/unity/components-and-scripts/interfaces/fanuc-pro/) * **User Hub – Package updates work behind TLS-inspection proxies** – When a package update from the realvirtual registry fails with a certificate error — typical in corporate networks where a TLS-inspection proxy replaces the server certificate, which the Unity Package Manager rejects — the User Hub now falls back automatically to a direct download using the operating system trust store and installs the package as a local tarball. Activating the registry again switches the package back to registry-based updates once the registry is reachable *(Professional)* - [Documentation](/doc/unity/login-and-download-updates-pro/) * **User Hub – One-click package install from Downloads** – UPM package tarballs in the **Downloads** tab now have an **Install** button that downloads the package and installs it directly into the open project — no manual **Package Manager → Add package from tarball** step needed. The status line below the file list shows download progress and the installation result *(Professional)* - [Documentation](/doc/unity/login-and-download-updates-pro/) * **Robot Program Export – Real SEW MOVI-C robot program (.srlprg)** – The SEW target now exports an actual runnable MOVIKIT Robotics sequence program (`.srlprg`) instead of the previous CSV point table / IEC 61131-3 ST template. It emits the native SEW program form: a header with `KINEMATIC` and `MotionSet`, a `REALVAR` I/O init block (one slot per signal used in the program), the dynamic-values and blending setup, and a main program of `PTP_J` (joint), `LIN` (Cartesian `X/Y/Z` + `RotZ/RotY/RotX`), signal writes and `WAIT_TIME`. The controller kinematic number and MotionSet are configurable in the export window. As with the other targets this is an offline copy-paste template — validate on the (virtual) MOVISUITE controller before running on hardware *(Professional, Beta)* - [Documentation](/doc/unity/components-and-scripts/robot-program-export/) *** 🐛 **Bug Fixes** * **EtherNet/IP Interface – All input signals now written to the PLC** – Fixed only the first PLC input signal under the interface (Unity → PLC) being transmitted to Allen-Bradley controllers, while all other inputs silently never updated the PLC. The internal write-tag connections were only initialized for the first tag, so writes to all remaining tags failed before reaching the controller. Write tags are now initialized on demand, so every input is transmitted regardless of its position in the hierarchy. Reading outputs from the PLC was not affected *(Professional)* - [Documentation](/doc/unity/components-and-scripts/interfaces/ethernetip/) * **Fanuc Interface – Signals mapped by name, not list position** – Fixed robot I/O being matched by the position of the signal in the interface list instead of by signal name, so a digital output could drive the wrong Unity signal — the robot’s `DO3` switched the third GameObject in the list rather than the signal named `do3`, and outputs shifted whenever the list order or numbering had gaps. Signals are now matched strictly by name (`do4` → `do4`), independent of ordering and of gaps in the numbering (e.g. `do1`, `do3`, `do4`). Also fixed safety digital outputs (SDO) being written to the wrong signal table and uninitialized handling of user input (UI) signals *(Professional)* - [Documentation](/doc/unity/components-and-scripts/interfaces/fanuc-pro/) * **PLCSIM Advanced Interface – Robust across API versions and survives TIA downloads** – The coupler now loads automatically with a compatible PLCSIM Advanced API version. The same build connects whether an older PLCSIM Advanced installation or a current V8 runtime is used, fixing the `MissingMethodException` and initialization errors seen on newer installations. It also no longer terminates when a changed program is downloaded from TIA Portal onto the running PLC: signal exchange pauses during the download and the interface reconnects and re-imports the (possibly changed) signals automatically. A `coupler.log` next to the executable records the loaded API version, the running Runtime Manager version and any errors for easy diagnosis *(Professional)* - [Documentation](/doc/unity/components-and-scripts/interfaces/plcsim-advanced/) * **Siemens Simit Interface – Signal list reliably written on play and build** – Fixed `SimitSignalList.xml` being written empty. The SIMIT SDK writes the signal list when you enter play mode or build, but the signals were only registered at runtime afterwards, so the list was written before it was populated. It then only appeared after a later scene save, for example when closing Unity. The signals are now registered before the SDK writes the list, so it is reliably present and up to date at play start and in builds. The list is also re-synced when child signals are added, removed, renamed or retyped *(Professional)* - [Documentation](/doc/unity/components-and-scripts/interfaces/siemens-simit-interface-pro/) * **Festo AX Controls (PLCnext) Interface – Signals now update reliably** – Fixed PLC output signals staying at their initial value while the interface reported a healthy connection. The variable import flattened the GDS path separator between component and port to a dot (e.g. `Codesys.Gds.0.POU.dXPos`), which the controller rejected; the correct `/` separator is now used and existing signals are repaired automatically (e.g. `Codesys.Gds/0.POU.dXPos`). Controllers that do not implement RSC subscriptions (Festo AX / CODESYS GDS) now fall back to direct polling automatically instead of silently receiving no data. Subscription values are mapped to the correct signals via the controller-reported variable order, and rejected variables or failed subscribe/read calls are now logged instead of swallowed *(Professional, Beta)* - [Documentation](/doc/unity/components-and-scripts/interfaces/festo-plcnext/) * **Professional License Login – More robust in corporate networks** – The Professional login now retries automatically on transient server errors, supplies the system proxy credentials so authenticating corporate proxies no longer block sign-in, and shows a clear message when a proxy or firewall blocks the license server instead of a generic error code. Unexpected responses are written to the Editor console to speed up diagnosis *(Professional)* * **Fixer – No more NullReferenceException on non-MU objects** – Fixed a `NullReferenceException` in `Fixer.OnTriggerEnter` when a collider without an MU in its hierarchy entered the Fixer (for example plain scene geometry combined with a tag filter). The Fixer now ignores colliders that do not belong to an MU instead of throwing - [Documentation](/doc/unity/components-and-scripts/picking-and-placing-mus/fixer/) * **Sensor – No longer detects other sensors** – Fixed sensors reporting each other as occupied. Sensors live on the `rvSensor` layer, which collides with itself in the collision matrix, so two overlapping sensor volumes registered one another as a detected object. A sensor now ignores colliders that belong to another Sensor - [Documentation](/doc/unity/components-and-scripts/sensors/sensor/) * **Group Assignment Tool – Prefix-based groups handled correctly** – Fixed assigning objects to a group that uses a **Group Name Prefix** baking the combined name (prefix + group name) into the plain group name field instead of replicating the prefix. Renaming the prefix object or reusing the prefab then changed the effective name of the original members while the newly assigned object kept the baked string, silently dropping it out of the group. The tool now copies the prefix and raw group name from the existing group, so prefab-based, prefix-differentiated stations stay consistent *(Professional)* - [Documentation](/doc/unity/basics/user-interface/group-assignment-tool-pro/) * **Grip – Place Align With Object now aligns rotation, plus physics options** – Fixed **Place Align With Object** being ignored in the current place flow, so the placed MU kept the gripper’s rotation instead of aligning to the target. Alignment is now applied on every place path, with separate **Place Align Position** and **Place Align Rotation** toggles (as on the Fixer). A new **Release Constraints When Placed** option additionally clears the MU’s Rigidbody constraints when placing with physics, for cases where the gripped part had frozen axes - [Documentation](/doc/unity/components-and-scripts/picking-and-placing-mus/grip/) * **Scene Selectables – Tooltip no longer lingers on fast hover-out** – Fixed the hover tooltip staying on screen when the mouse left a selectable quickly or moved straight onto a UI element. A delayed tooltip re-activation could fire one frame after the hover had already ended, and moving onto UI skipped the hover reset; both paths now clear the tooltip reliably *(Professional)* - [Documentation](/doc/unity/components-and-scripts/scene-interaction/scene-selectables-pro/) * **Drive\_SEWMovilink – Correctly scoped to the legacy MOVILINK generation** – Fixed the documentation and component description incorrectly listing **MOVI-C** as a MOVILINK device. MOVILINK is the legacy SEW unit profile of the MOVIDRIVE B / MOVITRAC B / MOVIMOT generation; MOVI-C does not use MOVILINK but the MOVIKIT process data profile or PROFIdrive / CiA 402. The behavior model itself (control-word / status-word logic, `0x06` enable byte) is unchanged and correct — for a MOVI-C drive in CiA402 mode use `Drive_CiA402` instead *(Professional, Beta)* - [Documentation](/doc/unity/components-and-scripts/motion/drive-behavior/) *** **6.3.4-9151** — *12 June 2026* **Available for:** realvirtual **Professional & Starter** **Unity Support:** Unity 6000.3 LTS (Unity 6.3 LTS) *** 🚀 **New Features** * **Signal Force Sets (Pro)** – Force boundary signals (voltage, e-stop, pressure, operating mode) to defined values for virtual commissioning, switch between test scenarios by applying or releasing named sets, and monitor all active forces in a dedicated Signal Force Monitor window — equivalent to the force table in TIA Portal / TwinCAT *(Professional)* - [Documentation](/doc/unity/components-and-scripts/interfaces/signal-force-set/) * **Group Assignment Tool** – Scene-picking tool to assign GameObjects to groups by click, drag-paint, or Select-Connected flood-fill directly in the Scene View. Complements the hierarchy-based Selection Window and axis-based Kinematic Tool for rapid bulk assignment *(Professional)* - [Documentation](/doc/unity/basics/user-interface/group-assignment-tool-pro/) * **PLC-Accurate Drive Behavior Models (Beta)** – New drive behaviors that mirror the exact control-word / status-word process image of real PLC drives, so a drive only moves once the PLC has stepped it through the standard enable sequence: **Drive\_ProfidriveSpeed** and **Drive\_ProfidrivePos** (Siemens PROFIdrive / SINAMICS G120, S120, V90 – standard telegram 1 and raw telegram 111), **Drive\_CiA402** (CiA 402 / DS402 – EtherCAT CoE and CANopen: Beckhoff, Kollmorgen, Lenze, SEW MOVI-C, Bosch Rexroth ctrlX DRIVE …), **Drive\_SEWMovilink** (SEW MOVILINK), **Drive\_FestoFHPP** (Festo FHPP), **Drive\_UniDriveMotor** (generic control-word positioner) and **Drive\_ProportionalValve** - [Documentation](/doc/unity/components-and-scripts/motion/drive-behavior/) * **Runtime Environment Lighting** – The Environment Controller now computes the skybox ambient and reflection live at runtime, so scenes are correctly lit without baking. Per-scene baked lighting folders (`LightingData.asset`, `ReflectionProbe-*.exr`) become optional, and a new **Tools > realvirtual > Settings > Remove Baked Lighting Folders** utility removes them safely after a confirmation warning — slimming projects and ending the version-control noise these binary files cause after every bake - [Documentation](/doc/unity/components-and-scripts/game4automation/environment-controller/) * **Robot Program Export (Beta)** – Turns a taught IK Path into ready-to-paste controller code: **ABB RAPID** (`.mod`), **KUKA KRL** (`.src`/`.dat`), **Fanuc TP/LS** (`.ls`), **SEW MOVI-C / MOVIKIT** (CSV point table or IEC 61131-3 ST template) and **Wandelbots NOVA** (Python SDK or Wandelscript). Offline copy-paste workflow (no live upload) with axis-based or Cartesian output, live preview and Copy / Save File, available from **Tools > realvirtual > Robot Program Export** or the IK Path inspector. The output is a copy-paste **template** — validate on a (virtual) controller before running on hardware *(Professional, Beta)* - [Documentation](/doc/unity/components-and-scripts/robot-program-export/) ✨ **Enhancements** * **SIMIT Auto Update Signals** – The SiemensSimitInterface now re-exports the SIMIT signal list automatically (debounced) whenever you add, remove, rename or retype a child signal in edit mode and on scene save, so the mapping stays in sync without manual steps. A **Refresh Simit Signals** button remains available for manual export *(Professional)* - [Documentation](/doc/unity/components-and-scripts/interfaces/siemens-simit-interface-pro/) * **Robot IK – Solution Picker** – The IK Solutions list now keeps a stable order and shows, per solution, the largest single-axis move to the previous path point (maxΔ) with a **SMOOTH** marker for the lowest-motion configuration, so you can see which solution gives a smooth path and pick it yourself. Clicking a solution pins it by joint angles, so the chosen configuration is stably restored on every re-solve *(Professional)* - [Documentation](/doc/unity/components-and-scripts/robot-inverse-kinematics/) * **Robot IK – Smoother motion** – Joint angles are now kept continuous automatically (the solver picks the angle representation closest to the current pose within the axis limits), avoiding 360° / -180°↔+180° wrist-flip jumps during linear and point-to-point motion *(Professional)* * **Robotics Demo** – The standard IK demo (DemoRobotIK) now demonstrates both a standard 6-axis robot (ABB IRB2400, spherical wrist) and a collaborative robot (FANUC CRX, non-spherical wrist) in one scene *(Professional)* 🐛 **Bug Fixes** * **Standard Demo (DemoRealvirtual)** – The bundled Getting Started sample now ships the up-to-date DemoRealvirtual scene in which the robot reliably grips and places the turbine onto the outgoing conveyor. * **Robot IK – Collaborative robots** – Fixed an IndexOutOfRangeException that could occur when an IK target carried a solution index left over from a different seed configuration *(Professional)* * **Robot IK – Synchronized PTP speed** – Fixed robot paths gradually slowing to a crawl: synchronized point-to-point moves and zone blending could progressively overwrite and re-save an already-reduced axis speed. Axis speed and acceleration are now captured once and reliably restored *(Professional)* * **Siemens Simit Interface** – Fixed duplicate signal entries being written to `SimitSignalList.xml` when a deactivated interface (Active set to Never) was present in the scene, for example alongside a SignalCatcher. An interface set to Never no longer enables its coupler or runs signal initialization, so it can no longer trigger a second signal-list export. Each signal is now written to the XML exactly once *(Professional)* * **Unity 2022.3 / Tuanjie Editor compatibility** – Resolved compile and shader errors that prevented the packages from building on Unity 2022.3-based editors such as the Tuanjie Editor (团结引擎). Unity-6-only Rigidbody APIs are now version-guarded, the Multi-Object Outline render feature is compatible with URP 14, an unsupported dedicated-server build target was removed from the CADLink assembly, and the Mitsubishi MC Protocol interface is gated behind the `REALVIRTUAL_MITSUBISHI` define on non-Unity-6 editors. Behavior on Unity 6 is unchanged. *** **6.3.3-9052** — *22 May 2026* **Available for:** realvirtual **Professional & Starter** **Unity Support:** Unity 6000.3 LTS (Unity 6.3 LTS) *** 🚀 **New Features** * **Festo AX Controls / PLCnext Interface (Beta)** – New interface for Festo AX Controls controllers running PLCnext Technology. Connects via the RSC (Remote Service Call) library over TCP, with subscription mode for real-time push-based signal exchange and polling mode as fallback. Includes editor button for one-click variable import from the PLC. See [Festo AX Controls (PLCnext)](/doc/unity/components-and-scripts/interfaces/festo-plcnext/) *(Professional)* * **Mesh Tools** – New tabbed editor window combining mesh utilities for CAD workflows. **Mesh Separator** splits combined meshes into individual disconnected islands with color-coded Scene view preview and selective separation. **Auto Correct Pivots** fixes off-center mesh origins from CAD imports by recentering vertices and compensating transforms. See [Mesh Tools (Pro)](/doc/unity/components-and-scripts/tools/mesh-tools/) *(Professional)* * **Lamp** – Visual status indicator for HMI and signaling. Drives emission color and intensity via a MaterialPropertyBlock (batching preserved), with flashing, an optional point light, and PLC control through `SignalLampOn` and `SignalLampFlashing` ✨ **Enhancements** * **Group Collision Detection** – Collision PLC signals are now shown as connected in the inspector. Movable Units (MUs) are checked through dedicated child trigger colliders so their functional layers (rvMU, transport, sensor) stay intact, the collision layer reliably collides with itself, and managed colliders are visualized with Scene view gizmos *(Professional)* * **ctrlX CORE Interface** – Added device status, bridge health monitoring, snap log viewing, Data Layer settings, and bridge configuration management via REST API and WebSocket config messages *(Professional)* * **Chain Conveyor** – Chain path can now be defined with Unity Splines 🐛 **Bug Fixes** * **Grip Auto-Place on Conveyors** – Fixed placed parts staying kinematic instead of being transported away. This affected the **standard demo scene** (DemoRealvirtual), where the robot places turbines on the outgoing conveyor. The Grip Auto-Place surface raycast now fires straight down in world space instead of along the gripper’s local up axis — grippers with an arbitrarily oriented tool axis previously missed the conveyor below, leaving placed MUs kinematic. Placed MUs now correctly get physics enabled and are transported on the surface * **Move Pivot Tool** – Fixed Scene view callback handling that caused vertex selection and preview gizmos to stop working after picking points, cancelling, or pressing Escape. The Scene GUI handler is now subscribed once and properly cleaned up when the tool closes. Each pivot method now also shows a contextual hint explaining how to use it *(Professional)* * **Group Visibility** – The runtime Group Manager is now null-safe against destroyed Group components, so short-lived MUs that carry a Group no longer cause errors *** **6.3.2-8944** — *2 May 2026* **Available for:** realvirtual **Professional & Starter** **Unity Support:** Unity 6000.3 LTS (Unity 6.3 LTS) *** ### Starter & Professional [Section titled “Starter & Professional”](#starter--professional) 🚀 **New Features** * **Group Collision Detection** – Runtime collision checking between named groups (e.g., robot vs. fixture) with GPU-accelerated highlighting, PLC signal output, automatic collider setup modes (Box/Mesh/Existing), and per-group self-collision filtering *(Professional)* * **Statistics LogicSteps** – Four new LogicStep components (`LogicStep_StatState`, `LogicStep_StatOutput`, `LogicStep_StatStartCycle`, `LogicStep_StatEndCycle`) for integrating state tracking, output counting, and cycle time measurement into automation sequences *(Professional)* ✨ **Enhancements** * **Drive Position/Speed Overwrite** – New `PositionOverwrite` and `SpeedOverwrite` properties allow external systems to directly set drive state for replay and multiuser synchronization * **Grip Auto-Place with GripTarget** – Enhanced Grip with three-mode placement (Auto/Static/Physics), automatic GripTarget detection via OverlapSphere, MU-on-MU loading support, and OverlapSphere pick when no sensor is assigned * **Network Ownership Framework** – `realvirtualBehavior` base class now includes `IsNetworkOwner`, `SetNetworkOwner()`, and `OnOwnershipChanged()` virtual callback for multiuser authority management across all components * **Fixer Multiuser Support** – Fixer now implements IMultiPlayer interface for multiuser client/server mode awareness, preventing unwanted fix/unfix operations on remote-controlled components * **NetworkPlayer Performance** – NetworkPlayer optimized to only sync name when it actually changes, preventing unnecessary writes per frame *(Professional)* * **GLBManager Batch Export** – Thread-safe batch export with aggressive import blocking to prevent Unity re-import during multi-file exports *(Professional)* * **CADLink Native Importer** – Updated CMC-Kiesel DLLs for JT format improvements *(Professional)* 🐛 **Bug Fixes** * **ModelChecker State Persistence** – Fixed state loss across play mode transitions by using EditorPrefs for persistence * **OPC-UA Subscription Stability** – Improved LibUA encoding layer stability for long-running subscription sessions *(Professional)* *** **6.3.1-8780** — *24 March 2026* **Available for:** realvirtual **Professional & Starter** **Unity Support:** Unity 6000.3 LTS (Unity 6.3 LTS) *** ### Starter & Professional [Section titled “Starter & Professional”](#starter--professional-1) 🚀 **New Features** * **Time-Synced Physics Interface** – New `ITimeSyncedPhysics` interface enabling external time sources to control Drive and TransportSurface physics updates with custom delta time instead of Unity’s fixed timestep. Enables precise co-simulation synchronization with external tools * **HDRi Skybox Environments** – New autoshop and empty warehouse HDRi skybox presets for realistic industrial lighting * **Enhanced Mesh Gizmo Visualization** – Reworked pivot and center point gizmos with proper RGB axis systems, cone tips, colored markers (sphere for pivot, cube for center), optional labels, and a new bounding-box mode as lightweight alternative to full wire mesh rendering ✨ **Enhancements** * **Editor Group Lookup Performance** – All group lookups across the codebase now use a centralized cached group system (`Groups.GetCachedGroups()`) that includes inactive objects and auto-invalidates on hierarchy or play mode changes, eliminating repeated expensive FindObjectsByType calls * **QuickToggle Signal Display** – Signals without interface mappings are no longer incorrectly grayed out in the hierarchy, improving visibility for LogicSteps and behavior-only usage. Selection-based signal highlighting now uses a cached HashSet for better performance * **DriveHandle Scene GUI Performance** – Drive limit label style is now cached instead of being allocated every frame during scene rendering 🐛 **Bug Fixes** * **Grip NoPhysicsWhenPlaced** – Fixed an issue where MUs placed with NoPhysicsWhenPlaced mode would have physics re-enabled, causing them to fall or behave unexpectedly. Placed MUs now correctly remain kinematic * **Grip PickedMUs Initialization** – Fixed potential null reference when PickedMUs list was accessed before Start() * **S7 Interface Reconnection** – Fixed socket leaks on reconnect, thread-unsafe logging from background thread, and communication thread being killed on disconnect preventing proper reconnection * **TransportSurface Group Name** – Fixed 5 locations using raw GroupName field instead of GetGroupName(), causing incorrect bounds, renderer, and collider lookups for kinematic-integrated transport surfaces * **igus REBEL Interface** – Fixed off-by-one error in signal numbering and added missing CMD prefix to GSIG command * **GroupManager Inspector** – Fixed DisableMeshOnHide property visibility in Inspector and mesh hiding to work independently of DisableGameObjectOnHide *** ### Professional Only [Section titled “Professional Only”](#professional-only) 🚀 **New Features** * **Siemens Simit Time-Synchronized Physics** – The Simit interface now supports physics time synchronization via the ISimulator interface. When AllowTimeSync is enabled, Simit controls Unity physics timesteps directly for deterministic co-simulation *(Professional)* ✨ **Enhancements** * **OPC-UA Thread-Safe Subscriptions** – Subscription value callbacks are now processed on the Unity main thread via a ConcurrentQueue, eliminating cross-thread access and preventing crashes during high subscription update rates *(Professional)* * **Kinematic Tool Axis Gizmos** – Context-aware gizmos showing rotation arcs with limit indicators for rotational axes and directional arrows with limit markers for linear axes. Colors configurable via EditorGizmoOptions *(Professional)* * **Kinematic Tool UI Improvements** – Visual grouping for Parts and Drives sections, hierarchy click integration, keyboard shortcuts (Ctrl+D, Ctrl+R, Esc), and selection filtering to prevent accidental axis/controller selection *(Professional)* * **StateStatistics Performance** – Zero-GC rewrite with lazy inspector updates, cached DES.Now delegate, O(1) HashSet free-state lookups, and manual sorting replacing LINQ *(Professional)* 🐛 **Bug Fixes** * **Licensing Play Mode Guard** – Fixed licensing validation during play mode *(Professional)* * **OPC-UA Subscriptions** – Fixed unlimited subscriptions when MaxNumberOfNodesPerSubscription=0, null signal reference guard, and stale values cleared on disconnect *(Professional)* * **Kinematic Tool** – Fixed point-to-point line drawing, multiple null references after domain reload, repaint loop causing editor performance issues, and memory leaks from static references *(Professional)* *** **6.0.11-8732** — *13 March 2026* **Available for:** realvirtual **Professional** **Unity Support:** Unity 6000.0.28f1 and upwards (Unity 6) and Unity 2022 LTS Note This is a **maintenance release** for existing Unity 6.0 projects. For new projects, we recommend using **realvirtual 6.3** which targets Unity 6000.3 LTS. *** ✨ **Enhancements** * **Editor Performance Optimization** – Eliminated editor lag when selecting GameObjects with Kinematic, Drive, or other realvirtual components. Introduced a central Group cache with smart invalidation across 18+ locations that previously called FindObjectsByType every frame. Fixed repaint loops in KinematicTool, added selection-based signal caching in QuickToggle, and cached GUIStyle in DriveHandle *(Professional)* * **LogicStep DriveTo Direction Control** – Added Direction option (Automatic, Forward, Backward) to LogicStep\_DriveTo for explicit movement direction control on 360° continuous rotation drives. Allows specifying which way the drive should rotate when crossing the 360°→0° boundary *(Professional & Starter)* - [Documentation](/doc/unity/components-and-scripts/defining-logic/logicsteps/) 🐛 **Bug Fixes** * **igus iRC Thread Safety** – Fixed multiple race conditions in igus iRC Interface that caused InvalidOperationException crashes. Replaced List with ConcurrentQueue for signal synchronization, moved thread start after signal setup, added lock on SendCommand to prevent TCP message corruption, dispatched EXECEND handler to main thread via volatile flag, and added null-guard to CloseInterface *(Professional & Starter)* - [Documentation](/doc/unity/components-and-scripts/interfaces/igus-rebel/) * **igus iRC Digital I/O** – Fixed FormatException preventing digital I/O initialization when Signal.Name is empty. Restored numoutput counter fallback for correct Mempos assignment of DOut and GSig signals *(Professional & Starter)* - [Documentation](/doc/unity/components-and-scripts/interfaces/igus-rebel/) * **Scene Selectables** – Fixed NullReferenceException on hover and click interactions by correcting a compiler directive mismatch that prevented OutlineSelectionManager and OverlaySelectionManager from compiling as AbstractSelectionManager *(Professional)* * **GroupManager Hide** – Fixed groups not hiding when DisableMeshOnHide is enabled but DisableGameObjectOnHide is disabled. Corrected if/else logic and fixed the ShowIf attribute so DisableMeshOnHide is visible in the Inspector when needed *(Professional & Starter)* * **CAD Checker Triangle Count** – Fixed CAD Checker displaying triangle counts 3x higher than actual values. mesh.triangles.Length returns index count which must be divided by 3 to get the correct triangle count *(Professional)* * **Siemens Simit Time-Synced TransportSurfaces** – Fixed TransportSurfaces not moving in Simit time-synced mode. TransportSurface now implements the new ITimeSyncedPhysics interface and registers with the realvirtualController for externally driven physics updates, ensuring correct conveyor motion when Simit controls the simulation timestep *(Professional)* - [Documentation](/doc/unity/components-and-scripts/interfaces/simit-shared-memory/) * **Siemens Simit Interface** – Improved documentation and added validation for the SimitConnection field assignment *(Professional)* - [Documentation](/doc/unity/components-and-scripts/interfaces/siemens-simit-interface-pro/) *** **6.0.11-8732** — *13 March 2026* **Available for:** realvirtual **Starter** **Unity Support:** Unity 6000.0.28f1 and upwards (Unity 6) and Unity 2022 LTS *** ✨ **Enhancements** * **LogicStep DriveTo Direction Control** – Added Direction option (Automatic, Forward, Backward) to LogicStep\_DriveTo for explicit movement direction control on 360° continuous rotation drives *(Starter)* - [Documentation](/doc/unity/components-and-scripts/defining-logic/logicsteps/) 🐛 **Bug Fixes** * **igus iRC Thread Safety** – Fixed multiple race conditions in igus iRC Interface that caused InvalidOperationException crashes *(Starter)* - [Documentation](/doc/unity/components-and-scripts/interfaces/igus-rebel/) * **igus iRC Digital I/O** – Fixed FormatException preventing digital I/O initialization when Signal.Name is empty *(Starter)* - [Documentation](/doc/unity/components-and-scripts/interfaces/igus-rebel/) * **GroupManager Hide** – Fixed groups not hiding when DisableMeshOnHide is enabled but DisableGameObjectOnHide is disabled *(Starter)* *** **6.3.0-8701** — *8 March 2026* **Available for:** realvirtual **Professional & Starter** **Unity Support:** Unity 6000.3 LTS (Unity 6.3 LTS) *** ### Starter & Professional [Section titled “Starter & Professional”](#starter--professional-2) 🚀 **New Features** * **UPM Package Distribution** – realvirtual is now distributed as standard Unity Package Manager (UPM) packages (`io.realvirtual.starter`, `io.realvirtual.professional`). Install and update via the realvirtual Package Manager window with automatic dependency resolution between packages - [Documentation](/doc/unity/basics/installation/) * **Unity 6.3 LTS** – First release targeting Unity 6000.3 LTS (Unity 6.3). Updated render pipeline settings, URP compatibility, and leverages Unity 6.3 APIs throughout * **LogicStep GripPick & GripPlace** – Two new logic step components for direct Grip control in automation sequences. GripPick triggers a pick with optional blocking mode (waits until MU is gripped), GripPlace triggers a place operation. Both include safety timeouts - [Documentation](/doc/unity/components-and-scripts/defining-logic/logicsteps/) * **LogicStep StartDriveTo** – Non-blocking drive-to command that starts the motion and immediately proceeds to the next step. Use with LogicStep\_WaitForSignalBool on the drive’s AtPosition signal to create parallel drive motion sequences - [Documentation](/doc/unity/components-and-scripts/defining-logic/logicsteps/) * **LogicStep SetActiveOnly** – New logic step that sets a GameObject active without optionally deactivating it on the next step (unlike LogicStep\_Enable which toggles). Useful for one-shot activations in automation sequences - [Documentation](/doc/unity/components-and-scripts/defining-logic/logicsteps/) * **Component Validation System** – Automatic validation framework that discovers rules through reflection and executes them when components are added, removed, or before entering play mode. Built-in rules: prevent duplicate Drives, validate TransportSurface hierarchy and mesh, check BehaviorInterface jogging setup. Extensible with custom ValidationRule\ classes - [Documentation](/doc/unity/components-and-scripts/game4automation/pre-play-validation/) * **Demo Scenes Browser** – New categorized Demo Scenes window with visual browser for all sample scenes. Categories include Getting Started, Motion, Gripping, Sensors, Interfaces, and Robotics. One-click scene import and loading with documentation links - [Documentation](/doc/unity/basics/user-interface/demo-scenes-browser/) * **MCP Server Support** – Built-in domain-specific MCP tools for AI agent integration. Includes tools for Drives, Sensors, PLC Signals, MUs, LogicSteps, and Scene Notes — enabling AI agents like Claude to build and control digital twin simulations in real time. Works with the free [realvirtual MCP Server](/doc/unity/extensions/mcp-server/) package - [Documentation](/doc/unity/extensions/mcp-server/) ✨ **Enhancements** * **Grip Auto-Place System** – Enhanced Grip component with intelligent auto-place raycast: GripTarget → align+parent, MU below → LoadMu, TransportSurface → Physics, else → Kinematic. Three PlaceMode options (Auto, Static, Physics). OverlapBox pick with pre-allocated collider buffer for zero GC allocations - [Documentation](/doc/unity/components-and-scripts/picking-and-placing-mus/grip/) 🐛 **Bug Fixes** * **MU Component** – Fixed component lifecycle and state management issues * **Sensor Detection** – Improved detection reliability and event firing consistency * **Drive Cylinder** – Fixed position calculation edge cases *** ### Professional Only [Section titled “Professional Only”](#professional-only-1) 🚀 **New Features** * **License Registration via User Hub** – Professional edition now requires license registration through the realvirtual User Hub directly inside Unity - [Documentation](/doc/unity/login-and-download-updates-pro/) * **Non-Spherical Wrist IK (BETA)** – New IK solver supporting cobots with non-spherical wrists (e.g. FANUC CRX, UR-type robots). Uses Pieper analytical solution refined by Newton-Raphson iterations with numerical Jacobian. Features mirrored seed generation (8 additional wrist-flip seeds), Halton low-discrepancy fallback seeds for hard-to-reach poses, configurable NR damping and convergence tolerances, and diagnostic logging - [Documentation](/doc/unity/components-and-scripts/motion/robot-inverse-kinematics/) * **IK Zone Blending (Überschleifen)** – Smooth robot path transitions without stopping at intermediate targets. Configurable blend radius per IKTarget enables the robot to begin moving toward the next waypoint within the specified distance. Supports LIN→LIN circular arc blending, PTP→PTP blending, and PTP→LIN transitions with TCP velocity preservation. Eliminates jerky motion at waypoints for faster cycle times - [Documentation](/doc/unity/components-and-scripts/motion/robot-inverse-kinematics/) * **IK Solution Selection Modes** – New SolutionSelectionMode enum with FirstReachable (default, backward compatible) and MinimalAngleChange (prefers solution minimizing total joint angle delta from current position). Solutions are now sorted by proximity to reference angles from the previous path target - [Documentation](/doc/unity/components-and-scripts/robot-inverse-kinematics/) * **ctrlX CORE Interface** – New interface for Bosch Rexroth ctrlX CORE devices. Extends WebSocket Realtime with device status monitoring (firmware, operating state), bridge health checks (snap status, version, uptime), log viewer, Data Layer settings, and bridge configuration via REST API. Full bidirectional signal exchange over the ctrlx-rv-bridge - [Documentation](/doc/unity/components-and-scripts/interfaces/ctrlx/) ✨ **Enhancements** * **IK Burst Compiler Optimization** – IKCalculatorBurst now uses Unity.Mathematics SIMD operations and Unity Jobs for parallel IK computation. Async job scheduling prevents main thread blocking. Profiler markers added for performance analysis * **IK Gizmo Visualization** – Enhanced scene view gizmos showing TCP marker, DH kinematic chain with segment lengths, joint positions as needles within limit arcs, local coordinate frames with rotation direction, and wrist type indicator (sphere for spherical, offset visualization for non-spherical) * **WebSocket Realtime Interface Refactoring** – Rebuilt on FastInterfaceBase for thread-safe background communication with automatic reconnection, change detection, and flat JSON wire protocol (v2). Per-client subscribe filtering and fast-path broadcast. Signal import creates local mirror signals with inverted direction * **Grip Integration with IKTarget** – IKTarget now supports direct Grip component reference (gripTarget field) as modern alternative to Fixer. Grip takes priority when both are assigned - [Documentation](/doc/unity/components-and-scripts/robot-inverse-kinematics/) 🐛 **Bug Fixes** * **IK Edit Mode Jitter** – Eliminated solution flickering in edit mode by caching last-solved target state and preventing redundant IK resolves when target hasn’t moved * **EthernetIP Interface** – Fixed connection handling and signal mapping issues * **Keba Interface** – Improved signal synchronization reliability *** **6.0.10-8590** — *15 February 2026* **Available for:** realvirtual **Professional** **Unity Support:** Unity 6000.0.28f1 and upwards (Unity 6) and Unity 2022 LTS *** 🚀 **New Features** * **igus iRC Interface** – Completely rewritten interface now supporting variable axis counts (1–9 axes) for all igus robot kinematics including ReBeL 6DOF, SCARA 4DOF, delta robots, and linear robots. Adds Fair-version features: inverse kinematics via CRI, position-based motion with RebelTarget, async motion commands, speed control, digital I/O, and OnMoveFinished events *(Professional)* - [Documentation](/doc/unity/components-and-scripts/interfaces/igus-rebel/) * **LogicStep SetSignalFloat & WaitForSignalFloat** – Two new logic step components for float signal control in automation sequences. SetSignalFloat sets a float signal to a specified value (non-blocking), while WaitForSignalFloat waits until a float signal meets a configurable condition with 5 comparison operators (>, <, ==, >=, <=) and adjustable tolerance *(Professional & Starter)* - [Documentation](/doc/unity/components-and-scripts/defining-logic/logicsteps/) ✨ **Enhancements** * **Reparenting Tool** – Migrated from IMGUI to UI Toolkit with improved workflow. Selected GameObject is now automatically set as Object to Move, so users only need to pick the target parent. Matches the MovePivot tool pattern with overlay and dedicated window support *(Professional)* * **PackageShare Email Integration** – Upload workflow now includes recipient email, name, and message fields directly in the upload form. Email delivery status is shown in the magic link dialog *(Professional)* 🐛 **Bug Fixes** * **Drive DriveTo 360 Wrap-Around** – Fixed DriveTo operations being clamped at UpperLimit on rotational drives, preventing crossing the 360°→0° boundary. LogicStep\_DriveTo and all other DriveTo callers now correctly wrap around on rotational drives with JumpToLowerLimitOnUpperLimit enabled *(Professional & Starter)* * **Denso Interface** – Unified real robot and VRC communication into a single bCAP client connection. Fixed broken ConnectRealRobot property with NotImplementedException stubs and corrected connection strings for both modes. I/O support now works for both real robot and VRC *(Professional)* - [Documentation](/doc/unity/components-and-scripts/interfaces/denso-robotics-pro/) * **UI Dropdown Navigation** – Fixed camera navigation consuming arrow keys while uGUI Dropdowns are focused. SceneMouseNavigation now detects uGUI elements via RaycastAll and blocks camera input when pointer is over UI controls *(Professional & Starter)* * **Source Spawn Collider** – Fixed collider state handling when spawning MUs from Source components *(Professional & Starter)* * **KinematicTool Second Axis** – Fixed NullReferenceException when interacting with the second axis in the KinematicTool editor *(Professional)* * **TransportSurface GroupName** – Fixed kinematic group name resolution by using GetGroupName() method instead of direct property access *(Professional & Starter)* * **Siemens Simit Interface Startup** – Fixed double XML/XLS signal file write on interface startup in builds. Removed redundant signal initialization that caused duplicate file exports. Added clean reconnect state reset for reliable re-initialization after disconnects *(Professional)* - [Documentation](/doc/unity/components-and-scripts/interfaces/siemens-simit-interface-pro/) *** **6.0.10-8590** — *15 February 2026* **Available for:** realvirtual **Starter** **Unity Support:** Unity 6000.0.28f1 and upwards (Unity 6) and Unity 2022 LTS *** 🚀 **New Features** * **LogicStep SetSignalFloat & WaitForSignalFloat** – Two new logic step components for float signal control in automation sequences. SetSignalFloat sets a float signal to a specified value (non-blocking), while WaitForSignalFloat waits until a float signal meets a configurable condition with 5 comparison operators (>, <, ==, >=, <=) and adjustable tolerance *(Starter)* - [Documentation](/doc/unity/components-and-scripts/defining-logic/logicsteps/) 🐛 **Bug Fixes** * **Drive DriveTo 360 Wrap-Around** – Fixed DriveTo operations being clamped at UpperLimit on rotational drives, preventing crossing the 360°→0° boundary *(Starter)* * **UI Dropdown Navigation** – Fixed camera navigation consuming arrow keys while uGUI Dropdowns are focused *(Starter)* * **Source Spawn Collider** – Fixed collider state handling when spawning MUs from Source components *(Starter)* * **TransportSurface GroupName** – Fixed kinematic group name resolution by using GetGroupName() method instead of direct property access *(Starter)* *** **6.0.9-8533** — *4 February 2026* **Available for:** realvirtual **Professional** **Unity Support:** Unity 6000.0.28f1 and upwards (Unity 6) and Unity 2022 LTS *** 🚀 **New Features** * **Chain Burst Compiler Optimization** – Added Unity Burst Compiler support for Chain component with automatic performance optimization up to 33x faster. Implements TransformAccessArray with IJobParallelForTransform for kinematic elements (29-33x speedup) and IJobParallelFor for physics elements (19-23x speedup). Features hybrid architecture that automatically splits elements based on MoveRigidBody flag, direct Burst transform writes for maximum performance, and intelligent spline baking with 100 cached samples. Includes one-click setup UI with NaughtyAttributes integration for automatic Burst package installation and REALVIRTUAL\_BURST compiler define configuration. Performance scales with element count - 100 kinematic elements: 5.8ms → 0.2ms (29x faster), 200 elements: 11.6ms → 0.35ms (33x faster) *(Professional & Starter)* - [Documentation](/doc/unity/components-and-scripts/motion/chain/) * **Drive Position Switch** – New DriveBehavior component that controls a boolean PLC signal based on drive position ranges. Supports multiple position areas with OR logic, area inversion for defining exclusion zones, global position offset with automatic normalization, and full wrap-around support for rotational drives. Features automatic detection of wrapped areas (e.g., 350-10° on 0-360° drives) with position normalization that handles drives temporarily exceeding limits during wrapping *(Professional & Starter)* - [Documentation](/doc/unity/components-and-scripts/motion/drive-position-switch/) * **LogicStep SetActiveOnly** – New logic step component that controls the ActiveOnly property of multiple realvirtualBehavior components simultaneously. Enables batch activation/deactivation of Drives, Sensors, and other components during automation sequences. Non-blocking step for instant execution within LogicSteps workflows *(Professional & Starter)* - [Documentation](/doc/unity/components-and-scripts/defining-logic/logicsteps/) ✨ **Enhancements** * **Source Collider State Preservation** – Source component now preserves the initial enabled/disabled state of all colliders in the template, including colliders on inactive child GameObjects. Generated MUs maintain the exact collider configuration from the template prefab, allowing users to control which colliders should be enabled or disabled on spawned objects. Fixes existing bug where colliders on inactive GameObjects were not properly handled. Also updated base SetCollider() method to include inactive GameObjects across all components *(Professional & Starter)* - [Documentation](/doc/unity/components-and-scripts/mu-movable-unit/source/) * **Drive Behavior Position Feedback Scale/Offset** – Added symmetric scale and offset transformations for position feedback in all drive behaviors with position feedback (Drive\_DestinationMotor, Drive\_ContinuousDestination, Drive\_FollowPosition, Drive\_Simple, Drive\_Speed, Drive\_MeasureSpeedPosition). Enables proper closed-loop control with PLCs by applying inverse transformation to feedback values. New properties: Current Position Scale, Current Position Offset, and Scale Feedback Position (boolean, default true) to optionally disable transformations and receive raw position values *(Professional & Starter)* - [Documentation](/doc/unity/components-and-scripts/motion/drive-behavior/) * **Drive\_Cylinder Inverted Control Logic** – Added Invert Output Logic boolean property to Drive\_Cylinder for normally-closed valve configurations or inverted signal requirements. When enabled, Out=false extends the cylinder and Out=true retracts it, reversing the standard control logic *(Professional & Starter)* - [Documentation](/doc/unity/components-and-scripts/motion/drive-behavior/) * **Runtime UI Tooltip System** – New tooltip components (rvUITooltip, rvUITooltipGenerator) for creating hover tooltips on UI elements with configurable delay, automatic placement, and style-aware positioning that adapts to window, vertical, and horizontal menu layouts *(Professional)* 🐛 **Bug Fixes** * **Pre/Post FixedUpdate Performance** – Fixed performance issues with IPreFixedUpdate and IPostFixedUpdate interface implementations that were causing unnecessary overhead during physics simulation cycles *(Professional & Starter)* * **Denso Interface Dynamic Axis Count** – Updated DensoInterface to support Denso robots with 4 or more axes instead of requiring exactly 6. Robot axis arrays are now dynamically allocated based on actual drive count, supporting configurations from 4 to 12 axes *(Professional)* - [Documentation](/doc/unity/components-and-scripts/interfaces/denso-robotics/) *** **realvirtual.io Simulation 6.0.9-8533** — *4 February 2026* **Compatible with:** realvirtual 6.0.9 Professional and Starter **Unity Support:** Unity 6, Unity 2022 LTS, and Tuanjie (Chinese market) ✨ **Enhancements** * **Unity 2022 LTS and Tuanjie Compatibility** – Full compatibility with Unity 2022 LTS and Tuanjie engine for the Chinese market, enabling conveyor system simulations across all supported Unity versions *** **6.0.8-8217** — *7 November 2025* **Available for:** realvirtual **Professional** **Unity Support:** Unity 6000.0.28f1 and upwards (Unity 6) *** 🚀 **New Features** * **Material Icons System** – Integration of Google Material Design Icons with 2234 icons available for both Editor and Runtime UI4 * **OpenCommissioning Interface Integration** – Added conditional assembly definitions for seamless integration with OpenCommissioning package (). Includes 7 link components (Cylinder, Drive Position, Drive Simple, Drive Speed, Grip, Lamp, Sensor) with custom UI Toolkit inspectors. Integration automatically activates when OpenCommissioning package is installed via Unity Package Manager *(Professional & Starter)* - [Documentation](/doc/unity/components-and-scripts/interfaces/opencommissioning/) ✨ **Enhancements** * **Component Menu Organization** – Added organized component menus for all major realvirtual components and interfaces. Components now accessible via `Component > Add` menu with logical categorization: Material Flow (Source, Sink, MU), Motion (Drive + 9 behaviors), Sensors, Gripping, Transport, Professional (IK, PathTracer), Visualization, and Interfaces. All 30+ interface classes now available under unified `realvirtual/Interfaces/` menu for improved discoverability *(Professional)* * **EditorGizmoOptions Customization** – Centralized editor gizmo settings with 29 customizable properties for drive gizmos (colors, sizes, arrow clicking), move pivot tool, duplicate finder, material window, and kinematic tool. All gizmo colors and dimensions now configurable through Unity Inspector * **Editor Toolbar System** – Enhanced overlay toolbar buttons with Material Icon integration and Unity’s standard blue active state. Improved visual feedback for overlay visibility and cleaner toolbar integration * **QuickEdit Interface Management** – New “Add Interface” button in QuickEdit overlay provides one-click access to all available communication interfaces. Automatically lists interfaces alphabetically with cleaned display names (Interface suffix removed), creates new scene roots when nothing is selected, or adds interface to existing empty scene roots. Streamlines workflow for setting up PLC, OPC-UA, Modbus, S7, and other industrial protocol connections *(Professional)* * **UDP Interface CSV Import** – Added CSV symbol table import functionality for automatic signal configuration. Supports BOOL, INT, and REAL data types with automatic byte position calculation. Import signals directly from PLC or SCADA system exports with configurable delimiter support. Includes Inspector buttons for file selection and import with comprehensive validation and error handling *(Professional)* - [Documentation](/doc/unity/components-and-scripts/interfaces/udp-pro/#csv-symbol-table-import) 🐛 **Bug Fixes** * **Mitsubishi MCP-X Interface CSV Import** – Fixed metadata not being populated on first Import button press. Signal manager now refreshes before metadata assignment, enabling proper single-operation import workflow *(Professional)* * **S7 TCP/IP Interface** – Fixed critical buffer overflow issues, incomplete reads, and offset calculation errors. Implemented non-blocking connection mechanism to prevent Editor freezing when connecting to unreachable PLCs, with configurable ConnectionTimeout property (default 10 seconds) * **Keba Interface** – Reliability improvements and bug fixes *(Professional)* * **Toolbar Buttons** – Corrected active state display across all overlay toolbar buttons (Material Window, QuickEdit, RecentItems, Simulation) *** **realvirtual.io Simulation 6.0.8-8217** — *7 November 2025* **Compatible with:** realvirtual 6.0.8 Professional 🚀 **New Features** * **Simulation Overlay** – New Scene view overlay with toolbar integration for rapid conveyor system assembly. Provides one-click access to straight conveyors, curved conveyors, chain transfers, guide rolls, sources, sinks, and path components (lines and curves). Integrated with toolbar toggle button and Material Icon system for streamlined simulation workflow 🐛 **Bug Fixes** * **Chain Transfer Component** – Fixed chain not lifting off conveyor despite showing ‘Out’ status. Resolved motion response issues and added collision detection for proper transfer functionality * **Shoe Sorter Component** – Fixed shoes not starting at conveyor front position. Corrected shoe positioning behavior where shoes would march forward leaving the conveyor belt instead of staying synchronized with belt movement *** **6.0.7-8152** — *26 October 2025* **Available for:** realvirtual **Professional\*\*\*\*Unity Support:** Unity 6000.0.28f1 (Unity 6) *** 🚀 **New Features** * **PathTracer Component** – Visualize object movement paths with speed-based coloring and trail persistence, enabling motion analysis and optimization validation during simulation runs *(Professional)* - [Documentation](/doc/unity/components-and-scripts/motion/path-tracer/) * **Duplicate Finder Tool** – Mesh-based duplicate detection with hash comparison for identifying identical geometries and optimizing scene performance through asset consolidation *(Professional)* - [Documentation](/doc/unity/components-and-scripts/tools/duplicate-finder/) * **Material Window Duplicate Detection** – Integrated duplicate finder in Material Window showing real-time duplicate count and scene analysis progress for selected objects *(Professional)* * **Recent Items Tracker** – Editor toolbar overlay that tracks and provides quick access to recently selected scene objects, project assets, and scenes *(Professional)* - [Documentation](/doc/unity/basics/user-interface/recent-items-pro/) * **State Statistics Component** – Production state tracking with time-based statistics collection for OEE analysis, bottleneck identification, and performance monitoring *(Professional)* - [Documentation](/doc/unity/components-and-scripts/statistics/state-statistics/) * **Camera Follow Object** – Automated camera tracking component with smooth pursuit, configurable offset, and rotation following for cinematic views *(Professional)* - [Documentation](/doc/unity/basics/runtime-ui/camera-control/) ✨ **Enhancements** * **Industrial Interface Improvements** – Enhanced FastInterfaceBase, updated Mitsubishi McpX protocol support, and PLCSIMAdvanced interface refinements for industrial connectivity *(Professional)* * **Runtime UI Enhancements** – New camera focus button component, improved scene mouse navigation, and inspector refinements *(Professional)* 🐛 **Bug Fixes** * Fixed PLCSIMAdvanced interface connection stability *(Professional)* *** **6.0.6-7994** — *3 October 2025***Available for:** realvirtual **Professional\*\*\*\*Unity Support:** Unity 6000.0.28f1 (Unity 6) *** 🚀 **New Features** * **Enhanced FastInterface System** – Added IOnInterfaceEnable, IPreFixedUpdate, and IPostFixedUpdate interfaces for precise industrial interface timing control *(Professional)* - [Documentation](/doc/unity/components-and-scripts/custom-interfaces/) * **Blueprint FastInterface Template** – Complete reference implementation demonstrating signal discovery, metadata handling, thread-safe patterns, and value simulation for custom interface development *(Professional)* - [Documentation](/doc/unity/components-and-scripts/custom-interfaces/) ✨ **Enhancements** * **Siemens Simit Interface Rework** – Migrated to FastInterface standard with improved initialization sequence, proper signal coupling, and enhanced debugging capabilities *(Professional)* - [Documentation](/doc/unity/components-and-scripts/interfaces/siemens-simit-interface-pro/) * **Camera Rotation Around Mouse Position** – Scene camera now rotates around mouse cursor position in Play mode for more intuitive navigation and inspection *(Professional & Starter)* * **Interface Lifecycle Management** – FastInterfaceBase now follows realvirtual Controller initialization pattern with OnInterfaceEnable and IPostAllScenesLoaded for proper startup sequencing *(Professional)* * **FastInterface Pre/Post FixedUpdate** – Signal synchronization moved to IPreFixedUpdate (PLC→Unity before physics) and IPostFixedUpdate (Unity→PLC after physics) for consistent timing *(Professional)* 🐛 **Bug Fixes** * Fixed SceneSelectable UnityEvent callback for adding links to scene selectable content *(Professional)* * Fixed Siemens Simit coupler initialization preventing proper signal connection in realvirtualCoupler *(Professional)* * Resolved FastInterfaceBase signal synchronization timing issues by implementing Pre/Post FixedUpdate pattern *(Professional)* *** **6.0.5-7962** — *28 September 2025***Available for:** realvirtual **Professional\*\*\*\*Unity Support:** Unity 6000.0.28f1 (Unity 6) *** 🚀 **New Features** * **KeyboardMove Component** – Precise keyboard-controlled movement with smooth interpolation, axis limits, and customizable key bindings for interactive positioning *(Professional)* - [Documentation](/doc/unity/components-and-scripts/scene-interaction/keyboard-move/) * **EthernetIP libplctag 1.5.2** – Major update with comprehensive PLC mapper support including Bool, Dint, Int, Real, String, and Timer mappers for enhanced industrial connectivity *(Professional)* - [Documentation](/doc/unity/components-and-scripts/interfaces/ethernetip/) * **Enhanced FixedUpdate Event System** – New IPreFixedUpdate and IPostFixedUpdate interfaces enabling precise timing control and improved component lifecycle management *(Professional)* ✨ **Enhancements** * **UI Height Management System** – Significant improvements to rvUIHeightAdjuster and rvUIHeightContributor for dynamic UI layouts with constraints and real-time adjustment capabilities *(Professional)* * **Scene Selection System** – Extended SceneSelectable with AddStringContent and AddLinkContent methods for dynamic content management *(Professional)* * **Signal System Performance** – Optimized FastSignalManager, FastSignalManagerHelper, and FastInterfaceBase for reduced overhead and better real-time performance *(Professional)* * **Thread-Safe Logging** – Enhanced ThreadSafeLogger implementation for improved performance in multi-threaded industrial interface scenarios *(Professional)* 🐛 **Bug Fixes** * Fixed PLC signal integration issues in PLCInputBool, PLCInputFloat, PLCInputInt, PLCOutputBool, PLCOutputFloat, and PLCOutputInt components *(Professional)* * Resolved networking stability problems in NetworkInitializer and XRMultiuserSetup for improved collaborative sessions *(Professional)* * Corrected FastInterfaceBase performance bottlenecks affecting real-time signal processing *(Professional)* * Fixed SwitchInputSystem handling for seamless VR/AR input mode transitions *(Professional)* * Resolved realvirtualController initialization sequence issues affecting component startup *(Professional)* * Fixed KEBA Interface connection handling and data exchange reliability for KEBA automation controllers *(Professional)* *** **Migration Notes** * The new IPreFixedUpdate/IPostFixedUpdate interfaces provide optional enhanced timing control - existing components continue to work without modification * EthernetIP library upgrade to 1.5.2 maintains backward compatibility while adding new mapper capabilities **Performance Improvements** * Optimized signal update mechanisms with reduced allocation in FastSignalManager * Improved thread synchronization in industrial interfaces reduces latency * Enhanced UI height calculation system reduces layout computation overhead *** **realvirtual.io Simulation 6.0.5-7962** — *28 September 2025***Compatible with:** realvirtual 6.0.5 Professional * Fixed CurvedConveyor bug *** **6.0.4-7894** — *16 September 2025***Available for:** realvirtual **Professional** and **Starter\*\*\*\*Unity Support:** Unity 6000.0.28f1 (Unity 6) and Unity 2022 LTS *** 🚀 **New Features** * **Scene Selection System** – Interactive 3D object selection with multi-layer visual feedback, hover effects, and real-time signal manipulation *(Professional)* - [Documentation](/doc/unity/components-and-scripts/scene-interaction/scene-selectables-pro/) * **Advanced Rendering Features** – Multi-object outline and overlay rendering with global mesh control for performance optimization *(Professional)* * **KEBA Interface** – Real-time bidirectional data exchange with KEBA automation controllers *(Professional)* - [Documentation](/doc/unity/components-and-scripts/interfaces/keba-interface/) * **KUKA Interface** – TCP/IP communication with KUKA OfficeLite virtual controllers *(Professional)* - [Documentation](/doc/unity/components-and-scripts/interfaces/kuka/) * **Mitsubishi MCPX Interface** – MC Protocol support for Q, L, R, iQ-R, and iQ-F series PLCs *(Professional)* - [Documentation](/doc/unity/components-and-scripts/interfaces/mitsubishi-mcpx/) * **Enhanced Testing Framework** – Automated MQTT signal testing and renderer feature safety validation *(Professional & Starter)* ✨ **Enhancements** * **Centralized Logging System** – New Logger class with hierarchical path tracking and color-coded messages replacing Debug.Log throughout framework *(Professional & Starter)* * **Comprehensive Documentation** – Added detailed doxygen documentation to major components including MU, TransportSurface, and scene selection system *(Professional & Starter)* * **UI System Improvements** – Enhanced window positioning, scaling, and URL field handling with better canvas boundary detection *(Professional & Starter)* * **Multiplayer Networking** – Improved NetworkSensor, NetworkDrive, and NetworkMU with better owner-based control and synchronization *(Professional)* * **Industrial Interface Updates** – Enhanced MQTT, SEW, Siemens, and new Wandelbots NOVA interfaces with improved connection handling *(Professional)* - [Documentation](/doc/unity/components-and-scripts/interfaces/) * **Component Lifecycle Management** – Better signal tracking, transport surface documentation, and enhanced gripper functionality *(Professional & Starter)* 🐛 **Bug Fixes** * Fixed physics synchronization issues during VR/AR object placement *(Professional)* * Corrected window positioning problems at canvas boundaries *(Professional & Starter)* * Improved network sensor value synchronization between owner and clients *(Professional)* * Fixed passthrough enable/disable logic in XR applications *(Professional)* * Resolved scaling calculations for UI windows in different screen configurations *(Professional & Starter)* *** **Breaking Changes** * Removed deprecated EnableXR component - use Unity XR Management instead **Migration Notes** * Logger class integration: Replace Debug.Log calls with Logger.Message() for consistent hierarchical logging * XR features require Meta XR SDK 68.0 or later * Multiplayer features require Unity Netcode for GameObjects 1.8.1 or later **Performance Improvements** * Optimized selection rendering with new multi-object render features * Better physics simulation control during placement operations * Enhanced signal update mechanisms for improved real-time performance *** **realvirtual.io Industrial Metaverse 6.0.4-7894** — *16 September 2025***Compatible with:** realvirtual 6.0.4 Professional**Requires:** Meta XR SDK 68.0 or later * Enhanced AR/VR scene integration with new XR placement system * Improved passthrough functionality and depth occlusion controls * Updated Imverse UI components for industrial metaverse applications * Compatible with new multiuser XR support features *** **realvirtual.io Simulation 6.0.4-7894** — *16 September 2025***Compatible with:** realvirtual 6.0.4 Professional and Starter * Updated for full compatibility with 6.0.4 framework * Enhanced conveyor system integration * Improved performance with new rendering features *** **realvirtual.io AIBuilder 6.0.4-7894** — *16 September 2025***Compatible with:** realvirtual 6.0.4 Professional and Starter * Framework compatibility updates for 6.0.4 architecture * Integration with new centralized logging system * Enhanced signal testing framework compatibility *** **6.0.3** — *18 August 2025*\ **Available for:** realvirtual **Starter**\ **Unity Support:** Unity 6000.0.28f1 (Unity 6) and Unity 2022 LTS (Tuanjie Version for Chinese market) Note For complete feature details and Professional-only features, see the realvirtual Professional 6.0.3 release (13 August 2025) below. **6.0.3** — *13 August 2025*\ **Available for:** realvirtual **Professional**\ **Unity Support:** Unity 6000.0.28f1 (Unity 6) and Unity 2022 LTS (Tuanjie Version for Chinese market) 🚀 **New Features** * **MUSwitcher Component** – Dynamic MU variant visualization based on sensor detection *(Starter + Professional)* - [Documentation](/doc/unity/components-and-scripts/changing-mus/muswitcher/) * **Runtime Persistence System** – Save and restore UI settings (including mouse sensitivity) during play mode *(Starter + Professional)* - [Documentation](/doc/unity/basics/runtime-ui/runtime-persistence/) * **Professional Editor Tools Upgrade** – New design & extended features for **MovePivot**, **AxisAligner**, and **ReparentingTool** *(Professional)* - [MovePivot](/doc/unity/basics/user-interface/move-pivot-points-pro/), [ReparentingTool](/doc/unity/basics/user-interface/reparenting-tool-pro/) * **QuickEdit System Redesign** – Modern UI Toolkit integration with improved MovePivot overlay *(Starter + Professional)* - [Documentation](/doc/unity/basics/user-interface/quick-edit/) * **realvirtual Overlay Toolbar** – New Scene view toolbar for quick access to framework tools *(Starter + Professional)* * **Scene Validation Function** – Check references & component integrity *(Starter + Professional)* * **LogicSteps Concept** – Parallel & serial containers with cycle time statistics and enhanced debugging *(Starter + Professional)* - [Documentation](/doc/unity/components-and-scripts/defining-logic/logicsteps/) ✨ **Enhancements** * **StatDisplay System** – Comprehensive real-time performance monitoring and production statistics for industrial automation analysis *(Professional)* - [Documentation](/doc/unity/components-and-scripts/scene-interaction/statdisplay/) * **TransportSurface Kinematic Group Support** – Enhanced collider handling with automatic kinematic group integration for improved CAD assembly performance *(Starter + Professional)* - [Documentation](/doc/unity/components-and-scripts/motion/transportsurface/#collider-handling) * Improved **Apply Standard Settings** & added **Project Path Display** in Unity’s main toolbar *(Starter + Professional)* * Expanded **Documentation** with full Doxygen standards across core components *(Starter + Professional)* 🐛 **Bug Fixes** * Upgraded **Logger Class** with hierarchical logging capabilities *(Starter + Professional)* * Fixed PLC control logic in demo scene *(Starter + Professional)* * Fixed missing references and 3D components in demo scenes *(Starter + Professional)* **Version 6.2.2 May 16, 2025 (realvirtual Starter)** * Fixed Bug for SmoothDrive (wrong message in ConsoleLog) **Version 6.2.1 06. May 2025 (realvirtual Professional, Starter, Simulation)** * Bugfix Parent Drive * Bugfix Transport Surface Animation * Release realvirtual Simulation 6 (compatible with realvirtual Professional and Starter 6) **Version 6.1.3 16. February 2025 (realvirtual Professional, Starter)** * Minor visual improvements [Demo Scene](/doc/unity/basics/demo-model/) * Better responsiveness of RuntimeUI * Integrated [RuntimeDebugger](/doc/unity/components-and-scripts/runtime-debugger/) for Console Log messages in Build / Runtime * Signal [JSON Exporter and Importer](/doc/unity/components-and-scripts/interfaces/signal-importer-exporter/) for a neutral generic Signal Import and Export * New [Scene Selectables](/doc/unity/components-and-scripts/scene-interaction/scene-selectables-pro/) * New [Runtime Persistance](/doc/unity/basics/runtime-ui/runtime-persistence/) for saving properties which are changed in Build / Runtime * Fixed nearly all Warnings in console log **Version 6.1.2 28. January 2025 (realvirtual Professional)** * Improvements Demo Scene * Bugfix Wandelbots NOVA Interface * Improvements on Icons and Buttons on smaller Devices and WebGL **Version 6.1.1 23. January 2025 (realvirtual Professional)** * Improvements Demo Scene * Fixed Bug in CADLink with automatically adding Colliders and creating Instantiated Materials **Version 6.1.0 21. January 2024 (realvirtual Professional, Starter)** * New Demo Scene * [New Overlay Buttons](/doc/unity/components-and-scripts/scene-interaction/screen-overlay-buttons/) * [New 3D Scene Buttons](/doc/unity/components-and-scripts/scene-interaction/3d-buttons/) * New [Volume Tracking](/doc/unity/components-and-scripts/volume-tracking-pro/) **Version 6.0.1 23. November 2024 (realvirtual Professional, Starter)** * New Signal in Source for generation based on Distance * Fixed Bug Ortho Overlay windows in Play mode * Fixed Bug in TransportSurface when DriveParent is used an moving **Version 6.0.0 6. November 2024 (realvirtual Professional, Starter)** * Release based on Unity 6 * Please check the [Upgrade](/doc/unity/advanced-topics/upgrade-guide/) guide for upgrading old projects * New Igus Rebel Interface * New URP Pipeline settings, Light, Bottom and Environment Settings - see [EnvironmentController](/doc/unity/components-and-scripts/game4automation/environment-controller/) * New [Visual Scripting](/doc/unity/components-and-scripts/defining-logic/behavior-graph/) based on [Behavior Graph](/doc/unity/components-and-scripts/defining-logic/behavior-graph/) **Version 2022.18 18. September 2024 (realvirtual Professional & Simulation)** * Bugfix Selection Window * Bugfix Duplicated Name in Signal * Bugfix TwinCAT interface with new BestHTTP3 library * Bugfix missing attribute LastCameraPosition in SceneMouseNavigation * Bugfix Measure Tool for Radius * Selection Window Prefix of Groups is now also used in Group Filter * Bugfix QuickEdit for Pathes (Curves and Lines) (only realvirtual Simulation) **Version 2022.17 16. August 2024 (realvirtual Professional & Starter)** Note **If you are upgrading to 2022.17 from versions before please delete before importing the new release these files:** * **realvirtual/Professional/CollectionBuilder/PlannerAttribute.cs** * **andy maybe, if existing somewhere in your project the file “EnvironmentSetup.cs”** - **New SEW MQTT Interface:** Introduced a new interface for SEW MQTT, enhancing communication capabilities with SEW Controllers (only Professional) - **Improvements in FixedUpdate Sequence:** Enhanced the FixedUpdate sequence for better performance and predictability. New events in the Drive component have been added (details at [motion-for-developers](/doc/unity/components-and-scripts/motion/motion-for-developers/)). - **Improved Folder Structure:** All Professional functions, except for interfaces, are now organized under the realvirtual Professional directory, improving project organization. - **Improvements and Bug Fixing in Kinematic Tool:** Enhanced functionality and resolved issues in the Kinematic Tool for more reliable operation (only Professional). - **Bug Fix - Linux Compilation:** Addressed and fixed compilation issues specific to Linux. - **Bug Fix Render Pipeline switching** - see [https://doc.realvirtual.io/advanced-topics/render-pipelines](/doc/unity/advanced-topics/render-pipelines/) **Version 2022.16 31. July 2024 (realvirtual Professional & Simulation)** * Bugfix CAM on continous CAMs with offsets. * Bugfix for new feature GuidedTransport on TransportSurfaces in realvirtual Simulation * Bugfix Snapping in combination with realvirtual Simulation * Bugfix Simulation Pause in combination with realvirtual Simulation * Bugfix Sensor on CurvedConveyor in realvirtual Simulation **Version 2022.15 15. July 2024 (realvirtual Professional)** Caution Before upgrading from an old release 2022.14 and before please imort into the existing project this Unitypackage below. After this you are ready to install the main update to 2022.15 📎 [Update202215 (2).unitypackage](/doc/unity/assets/Update202215%20\(2\).unitypackage) * Added Testing ([https://doc.realvirtual.io/advanced-topics/for-developers/testing](/doc/unity/advanced-topics/for-developers/testing/)) * Bugfixes Kinematic Tool ([https://doc.realvirtual.io/basics/user-interface/kinematic-tool](/doc/unity/basics/user-interface/kinematic-tool/)) * Bugfix on FixedUpdate sequence on Gears (see () * Bugfix on SceneMouse Navigation and Selection, added again icons for selecting views in Demo scene. **Version 2022.14 04. July 2024 (realvirtual Professional)** * Added warning on CAD import for non instantiated (into Assets folder) meshes. * Added Model Checker for giving hints on possible problems (see [https://doc.realvirtual.io/basics/user-interface/model-checker](/doc/unity/basics/user-interface/model-checker/)). * Added Kinematic Tool for faster kinematic definition (see [https://doc.realvirtual.io/basics/user-interface/kinematic-tool](/doc/unity/basics/user-interface/kinematic-tool/)) * Fixed problem compiling Inverse Kinematics to some mobile platforms. * Fixed problem with Fixer in some circumstances. * Fixed problem with FixedUpdate sequence of Drives, CAMs, Gears and Behavior models (see [https://doc.realvirtual.io/components-and-scripts/motion/drive-behavior](/doc/unity/components-and-scripts/motion/drive-behavior/)) * Extended example model for loading and unloading MUs (see [https://doc.realvirtual.io/components-and-scripts/mu-movable-unit](/doc/unity/components-and-scripts/mu-movable-unit/)). **Version 2022.13 17. Mai 2024 (realvirtual Professional, Simulation)** * Added RFSuide interface ([https://doc.realvirtual.io/components-and-scripts/interfaces/rfsuite](/doc/unity/components-and-scripts/interfaces/rfsuite/)) * Added Winmod interface ([https://doc.realvirtual.io/components-and-scripts/interfaces/windmod-y200](/doc/unity/components-and-scripts/interfaces/windmod-y200/)) * Added UDP interface ([https://doc.realvirtual.io/components-and-scripts/interfaces/udp](/doc/unity/components-and-scripts/interfaces/udp/)) * Added Websocket interface ([https://doc.realvirtual.io/components-and-scripts/interfaces/websocket](/doc/unity/components-and-scripts/interfaces/websocket/)) * Fixed severe bug inverse kinematics. Added Autonox robots, Autonox performance test model and empty kinematic ([https://doc.realvirtual.io/components-and-scripts/robot-inverse-kinematics](/doc/unity/components-and-scripts/robot-inverse-kinematics/)) * Added Pick and Place function to Robot Inverse Kinematic Pathpoints * Much better mouse navigation in Build (prevented deadlocks, hangs and so on) * Bugfix vertical chain ([https://doc.realvirtual.io/components-and-scripts/motion/chain](/doc/unity/components-and-scripts/motion/chain/)) * Displaying Groupname Prefix in Hierarchy View * Smooth interpolation between different saved Camera Positions * Fixed bug on radial conveyor sensor (realvirtual.io Simulation) * Fixed bug on guide rolls (realvirtual Simulation) (). **Version 2022.12 29. Apri 2024 (realvirtual Professional)** * Bugfix URRobots Interface * Added compatibility to AR, XR scaling for realvirtual.io Industrial Metaverse * Enhanced URP and HDRP switching * Bugfix for OPCUA when connectiong to S7 OPCUA servers * New Drive public method SetPosition(float position) for prevent one fixed update delay of positions for CAMs, FollowPosition and DriveRecordings. **Version 2022.11 13. March 2024 (realvirtual Professional)** * Switching between render pipelines with the main menu (see [https://doc.realvirtual.io/advanced-topics/render-pipelines#switching-render-pipelines](/doc/unity/advanced-topics/render-pipelines/#switching-render-pipelines)) * Upgrade of TwinCATHMI interface and MQTT interface to BestHTTPV3 and BestMQTTV3 support. * New Pivot tool (see h[ttps://doc.realvirtual.io/basics/user-interface/move-pivot-points](/doc/unity/basics/user-interface/move-pivot-points/).) * New Cutter function for cutting MUs into pieces (see [https://doc.realvirtual.io/components-and-scripts/cutter](/doc/unity/components-and-scripts/cutter/)) * Support of MQTT interface value parse for international floats and 0/1 to bool conversion. * Support in CAM for importing excel files. * Bugfix Mesh Gizmo in Kinematic * Bugfix Measure Tool. **Version 2022.10 10. Februar 2024 (realvirtual Professional, Simulation, OPCUA4Unity)** * Bugfix OPCUA Interface when reconnecting or using some IP adresses * New measure tool (see [https://doc.realvirtual.io/basics/measurement](/doc/unity/basics/measurement/)) * Bugfix GuidedTransport in circular collider and demo model * Bugfix compling and running on MacOs (complier defines adopted) * Bugfix snapping and side guides in realvirtual Simulation **Version 2022.09 11. November 2023 (realvirtual Professional)** * New interface to virtual Denso robot controllers Wincaps III (see [https://doc.realvirtual.io/components-and-scripts/interfaces/denso-robotics](/doc/unity/components-and-scripts/interfaces/denso-robotics/)) **Version 2022.08 27. September 2023 (realvirtual Professional)** * Bugfix Android Build * FMU interface removed from release * Bugfix HMI on Touch Displays * Bugfix CADLink Step CAD interface **Version 2022.07 07. September 2023 (realvirtual Professional)** Bugfix scene mouse and touch panning if behinder bottom surface center. Bugfix and improvements HMI ([see https://doc.realvirtual.io/components-and-scripts/hmi-components/start-your-own-hmi](/doc/unity/components-and-scripts/hmi-components/start-your-own-hmi/)) (only Prof). Linux compatible compiler defines. **Version 2022.06 14. August 2023 (realvirtual Professional, Starter)** Bugfix for some special CAD data proplems in CADLink Step interface (only Prof). Bugfix normal maps and vertices for 3MF Import in CADLink (only Prof). Bugfix scene mouse and touch panning if behinder bottom surface center (Prof and Starter).Bugfix and improvements HMI ([see https://doc.realvirtual.io/components-and-scripts/hmi-components/start-your-own-hmi](/doc/unity/components-and-scripts/hmi-components/start-your-own-hmi/)) (only Prof). **Version 2022.05 07. August 2023 (realvirtual Professional)** Bugfix in Assembly definitions of some interfaces, which made some interfaces not work in editor. **Version 2022.04 02. August 2023 (realvirtual Professional)** New HMI components - see [https://doc.realvirtual.io/components-and-scripts/hmi-components](/doc/unity/components-and-scripts/motion/guided-transport/) **Version 2022.02 17. July 2023 (realvirtual Professional)** PLCSimAdvanced interface now able to import “non HMI” PLC tags as well as structs. Bugfix Siemens Simit Interface. **Version 2022.01 30. June 2023 (realvirtual Professional, Starter)** This is the first release for Unity 2022 LTS. Compiles now also on WebGL without manually deleting erything rebranded from old game4automation to new realvirtual removed old and unnecessary things from main menu please also check the upgrade guide from 2021 here: [https://doc.realvirtual.io/advanced-topics/upgrade-to-2022](/doc/unity/advanced-topics/upgrade-to-2022/) **Version 2021.17 19. June 2023 (realvirtual Professional)** OPCUA new option for defining the Poll update rate (see [https://doc.realvirtual.io/components-and-scripts/interfaces/opcua#polling-opcu-nodes](/doc/unity/components-and-scripts/interfaces/opcua/#polling-opcu-nodes)). New function for optimizing meshes (reducing the number of polygons after import):\ [https://doc.realvirtual.io/components-and-scripts/mesh-optimizer](/doc/unity/components-and-scripts/mesh-optimizer/). Mouse and Touch navigation in Game mode improved, now working on all platforms including WebGL. Bugfix PLCSim Advanced when working with Int. Bogfix TwinCAT HMI interface when working with user logins. Bugfix RobotIK target. **Version 2021.16 31. March 2023 (realvirtual Simulation)** Removed severe Bug in Snapping function between Conveyors. Changes only made to realvirtual Simulation - noch changes in Starter or Professional) **Version 2021.16 10. March 2023 (realvirtual Professional, CADLink)** CADLink is now able to instantiate imported materials so that they are available in the Assets folder and not only in the scene / mesh itself. Fixed Bugs in Performance Optimizer (rotation and undo) Bugfixing Fixer - removed release on collission non MU option (will be replaced by Glue component in the next release) Replay and restart option in Game4automationController (enables automatically restarting the scene for demonstration purposes) **Version 2021.15 03. March 2023 (realvirtual Professional, Starter, OPCUA)** New MaterialWindow for quickly assigning Materials to imported CAD data ([https://doc.realvirtual.io/basics/material-window](/doc/unity/basics/material-window/)) Solved Problems when connecting to some OPCUA servers (e.g. Matrikon). Added Security Policy Selection and Password Signature Algorithm Selection for OPCUA Interface. Improvements for PerformanceOptimizer. Fixed problem with touch navigation and inverted axis in game mode. **Version 2021.14 16. Februar 2023 (realvirtual Professional, realvirtual Simulation)** OPCUA - added support for pathes below IP Adress. Renamed Recording to DrivesRecording New function Performance optimizer for baking meshes and improving performance in very large models: [https://doc.realvirtual.io/components-and-scripts/performance-optimizer](/doc/unity/components-and-scripts/performance-optimizer/) Removed bug with layer settings in combination with realvirtual simulation Added new interface based on Siemens Simit Interface: [https://doc.realvirtual.io/components-and-scripts/interfaces/siemens-simit-interface](/doc/unity/components-and-scripts/interfaces/siemens-simit-interface/) Selection raycast deactivated in standard game4automation prefab for preventing performance impacts when creating complex MU with sources. **Version 2021.13 25. Januar 2023 (realvirtual Professional)** Improved accuracy in RobotIK by calculating correction values. Bugfix TransportSurface animation. **Version 2021.12 13. Januar 2023 (realvirtual Professional , Starter, CADLink,OPCUA4Unity)** Improved performance and bugfix Step Import in CADLink (Professional, CADLink). OPCUA supported datatypes for realvirtual, conversion to PLCOutputInt (Uint16,Int16,UInt23,Int32) (Professional, OPCUA4Unity) OPCUA bugfix reading null values on bad status of a node (Professional, OPCUA4Unity). Bugfix TransportSurface animation (Professional, Starter) Bugfix TwinCATHMI interface (Professional) Inverse kinematic for Robots (RobotIK) - added function “Turn Correction” of 180 Degrees if sum of Axis 4 and 6 is 360, Axis 4 and 6 can be corrected by 180 Degrees. **Version 2021.11 20. December 2022 (realvirtual Professional , Starter, CADLink)** Fixed problems with Speed Changes and [TransportSurface](https://publisher.unity.com/components-and-scripts/motion/transportsurface) animation. Fixed performance and other issues with [CADLink](/doc/unity/basics/cad-import/cadlink/) Step interface. Changed properties in [TransportSurface](https://publisher.unity.com/components-and-scripts/motion/transportsurface) for limiting the RigidBody Constraints on enter and exit. New export full project as zip file option in main menu bar. Fixed Bug in [Drive](/doc/unity/components-and-scripts/motion/drive/) with UpperLimit signal. Fixed problem in Solutions within [RobotIK](/doc/unity/components-and-scripts/motion/robot-inverse-kinematics/) and additional function for drive position correction on PTP movements. **Version 2021.10 15. November 2022 (realvirtual Professional , Starter)** New documentation pages (this pages). Fixed problem in [Chain](/doc/unity/components-and-scripts/motion/chain/) systems. Fixed problems with [TransportSurfaces](/doc/unity/components-and-scripts/motion/transportsurface/) and parent drives [TransportSurface](/doc/unity/components-and-scripts/motion/transportsurface/) Performance Optimization by only setting colliders in needed cases Fixed the Problem with two NewtonSoftJSON DLLs (if it is twice in the project because of Unity packages) - see [newtonsoft-json.md](/doc/unity/advanced-topics/newtonsoft-json/ "mention") **Version 2021.09 01. November 2022 (realvirtual Professional , Starter)** Orthographic overlay cameras for top, front and sideview ([](/doc/unity/%5Bhttps:/realvirtual.io/documentation/current/runtimeui.html/#Campera-Positions)[https://realvirtual.io/documentation/current/runtimeui.html#Campera-Positions).](https://realvirtual.io/documentation/current/runtimeui.html#Campera-Positions).%5C).%3Cbr%3ESwitch)Switch]\([https://realvirtual.io/documentation/current/runtimeui.html#Campera-Positions%5C).%3Cbr%3ESwitch)Switch](https://realvirtual.io/documentation/current/runtimeui.html#Campera-Positions%5C).%3Cbr%3ESwitch)Switch)) for setting Main camera in orthographic mode ([](/doc/unity/%5Bhttps:/realvirtual.io/documentation/current/runtimeui.html/#Campera-Positions)[https://realvirtual.io/documentation/current/runtimeui.html#Campera-Positions).](https://realvirtual.io/documentation/current/runtimeui.html#Campera-Positions).%5C).%3Cbr%3EGame)Game]\([https://realvirtual.io/documentation/current/runtimeui.html#Campera-Positions%5C).%3Cbr%3EGame)Game](https://realvirtual.io/documentation/current/runtimeui.html#Campera-Positions%5C).%3Cbr%3EGame)Game)) window camera position and view setting is saved automatically after game ends and restored.\ New design of standard scene and demo scene with black background and bottom.\ New Universal Robots interface including demo model with UR script example ([https://realvirtual.io/documentation/current/runtimeui.html#Campera-Positions).](https://realvirtual.io/documentation/current/runtimeui.html#Campera-Positions).%3Cbr%3EBug) Bug in TransportSurface in combination with parent drives of version 2021.07 and 2021.08 fixed. Parent drive can now have multiple Drives above and movement direction of parent drive is not limited. **Version 2021.08 26. Oktober 2022 (realvirtual Professional )** Removed bug in Transportsurface with Parent Drives of Version 2021.07 **Version 2021.07 22. Oktober 2022 (realvirtual Professional, CADLink)** Stability improvements in OPCUA interface. Stability improvements in PLCSIM Advanced interface. New MQTT interface ([https://realvirtual.io/documentation/current/mqtt.html).](https://realvirtual.io/documentation/current/mqtt.html).New) New TwinCATHMI interface () CAD Step import DLLs based on a new framework. **Version 2021.06 26. Steptember 2022 (realvirtual Professional)** Enhancements **Fixer** (blocking handing over to other fixers, limitation on tags and setting tags after fixing). **Pattern** component for automatically building circular or matrix patterns with gameobjects (e.g. Fixer patterns). New component Unfixer. Support of additive scene loading, changes in **Game4automationController** for defining **additive scenes** for one scene. game4automation controller in additive scenes is automatically disabled. **Version 2021.05 - 31. August 2022 (realvirtual Professional)** Bugfix robot inverse kinematics when PTP and same position. Bugfix DrivePosition in some rare cases with RobotIK. Additional signal waiting and signal setting function on inverse kinematics targets.Added optional HomePosition for RobotIK on simulation start. Bugfix inverted Upper and LowerLimit Signals on Drive. Bugfix compile switches for SpaceNavigator and IOS.Improvements and bugfixes in Fixer for beeing able to act as a simple Gripper like vaccum grippers. **Version 2021.04 - 26. August 2022 (realvirtual Professional)** New robot inverse kinematic function (see ). Temlate for creating new game4automation scenes with File > NewScene.\ Source is now working with Fixer on created Mus. **Version 2021.03 - 14. Juli 2022 (realvirtual Professional, realvirtual Simulation)** First 2021 release for Professinal AND Simulation. Minor changes in chain in Professional for compatiblity to Simulation. In Simulation added Shoe Sorter, Cross Belt Sorter and Spiral Conveyor - see ) **Version 2021.02 - 07. Juli 2022 (realvirtual Professional, Starter)** Support for AGX physics engine - see CreateOnDistance in source with optional random behavior - see Singal Manager able to deactivate unconnected signals - **Version 2021.01 -24. June 2022 (realvirtual Professional, Starter)** Product rebranded to realvirtual (namespace is unchanged for backwards compatibility) Bugfixes OPCUA interface Support for Unity Visual Scriping (see ) **Version 2020.15 -10. February 2022 (Game4Automation Professional)** EthernetIP Interface added (see ) **Version 2020.14- 17 Januar 2022 (Game4Automation Professional)**\ OCUA basis framework changed to LibUA for compatiblity to IL2CPP, Hololens and IOS **Version 2020.13- 08 December 2021 (Game4Automation Starter, Professional)** New LogicSteps for visual scripting (Professional) (see ). Better performance and extensions MemoryArea ReadWrite Mode S7 interface (see ). Additional CyclcSumCommand mode for faster communication with TwinCAT ADS (Professional) (see ). Added PerformanceOptimizer for combining meshes (Professional). Added SignalManager for automatically connecting and creating signals (Professional). **Version 2020.12- 21 November 2021 (Game4Automation Starter, Professional, Simulation)** Bugfix S7Interface AreaReadWrite Mode Bugfix compile errors for executables. **Version 2020.11- 15 November 2021 (Game4Automation Starter, Professional, Simulation)** Rebranding of Conveyor Library to Game4Automation Simulation Changes in Starter and Professional for Game4Automation Simulation compatibility **Version 2020.10 - 11 November2021 (Game4Automation Starter)** Simit SHM now included in Starter Bugfix QuickEdit Overlay **Version 2020.09 - 13 October 2021 (Game4Automation Professional, Starter)** New ABB RobotStudio Interface (only Professional) Fixed bug in writing M floats in S7 interface Interact3D component for Pushbuttons in 3D scene Added support of Articulation Bodies kinematic **Version 2020.08 - 17 September 2021 (Game4Automation Professional, Starter)** New optional area read/write mode for faster signal exchange in S7 interface Setting for display quality in runtime ui Fixed bug missing hierarchy icons **Version 2020.06 - 20 July 2021 (Game4Automation Professional, Starter)** Added icons for standard game4automation scripts ![](https://forum.realvirtual.io/s/attachments/27424/2/1/13ba88a9308d4e881b01f8f5202cf412.png) Better standard settings in source, sensor and mu PLCOuput in Sensor now included - no Sensor\_Standard needed any more Fixed compile error for Global.cs in Build **Version 2020.05 - 09 July 2021 (Game4Automation Professional, Starter)** New Force Drive - moving Cylinders with Forces New Recorder for recording Drive movements (e.g. from external Robot Controller Bugfixes QuickEdit Bugfixes Gripper & Aligner **Version 2020.04 - 29 June 2021 (Game4Automation Professional, Starter)** Fixed Align for QuickEdit\ QuickEdit on/off is now saved in preferences\ New Fixer Component\ New example Model for Gripping objects (Grip, Gripper and Fixer)\ Restructured Code for Gripping (IFIX interface) **Version 2020.03 - 22 June 2021 (Game4Automation Professional, Starter)**\ New Quick Edit Window for faster engineering workflow (see ) Fixed problem with importing OPCUA nodes Renaming Simulink interface Fixed problem with reading boolean values from DBs in S7 interface Calculate max distance in SceneMouseNavigation by bounding box New script for modelling robot grippers with finger (Gripper.cs) **Version 2020.02 - 14 May 2021 (Game4Automation Professional, Starter,OPCUA4Unity)**\ Fixed Bug in OPCUA with multiple parallel connections Highlighting of Groups and Kinematic connections Added ability to Grip part from another Gripper (see dermo Assets/game4automation/Scenes/DemoGripping.unity)\ Added script for definiing drive motion sequences (see also Assets/game4automation/Scenes/DemoGripping.unity)\ Automatic calculation of maximimum scene mouse zoom in game mode based on bounding box\ Renaming of Matlab interface to Simulink interface\ Fixed positioning bug on rotating transport surfaces **Version 2020.01 - 04. April 2021 (Game4Automation Professional, Starter,Conveyor-Library)** Upgrade to Unity Version 2020 LTS NaughtyAttributes upgraded, now remains in standard namespace Improvements in Signal connection information Improvements in Reconnect of OPCUA on connection losses **Version 2019.13 - 31. March2021 (Game4Automation Professional, Starter)** Minor changes for the new Game4Automation Conveyor Library Compatibility with the Game4Automation Conveyor Library - available soon on the Unity Asset Store (see ) **Version 2019.12 - 16. February 2021 (Game4Automation Professional, Starter, CADLink & OPCUA)** Added ability to import Step files (CADLink) Added Behavior Models for Drives - Drive\_Speed and Drive\_ContinousDestination (see ) Added Measure Component (see ) Added MeasureRaycast Component (see ) Added FMI Interface (see , only Professional) Added Events, Multithreaded Connection to OPCUA Interface (see , only OPCUA and Professional) Added ability to delete MUs in Sensors Added events to MUs (Load and Unload) Added functions for correctly aligning ChainElements Updated NaughtAttributes Tool to newest version OPCUA now limited to Windows (IL2CPP and Mono) and Android (only Mono) **Version 2019.11 - 29. November 2020 (Game4Automation Professional & Starter)** Bugfix Gripper on robot in demo model. **Version 2019.10 - 26. November 2020 (Game4Automation Professional & Starter)** Added ability to hide non G4A components on GameObjects in Unity Editor\ Improved possibilities to move Transportsurfacs (see )\ New component StartDriveOnCondition (see Demo scene DemoStartDriveOnCondition) **Version 2019.08 - 18. November 2020 (Game4Automation Professional)** Bugfix OPCUA, fixing Licensing issues and IL2CPP compilation **Version 2019.08 - 09. November 2020 (Game4Automation Professional)** Fixed Bug OPCUA interface - missing references **Version 2019.06 - 05. November 2020 (Game4Automation Professional)** Fixed licensing issue for STEP interface **Version 2019.05 - 23. October 2020 (Game4Automation Professional)** CADLink - Added STEP Interface (see [**https://youtu.be/nsPeRgbU\_XE**](https://youtu.be/nsPeRgbU_XE)) S7 Interface - Added ability to read DB values (see ) Modbus Interface Added (see ) **Version 2019.04 - 20. August 2020 (Game4Automation Professional, CADLink)** CADLink 3mf export now supports big meshes with more than 65.000 vertices CAM continuous function for driving e.g. chains with CAMS CAMTime can be started at the end of another CAMTime **Version 2019.03 - 12. August 2020 (Game4Automation Professional, Starter, OPCUA)** **New Version numbering now with Unity Base Version (2019) in front of our Version number.** **Please upgrade to Unity 2019.4 LTS!** Better stability and automatic reconnecting for all interfaces (Shared Memory, OPCUA, TwinCAT, Sz-TCPIP) Integrated First Person View in Runtime UI () New standard switch to enable or disable components and for switch between Simulation Mode and Virtual Commissioning mode () **Version 2019.01 - 07. July 2020 (Game4Automation Professional, Starter)**\ **New Version numbering now with Unity Base Version (2019) in front of our Version number.** **Please upgrade to Unity 2019.4 LTS!** New RoboDK Interface ([**https://youtu.be/C2ZngS9Lhck**](https://youtu.be/C2ZngS9Lhck)) OPCUA bugfixes improvement New ABB Robotstudio OPCUA Demo scene ([**https://youtu.be/3v8-7ap\_\_RA**](https://youtu.be/3v8-7ap__RA)) Chain Systems **Version 1.036 - 07. June 2020 (Game4Automation Professional, Standard, CADLink)** Bugfix CADLink import (recalculated Mesh Bounds) New Function for PIXYZ based Update of large CAD Data (see [**https://youtu.be/1IC12iZzL0w**](https://youtu.be/1IC12iZzL0w)) PartChanger for changing visual appearance of CAD files (see ) Bugfixes PLCSIMAdvanced Interface Bugfixes Sensor and Grip New function Prefixes in Groups **Version 1.034 - 14. February 2020 (Game4Automation Professional & Starter)** New function for motion axis CAM - see , and on Youtube New tool for checking CAD imported meshes CADChecker (only Professional) - see New tool for selecting and grouping components SelectionWindow (only Professional) - see **Version 1.033 - 08. January 2020 (Game4Automation Professional \&Starter)** Bugfix Follow Parent option in Transportsurfaces Removed Interact message on simulation startup **Please remove Assetsgame4automationprivateEditorQuickToggle folder when upgrading from Version 1.031 and below!** ![](https://forum.realvirtual.io/s/attachments/27424/2/1/2865dc19ed4199a7d0be3a7693522a68.png) **Version 1.032 - 18. December 2019 (Game4Automation Professional & Starter)** Bugfix TwinCAT Interface (crash when starting multiple times) Bugfix Interact when importing **Version 1.031 - 17. December 2019 (Game4Automation Professional & Starter)** New Icons in HierarchyView and HierarchyView Performance Improvement ![](https://forum.realvirtual.io/s/attachments/27424/2/1/7b5538c30cdfde9e3a7857ddef1e19da.png) Performance Improvement Transportsurfaces New Kinematic and Group Functions (see Documentation , and Youtube Tutorial: ) Interact Integration (Interact is an optional module for Game4Automation) see **Version 1.030 - 22. November 2019 (Game4Automation Professional & Starter)** Added new radial Transportsurfaces. Transportsurface is getting radial as soon as you select RotationX,RotationY or RotationZ as direction. The center point of the rotation needs to be in the local coordinate system zero. ![](https://forum.realvirtual.io/s/attachments/27424/2/1/212e2d0542ddc0a29011acc1eb5f9d1b.png) Changed calculated deltatime in Drives and Transportsurfaces to fixedtimeDelta for better accuracy. **Version 1.029 - 19. November 2019** Signals are now displaying if they are connected to a behavior model or not. If not, the signal values are displayed like that: “(SignalValue)” ![](https://forum.realvirtual.io/s/attachments/27424/2/1/d5a0e9b08e5ae6f494f6b2a0da6619ac.png) Each Signal now has information about its connections to behavior models. In the section “Signal Connection Info” the Behavior model and the connection is displayed to which the signal is connected: ![](https://forum.realvirtual.io/s/attachments/27424/2/1/e1b01b0798f34827ca6e9314f65a998f.png) **Version 1.028 - 15. November 2019 - Bugfix TwinCAT Interface** Bugfix Error Drive directions and Drive handles in rotated assemblies **Version 1.027 - 14. November 2019 - Bugfix winCAT Interface** Bugfix read of signals (sometimes not all signals where transfered in one cycle together) **Version 1.026 - 5. November 2019 - Bugfixes** Bugfix in TwinCAT ADS typecasts\ Bugfix in OPCUA typecasts\ Better OPCUA4Unity and Game4Automation integration **Version 1.025 - 31. October 2019 - TwinCAT**\ Beckhoff TwinCAT Interface integrated - see in Youtube Drive Positions are now also working correctly if parent GameObjects are scaled. Position are always relative in millimeters, no matter how the scaling of the GameObject itself is. **Version 1.024 - 25. October 2019 - Bugfixes** Problem with space in path name for parts4cad fixed () Problem with rotational drive in combination with prismatic fixed () Full application, including OPCUA, now compiles again with .Net4.0 settings and Mono or ILCPP: ![](https://forum.realvirtual.io/s/attachments/27424/2/1/8f24e5bbf1976b439b1f003cba613504.png) **You can find older release notes here:**