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
  • Prerequisites and Installation
  • Editing a Behavior Graph
Edit on GitHub
  1. Components & Scripts
  2. Defining Logic

Behavior Graph

Using Unity6 Behavior Graph for Visual Scripting

PreviousUnity ScriptingNextLogicsteps

Last updated 5 months ago

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

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.

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

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

  • 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).

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.

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

LogoAbout Unity Behavior | Behavior | 1.0.6
Behavior Graph in the Behavior Demo Scene