Skip to main content
Version: 2026.6

Interpreted scripts

From 2026.6 an environment can carry its own C# scripts. You write ordinary MonoBehaviour classes in your Unity project, put them on objects in your scenes, and the platform runs them when the world opens, on every platform.

They are called interpreted because the Virtuademy app does not contain your code when it is built: your scripts are compiled into a separate assembly, published with the environment, and executed by an interpreter (HybridCLR) built into the app.

An interpreted script in a project: FadeTeleportDoor.cs in Assets/VirtuademyEnvironmentScripts, and its component on the Door object of the scene

Interpreted scripts or Visual Scripting?​

Both are supported, and an environment can use both.

Visual ScriptingInterpreted scripts
LanguageGraphs (nodes)C#
Reach into the platformThe Virtuademy nodesThe scripting API
Extra setupVirtuademy ▸ Update VS LibraryThe interpreter, from the setup window (Setup)
Checks before publishingNoneA security check when the scripts change

The scripting API gives a script the same reach as the Visual Scripting nodes: nothing a script can do through it is out of reach of a graph. Choose C# when the logic is easier to write and maintain as code.

How it works​

  1. Setup, once per project. The SDK setup window installs the interpreter and creates the Assets/VirtuademyEnvironmentScripts folder with its assembly definition. See Setup.
  2. You write scripts in Assets/VirtuademyEnvironmentScripts and attach them to objects in your scenes, as with any Unity script. See Writing scripts.
  3. Build. When you build from the Addressables management window, the SDK compiles your scripts for the four target platforms and checks them against the platform's security rules, first in the Editor and then on the platform. Code that breaks a rule blocks the build. Next to the scene archives, the build writes one more archive with your compiled scripts, EnvironmentsDll_<project>_<fingerprint>.zip.
  4. Deploy. When you deploy to a world, the scripts are uploaded first, checked again by the platform, and linked to every scene you published. See Build and publish.
  5. Run. When a user opens the world, the app downloads the scripts for its platform, checks their integrity and loads them before the scene, so your components are ready when the scene starts.

Your scripts always compile into an assembly called VirtuademyEnvironmentScripts. What changes with your code is the name under which the platform stores them, EnvironmentsDll_<project>_<fingerprint>: the same code, built with the same Unity version and packages, always gets the same name, and a change gets a new one. So a world keeps the version of the scripts it was deployed with until you deploy to it again, and two worlds can run two versions of the same project.

Limitations​

  • An interpreted script can use only what the security rules allow: no files, no network, no threads or async/await, no reflection. Use coroutines and the scripting API instead.
  • All your scripts live in one assembly, in Assets/VirtuademyEnvironmentScripts.
  • Scripts run in the environments of a world. Environments deployed at tenant level run without them: see Known issues.
  • On the Android and iOS apps, an environment with scripts loads only on a platform at version 2026.6.1 or later: see What differs by platform.