realvirtual.io
  • Building Digital Twins with Unity and realvirtual.io
  • Basics
    • Installation
    • Demo Model
      • Old Demo Model
    • Editor User Interface
      • Hierarchy Window
      • 3D Views
      • Quick Edit
      • Move Pivot Points (Pro)
      • Selection Window (Pro)
      • Material Window (Pro)
      • Measurement (Pro)
      • Kinematic Tool (Pro)
      • Model Checker
    • Runtime UI
      • Group Manager
      • Debug Console
      • Responsiveness
      • Runtime Persistence
    • Importing and exporting
    • Folder structure
    • Tutorial
    • Physics
    • CAD import (Pro)
      • CADLink (Pro)
      • CAD Checker (Pro)
      • CAD Updater (Pro)
    • Reusable Components (Prefabs)
    • Cadenas parts4cad
    • Publishing the Digital Twin
    • Revision management
  • News
  • Login & Download Updates (Pro)
  • Components & Scripts
    • Realvirtual
      • Environment Controller
    • MU, Source and Sink
      • Source
      • Sink
    • Motion and Kinematic
      • Drive
      • Kinematic
      • Group
      • Joint
      • CAM
      • TransportSurface
      • Guided Transport
      • Drive behavior
      • Chain
      • Chain element
      • Motion for developers
    • Sensors
      • Sensor
      • Measure
      • MeasureRaycast
    • Picking and Placing MUs
      • Grip
      • Gripper
      • Fixer
      • Pattern
    • Changing MUs
      • MaterialChanger
      • PartChanger
      • Cutter
    • Scene Interaction
      • 3D Buttons
      • Screen Overlay Buttons
      • Scene Selectables
      • Lamp
      • Interact3D
      • UI components
      • HMI components (Pro)
        • Start your own HMI
        • HMI Tab
        • HMI DropDown
        • HMI Puschbutton
        • HMI Switch
        • HMI Value
        • HMI Text
        • HMI Slider
        • HMI Message
        • HMI Marker
      • ModelZoo (Pro)
    • Interfaces
      • Interface Tools
        • Signal Manager
        • Signal Importer Exporter
        • Signal Catcher
        • OnValueChangedReconnect
      • Signal Importer / Exporter
      • ABB RobotStudio (Pro)
      • Denso Robotics (Pro)
      • EthernetIP (Pro)
      • Fanuc (Pro)
      • FMI
      • Igus Rebel
      • MQTT (Pro)
      • Modbus (Pro)
      • OPCUA (Pro)
      • PLCSIM Advanced (Pro)
      • RoboDK (Pro)
      • RFSuite (Pro)
      • SEW SimInterface (Pro)
      • Siemens Simit Interface (Pro)
      • Simit Shared Memory (Pro)
      • Simulink (Pro)
      • S7 TCP
      • TwinCAT (Pro)
      • TwinCAT HMI (Pro)
      • UDP (Pro)
      • Universal Robots (Pro)
      • Wandelbots Nova (Pro)
      • Websocket (Pro)
      • Windmod Y200 (Pro)
      • Custom Interfaces
    • Performance Tools
      • Combine Meshes (Pro)
      • Create Prefab (Pro)
      • Hierarchy Cleanup (Pro)
      • Mesh Optimizer (Pro)
      • Performance Optimizer (Pro)
    • Defining Logic
      • Unity Scripting
      • Behavior Graph
      • Logicsteps
      • Unity Visual Scripting
      • Recorder
    • Robot Inverse Kinematics (Pro)
    • Volume Tracking (Pro)
  • Multiplayer (Pro)
  • Extensions
    • ModelZoo
      • Beckhoff TwinCAT
      • Siemens S7
      • Denso Cobotta 1300
      • Wandelbots Nova Fanuc CRX
      • Universal Robots UR10
      • Fanuc Roboguide
    • realvirtual.io AIBuilder
      • realvirtual.io AI Builder Overview
      • Generate AI Training Data
      • AI Training
      • Testing AI in a Digital Twin
      • Deploying the AI
    • realvirtual.io Simulation
      • Conveyor Library
      • Path System
        • Path finding
        • Line
        • Curve
        • Workstation
        • Catcher
        • Pathmover
    • realvirtual.io Industrial Metaverse
      • Setup Guide
      • VR Modules
      • AR Modules
      • Multiuser
    • AGX Physics
    • VR Builder
    • CMC ViewR
  • Advanced Topics
    • Render Pipelines
    • Mixed Reality with Meta Quest3
    • Upgrade Guide
      • Upgrade to 2022
    • Open Digital Twin Interface
    • Usefull Addons
    • Improving Performance
    • Supported Platforms
    • Compiler Defines
    • For Developers
      • Important Classes and Interfaces
      • Assembly Definitions
      • Starting your development
      • Class documentation
      • realvirtual Init Sequence
      • realvirtualBehavior Lifetime Methods
      • Testing
    • Newtonsoft JSON
    • Troubleshooting
  • Release Notes
  • AI Digital Twin Assistant (GPT4)
  • License Conditions
Powered by GitBook
On this page
  • Basic concepts
  • Constructing the spline
  • Chain properties
  • Using Unity Spline
  • Constructing a vertical chain
Edit on GitHub
  1. Components & Scripts
  2. Motion and Kinematic

Chain

PreviousDrive behaviorNextChain element

Last updated 11 days ago

A chain is moving components along a spline path or a simulation path. This is useful for modeling for example for material handling or tool changers which are driven by chains. You can find at Assets/game4automation/Scenes/DemoChain a demo scene for the Chain. The usage of the simulation path is only possible with game4automation simulation, which is not included in game4automation. There are separated demos for this in game4automation simulation.

The usage of the simulation path is only possible with game4automation simulation, which is not included in game4automation. There are separated demos for this in game4automation simulation.

Basic concepts

A chain is always connected to a drive. Thus, the movement of the chain always depends on the current drive position and speed. Usually, you should use a Drive in which the Axis is set to Virtual to move the chain.

To the chain one or several are connected. These are created automatically pon simulation start by the chain. Usually, these chain elements should be Prefabs inside your project.

On the same component where the Chain script is attached to, a Spline script needs to be attached. The spline script is defining the exact path of the chain based on points within and out tangents.

Constructing the spline

For extending a spline or for creating a first point you can push on the Extent button on the Spline. This will generate a Point with 2 included Tangent points. You can move these points like you can move any Gameobject to construct your spline. The order of these Gameobjects defines also 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.

Chain properties

The Chain Orientation determines whether the chain is horizotal or vertical. With Chain Element the prefab of the chain elements which should be placed along the spline needs to be assigned to the chain. The Connected Drive is moving the chain. The Number of Elements defines the number of elements that should be created upon simulation start on the chain. The start position is an offset in relation to the spline start. By selecting Calculate Delta Position the distance between the chain elements is calculated automatically based on the spline length and the number of elements. Enabling 'ScaledOnFixedLength' allows the spline to maintain a constant total length. This enables external drives to provide positional data for each ChainElement, which are then accurately mapped to their corresponding positions along the spline based on the fixed length.

Using Unity Spline

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.

  • In Project Settings > Player, add "REALVIRTUAL_SPLINES" under Script Compilation Symbols to use the unity splines with realvirutal chain.

  • Right-click in the Hierarchy and select the desired base spline from the Spline menu. 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 in the picture below). This is relevant if you want to set up a vertical chain.

  • Add the ChainUnitySpline and Chain components to the created GameObject.

Once the chain is set up, it can be used with ChainElements and drives.

Constructing a vertical chain

To construct the spline as described in the caption 'Constructing the spline' as a vertical chain, follow these steps:

  • Build the spline in the positive Z direction, starting from the bottom-right anchor point, and continue clockwise against the clock.

  • Maintain a vertical angle of exactly 90 degrees. Avoid inclinations to prevent misalignment with interpolated curves representing the height difference.

  • Note that these instructions are currently applicable only to splines with four anchor points and not more.

  • Ensure that the front of the chain element also faces in the positive Z direction. This orientation is necessary for the parent GameObject.

© 2025 realvirtualGmbH - 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.

https://realvirtual.io
Chain elements
Chain elements
realvirtual chain based on untiy spline
example spline for a vertical chain