Table of Contents

Visual Scripting support

VIROO Applications are compatible with Unity's Visual Scripting framework. To add VIROO Visual Scripting packages, once you have completed the Add the VIROO Studio package steps, you will need to follow this article.

To add support for VIROO Visual Scripting components, the following packages containing the necessary functionality must be added:

  • com.viroo.studio.visualscripting: This package adds Visual Scripting support to access VIROO functionality. It also contains VIROO Visual Scripting samples.

The next sections explain how to add the packages, configure the Project Settings and how to add relevant prefabs to your VIROO scenes.

Install VIROO Studio Visual Scripting package

It's possible to add the necessary package in Unity in two different ways. Choose the one you prefer from the following.

Using the Unity Editor

Open Window -> Package Manager.

To install the needed packages:

  1. Click the add (+) button in the status bar.
  2. Select Add package by name from the add menu.
  3. Enter com.viroo.studio.visualscripting in the name field.
  4. Enter the exact version (for example: 1.0.0) in the version field.

    The latest com.viroo.studio.visualscripting package version can be found in the Viroo feed.

  5. Click Add.

Editing manifest.json file

Follow the steps below:

  1. Open manifest.json file.
  2. Add the references to the Visual Scripting packages in the dependencies section.
{
  "dependencies": {
    /* ... your other dependencies ... */
    "com.viroo.studio.visualscripting": "1.0.0", /* Change 1.0.0 to the correct version */
    /* ... your other dependencies ... */
  },
},
  1. Return to Unity Editor to download the packages.

Setting Visual Scripting Project Settings

From Viroo Studio 3.1 onwards, Viroo takes care of adding the needed Type Options and Node Libraries in the Visual Scripting settings.

This lets you use Viroo API and Viroo Visual Scripting custom nodes. You can check this settings in Project Settings and you can include more references as needed.

viroo-visual-scripting-project-settings.png

You can reference Viroo API and Viroo's custom Visual Scripting nodes in your Script Machines through the context menu:

  • Context Menu -> Codebase -> Viroo -> API
  • Context Menu -> Events -> Viroo
  • Context Menu -> Viroo

Additionally, you will be able to reference Viroo MonoBehaviour components as Visual Scripting variables.

viroo-visual-scripting-variable.references.png

Note

You may need to add Viroo classes in the Type Options section or Viroo assemblies in the Node Library section depending on your project.

  1. Open Unity's Project Settings' Visual Scripting Section: Edit -> Project Settings -> Visual Scripting.
  2. Add types to Type Options or add assemblies the Node Library section.
  3. Press the Regenerate Nodes button.

Add Visual Scripting prefab to your VIROO scenes

To access VIROO functionality from your Script Machines, the following prefab should be added to yours scene. To find this prefab, you can use the Search function of the Unity Project tab, selecting the In packages option.

  • VirooVisualScripting: this prefab contains the necessary components to act as a bridge between the VIROO core and your Script Machines. It also contains the necessary components to access Network Variables from your Script Machines.

Save the scene.