Logicsteps
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.
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.
LogicSteps automatically handle execution flow, progress visualization, and state management. Blocking steps pause execution until completion, while non-blocking steps execute immediately.

Properties
Base LogicStep Properties
All LogicStep components inherit these common properties:
Name
Unique identifier for the logic step.
Type: String
Default: Empty
Use case: Required for jump operations and sequence debugging
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
Indicates if this step is currently executing.
Type: Boolean (read-only)
Use case: Runtime debugging and monitoring
Container Components
Serial Container
Executes child LogicSteps in sequential order.
Debug Mode
Enables detailed execution logging.
Type: Boolean
Default: false
Use case: Troubleshooting sequence execution
Active Logic Step
Index of currently executing step.
Type: Integer (read-only)
Use case: Monitor current execution position
Number Logic Steps
Total number of child steps.
Type: Integer (read-only)
Use case: Sequence overview and validation
Parallel Container
Executes child LogicSteps simultaneously.
Debug Mode
Enables detailed execution logging.
Type: Boolean
Default: false
Use case: Troubleshooting parallel execution
Available LogicStep Types
Delay
Pauses execution for a specified 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

Drive To
Moves a drive to a specific position and waits for completion.
Drive
Target drive component to control.
Type: Drive reference
Default: None
Use case: Connect to the drive you want to position
Destination
Target position in millimeters or degrees.
Type: Float
Default: 0
Use case: Set absolute or relative target position
Destination From PLC Output
Alternative position source from PLC interface.
Type: PLCOutputFloat reference
Default: None
Use case: Dynamic positioning from external control systems
Relative
Treats destination as offset from current position.
Type: Boolean
Default: false
Use case: Incremental movements relative to current position
Live Edit
Enables real-time parameter adjustment during runtime.
Type: Boolean
Default: false
Use case: Runtime tuning and debugging

Start Drive To
Initiates drive movement without waiting for completion.
Properties are identical to Drive To, but execution continues immediately to the next step.

Start Drive Speed
Sets drive speed for continuous movement.
Drive
Target drive component to control.
Type: Drive reference
Default: None
Use case: Connect to the drive you want to control
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

Wait for Drives at Target
Pauses execution until specified drives reach their target positions.
Drives
List of drives to monitor.
Type: Drive array
Default: Empty
Use case: Synchronize multiple drive movements

Wait for Sensor
Pauses execution until sensor reaches specified state.
Sensor
Target sensor component to monitor.
Type: Sensor reference
Default: None
Use case: Connect to proximity, vision, or other sensor types
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 Signal Bool
Pauses execution until boolean signal reaches specified state.
Signal
Target signal to monitor.
Type: Signal reference
Default: None
Use case: Connect to PLC or internal boolean signals
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
Sets a boolean signal to true or false.
Signal
Target signal to modify.
Type: Signal reference
Default: None
Use case: Control PLC outputs or internal flags
Set to True
Value to assign to the signal.
Type: Boolean
Default: true
Use case: true sets signal high, false sets signal low

Jump on Signal
Conditionally jumps to a named step based on signal state.
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
Signal to evaluate for jump condition.
Type: Signal reference
Default: None
Use case: Connect to boolean signal for conditional logic
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

Enable
Controls GameObject active state.
GameObject
Target GameObject to enable or disable.
Type: GameObject reference
Default: None
Use case: Show/hide objects or enable/disable components
Enable
Desired active state for the GameObject.
Type: Boolean
Default: true
Use case: true activates GameObject, false deactivates it
Cinemachine Camera
Controls virtual camera activation for scene visualization.
Virtual Camera
Target Cinemachine virtual camera.
Type: CinemachineVirtualCamera reference
Default: None
Use case: Switch camera views during automation sequences
Statistics LogicSteps
Stat Start Cycle
Marks the beginning of a production cycle for statistics.
Stat End Cycle
Marks the end of a production cycle for statistics.
Stat State
Records state information for performance analysis.
Stat Output
Generates statistical output data.
Usage Examples
Basic Sequence Setup
Create an empty GameObject for your sequence
Add LogicStep components in desired execution order
Configure each step's properties in the Inspector
Use Name property for steps referenced by jumps
Run the scene to execute the sequence
Sequential Process Example
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. Drive To (return actuator)
7. Start Drive Speed (continue conveyor)
Parallel Execution
Add Parallel Container component
Add child LogicSteps that should execute simultaneously
Each child step runs independently
Container completes when all children finish
Conditional Logic
Use Jump on Signal for branching logic
Set up signal monitoring for decision points
Create named target steps for jump destinations
Implement error handling with conditional jumps
Editor Tools
Adding LogicSteps
Scene Menu: Right-click when LogicStep component is attached
Component Menu: realvirtual > Add Component > LogicStep
Quick Access: Overlay menu appears with all available steps

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

Custom LogicStep Development
Creating Custom Steps
Create new script in LogicSteps folder
Inherit from
LogicStep
base classImplement required methods:
NonBlocking()
: Return true for non-blocking stepsOnStarted()
: Execute step logic
Call
NextStep()
when step completes
Example Implementation
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
protected void NextStep()
: Advance to next step in sequenceprotected void NextStep(string stepName)
: Jump to named steppublic void StartStep()
: Initialize step executionprotected void Start()
: Begin sequence at runtime
Required Implementations
protected new bool NonBlocking()
: Define step execution typeprotected override void OnStarted()
: Implement step behavior
💡 Hint Always call
NextStep()
when your custom step completes to ensure proper sequence flow.
See Also
Drive - Motor control for LogicStep drive operations
Sensor - Sensor components for wait conditions
Unity Visual Scripting - Alternative visual programming approach
Behavior Graph - Advanced logic definition system
© 2025 realvirtual GmbH 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.
Last updated