Visual Scripting

Spatial Creator Toolkit supports Visual Scripting, a visual, node-based Unity tool for creating interactive programs. Visual Scripting is a powerful way to create interactive experiences without writing code.

Tip

Prefer writing code? Check out the C# Scripting documentation.

What is Visual Scripting

Visual Scripting is a built-in Unity tool that allows you to create scripts or programs with a visual, node-based interface. Instead of writing lines of code, you create nodes and make connections to create mechanics and interactivity.

The language of Unity’s Visual Scripting (VS) is structured very closely to C#, and is capable of creating very complex systems and interactivity.

Do I Need to be a Programmer?

Visual Scripting is designed to be extremely friendly to artists and those not experienced with programming.

Fundamentally VS is programming. But! The fact that you have found your self here, reading this paragraph, means you already have all the curiosity required to learn VS and become a programmer.

Creating Your First Graph

Inside your scene, choose the object you want to add interactivity to and add a Script Machine component.

Adding a Script Machine component

On this component, click the New button to create a new Script Graph asset.

Adding a Script Graph asset

Once you create the asset, you can click Edit Graph to open the Graph Editor. Here you can start creating a function by dragging a connection out of the On Update node.

In the video below we create a Transform.Rotate(XYZ) node. This will result in a script that causes whatever object it is placed on to rotate every frame.

Learn How To Program

Creating a graph and adding nodes is just the beginning of what is possible with VS. Unity has lots of great resources that can get you started creating your own scripts and understanding the possibilities.

If this is your first time touching VS we recommend you check out Unity’s introduction course to Visual Scripting.

If you have questions feel free to reach out to the Spatial community, or even the Unity community at large. VS is a standard Unity tool, so all the information you need is usually a Google search away.

Limitations

In order to maintain compatibility with all of our platforms and to create a secure experience, only a pre-defined set of nodes can be used in Spatial.

If you try to use an unsupported node, you will be notified in the issues tab and be blocked from uploading.

Visual Scripting Limiations Machine Component

Supported Nodes

The Creator Toolkit limits the nodes that appear in the add-node menu such that almost all nodes available in that menu are compatible.

Currently we support over 15,000 nodes from the following modules

  • mscorlib
  • UnityEngine.CoreModule
  • UnityEngine.AudioModule
  • UnityEngine.PhysicsModule
  • UnityEngine.AnimationModule
  • UnityEngine.UIModule
  • UnityEngine.UI
  • Unity.TextMeshPro
  • plus all custom-made Spatial nodes.

Unsupported Nodes

We can’t list all 5000+ currently blocked nodes here… but here are some common nodes we have blocked:

  • Any Application node like Application.OpenURL
  • Any GameObject.Find variant
  • Any GameObject.SendMessage variant
  • Any Expose node
  • Any Scene or SceneManagement related nodes

No Plugins or Custom Nodes

All nodes generated by plugins you downloaded from the asset store, or created yourself will be blocked.

SubGraphs that only contain supported nodes should work just fine.

Using an Unsupported Node

If you need functionality of a certain node/module that is not supported, definitely let us know! We might be able to expand our supported modules or write similar functionality as a Spatial-unique node.

The best place to give this kind of feedback directly to the team is the Creator Toolkit section of the Spatial Discord.