# Demo Model

{% hint style="info" %}
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**](https://doc.realvirtual.io/basics/demo-model/demo-model)
{% endhint %}

## 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.

<figure><img src="https://260262196-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpYxFg97YnJX96UzNNTSd%2Fuploads%2Fgit-blob-dd18d60e9a1033dd6428b866d2850d9b1d28c49d%2Fnewdemo.gif?alt=media" alt=""><figcaption><p>realvirtual.io Demo model</p></figcaption></figure>

## Starting and Navigating in the Demo

### 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

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

* **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

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

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

| (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

On the right side of the **Scene**, you will notice a set of **overlay buttons**.

<figure><img src="https://260262196-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpYxFg97YnJX96UzNNTSd%2Fuploads%2Fgit-blob-08e57b017c9ab21a814ae85956bbad1dcac0f262%2Fnewdemoverlay.png?alt=media" alt=""><figcaption><p>Overlay buttons for hiding components and changing camera positions (views)</p></figcaption></figure>

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**](#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

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.

<figure><img src="https://260262196-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpYxFg97YnJX96UzNNTSd%2Fuploads%2Fgit-blob-40949e652a83fb28451faf2ba0d1e6f29550b075%2Fnewdemobuttons.png?alt=media" alt=""><figcaption><p>3D Buttons within the Scene</p></figcaption></figure>

For more information on setting up and customizing these 3D Buttons, see the [**3D Buttons**](#id-3d-buttons) section.

## 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)**

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**](https://doc.realvirtual.io/components-and-scripts/game4automation)**.**

### **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**](https://doc.realvirtual.io/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)**](https://doc.realvirtual.io/basics/reusable-components-prefabs) section.

### 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**](https://doc.realvirtual.io/components-and-scripts/motion) section.

<figure><img src="https://260262196-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpYxFg97YnJX96UzNNTSd%2Fuploads%2Fgit-blob-2f289ad263a60aa7caaadd58dbfd1c04ae81a76e%2Fnewdemomachine.png?alt=media" alt=""><figcaption><p>Defined kinematic for the CNC Machine</p></figcaption></figure>

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**

![](https://260262196-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpYxFg97YnJX96UzNNTSd%2Fuploads%2Fgit-blob-aeaa9e65358e4a23e611d29bf76a46f618e532cd%2Fimage.png?alt=media)\\

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.

<figure><img src="https://260262196-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpYxFg97YnJX96UzNNTSd%2Fuploads%2Fgit-blob-489b05899d713ac4e66b8b0949de4407eaad9dec%2Fnewdemointerface.png?alt=media" alt=""><figcaption><p>Interface Signals in Demo</p></figcaption></figure>

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** ](#interfaces)section.

### **Sources and MUs**

![](https://260262196-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpYxFg97YnJX96UzNNTSd%2Fuploads%2Fgit-blob-f0e7d492df4143f8a89c3c4c7cd0c68ea8d4fbed%2Fimage.png?alt=media)

\
In realvirtual.io, objects that move based on physics are called [**MUs**](https://doc.realvirtual.io/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**

![](https://260262196-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpYxFg97YnJX96UzNNTSd%2Fuploads%2Fgit-blob-82e96baf0f52c180bd0c7c6b031bc78cbe716fdd%2Fimage.png?alt=media)\
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.

<figure><img src="https://260262196-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpYxFg97YnJX96UzNNTSd%2Fuploads%2Fgit-blob-b232a70b9fedd3a4f88c437f7e8e7028be152a32%2Fnewdemoplc.png?alt=media" alt=""><figcaption><p>PLC code written in Unity scripting and connected to the Signals</p></figcaption></figure>

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.**](https://doc.realvirtual.io/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.
