The SDK of this version is still being tested, and these pages are being updated with it: names, menus and procedures may still change before the release. If you build content for a platform already in production, follow the documentation of that version — pick it from the version menu at the top right.
Interactable
Prefab and Components
Interactable
The Prefab is a primitive cube with interaction components.
You can drag it into your scene, remove its Mesh Renderer and add your 3D model as a child.
We suggest to keep the Box Collider component and resize it in the component itself (not Transform scale) in order to fit to your needs and keep the standard behaviour.
If you want to remove it and refer to your the Collider on your child asset, remember to reference it in the Interactable Placeholder > Interaction Colliders list.
The prefab carries five components: the Interactable Placeholder, the Contextual Menu Placeholder (set to Delete), the Manipulable Placeholder (translation, rotation and scale all on), the Visual Scripting Interactable Placeholder (all states on) and a Scene Object Id. They are described below.
A button, a valve or a door is clicked, not moved. Remove the Contextual Menu Placeholder and the Manipulable Placeholder from such an object. The Manipulable one also changes how the click works: on desktop a pointer that moves more than 10 pixels while pressing on a draggable object is a drag, not a click, and on mobile a finger that moves more than 20 pixels is (see How a click works).
"Interactable Placeholder" component
This component is the one that makes the GameObject interactable and provides some interaction behaviours. This script is required by the other interaction behaviours to work properly.

Select the Is Networked toggle if you want the behaviours of this interactable to be networked among all users. Unless you need to have a specific need of initializing the interactable with visual scripting, please keep the Automatic Setup flag toggled.
| Field | What it does |
|---|---|
| Interact With Colliders | On by default: users interact through the colliders. If Interaction Colliders is empty, a box collider is built around the object's child meshes. Off: the object has no colliders for mouse, touch, hand or ray, and is reached only from graphs and scripts |
| Interaction Colliders | The colliders users click, touch or point at |
| Lock Hover During Interaction | While the object is selected, it keeps its hover state until the selection ends and the user is no longer over it |
| VR Controllers | VR only, see VR controllers |
For other interaction settings, refer to the tooltips of the scripts itself.
"Contextual Menu Placeholder" component
Script that enables the features of the contextual menu on it. The supported options are:
- Lock Transform
- Delete
- Color Picker
- Explodable
- Non Proportional Scale
- Edit

This script requires another script (the InteractablePlaceholder) to be attached to the same GameObject.
If not already on the object, it will be added automatically.
"Manipulable Placeholder" component
Needed to perform actions such as translation, rotation and scale on the object.

In WebGL the object shows rotation and scale gizmos while it is manipulated. Tick Gizmos Disabled to hide them.
For more information, refer to the tooltips provided in the script itself.
"Visual Scripting Interactable Placeholder" component
This script enables the execution of a visual scripting graph upon user interaction. It is also what makes Select and Interact reach a C# script: see Running your own code on a click.

Three states of interaction are defined:
- Hovered: when a user hovers the object with mouse/VR ray interactors.
- Selected: it means the object has been triggered and maintains a selection (like a toggle).
- Interacting: it means the object has been triggered but does not maintain a selection (like a button). The Interacting flag in the allowed states changes nothing (see Known limits).
The Desktop Allowed States and VR Allowed States fields choose which of them an object has. The desktop field also applies on mobile. What each flag does:
- Selected on: the first click selects the object, and a click on the selected object interacts. A click on another object or on empty space deselects it. Selected off: every click interacts, and the object is never selected.
- Hovered on: the On Hover Enter and On Hover Exit nodes of the graph run. It has no effect on the C# hover events, which are raised for every Interactable.
- Interacting has no check of its own: a click that reaches the object always interacts.
So "selection" and "interaction" are not mutually exclusive: with both, selection is required before performing interaction, i.e. the first action puts the object in Selected state, the second in Interacting state. The prefab has every flag on, so by default the first click selects and the second interacts: untick Selected for an object that must react to every click, like a button.
For more information, refer to the tooltips provided in the script.
How a click works
The platform decides what a click is, the same way on every Interactable. All the rules below apply before any graph or script hears about it.
| Desktop and WebGL on a computer | Mobile | VR | |
|---|---|---|---|
| Hover | The pointer is over one of the object's colliders (the nearest one along the ray). | The object is hovered while the finger that pressed it is over it. Without a press there is no hover. | Once per controller: each ray and each hand hovers on its own. A hand hovers when a finger or the palm touches the object's collider, not when it is merely near. |
| Click | Press and release both on the object, whatever the time between them. A press that starts on the object and ends elsewhere does nothing, and neither does a press that starts elsewhere. | Release over the object that the finger pressed, whatever the time between them. Lifting the finger elsewhere does nothing. | The trigger press, for the controller whose ray or hand is over the object. |
| Drag | On an object the left button can drag (a Manipulable with translation), moving the pointer more than 10 pixels makes it a manipulation, not a click. | On an object a finger can drag, moving more than 20 pixels makes it a manipulation. A second finger also cancels the click. | — |
| Camera | — | While a finger holds an object, that finger does not rotate the camera. | — |
| Empty space | A quick click that starts and ends on no Interactable deselects the current selection. | A quick tap that starts and ends on a collider that is not interactable does the same. | A trigger press with the ray on no Interactable does the same. |
The platform also keeps the click from the world when the pointer is over its own interface: a click on the platform's panels does not reach an Interactable behind them. This covers the application's UI Toolkit panels and uGUI canvases on the UI layer (layer 5). A canvas of your own outside that layer is not seen: see Writing scripts.
A blocked object
The application blocks an object while another user manipulates, edits or has locked it, or while a script or node blocks it. InteractablePlaceholder.IsBlocked is true then, and OnBlockedChanged is raised when it changes from free to blocked or back. Only one reason also stops hover and clicks on every platform: BlockedByTaskCompletion, which an Interaction Cue with Block Interaction When Completed sets once the object's task is done. The other reasons leave hover and click to each behaviour (manipulation, contextual menu).
Running your own code on a click
The Interactable Placeholder raises five C# events, so a script can follow an object without a graph:
| Event | Raised when |
|---|---|
OnHoverEnter | A controller starts hovering the object: the mouse pointer, a VR ray or hand, or on mobile the finger that pressed it. Once per controller |
OnHoverExit | That controller stops hovering it |
OnSelectEnter | The object is selected |
OnSelectExit | The object stops being selected: the user selected something else or clicked on empty space, a script or node unselected it, or it was destroyed |
OnInteract | The user interacts with the object |
Each event carries an InteractionEventArgs: ControllerType (Mouse, Ray, Hand, Touch, or None when no input of that frame caused it: a script, a node, the application, or a selection that had to wait for a previous one) and Hand (Left or Right in VR, None elsewhere).
using UnityEngine;
using Virtuademy.Environments.ScriptingApi.Interaction;
using Virtuademy.Environments.ScriptingApi.Placeholders;
public class ClickCounter : MonoBehaviour
{
[SerializeField] private InteractablePlaceholder interactable;
private int clicks;
private void OnEnable()
{
interactable.OnInteract += OnInteract;
}
private void OnDisable()
{
interactable.OnInteract -= OnInteract;
}
private void OnInteract(InteractionEventArgs args)
{
clicks++;
Debug.Log("Clicks: " + clicks + ", with " + args.ControllerType);
}
}
What to know:
- The events are local. They are raised on the client of the user who acted, not for the other users of a multiplayer session. To tell the others, use a networked object or a networked graph.
- Hover works on every Interactable. Select and Interact need a Visual Scripting Interactable Placeholder on the same object (its script machine can be empty). The
Interactableprefab has one. They follow the rules of its Allowed States: with Selected on, the first click isOnSelectEnterand a click on the selected object isOnInteract; with it off, every click isOnInteract. - Every handler runs. If one throws, the others still run, and the exception is then thrown to the application, which logs it: one exception as it is, several as an
AggregateException. Catch what you can expect in your handler. - Subscribe with a method of your own, as above. A script cannot declare its own delegate type (see Security rules), and does not need to: the events use
System.Action. IVirtuademyGameplay.Current.Interaction.SelectedChangedis not an event per click: it reports a change of selection, so it does not fire when the user clicks the object that is already selected, nor when Selected is off.
The graph path stays available: the On Hover Enter, On Hover Exit, On Select Enter, On Select Exit and On Interact nodes of the Visual Scripting Interactable run the graph on the same occasions. To call a method of a script from a graph, connect On Interact to a GameObject Send Message node: SendMessage is refused in a script, not in a graph.
The platform skips the clicks made over UI objects on the UI layer (layer 5) and over its own UI Toolkit panels. A click on a screen-space canvas of your own that is on another layer can also raise On Interact on the object you last pointed at: put your canvas and all its children on the UI layer, and, in a script, check EventSystem.current.IsPointerOverGameObject(). The details are in Writing scripts.
VR controllers
In VR, an Interactable answers to both the controller rays and the hands. The VR Controllers field of the Interactable Placeholder (VRControllers in C#, flags Ray and Hands, both by default) restricts that:
- A controller left out ignores the object entirely: no ray highlight, no hover, no events, no interaction. A trigger press on it with that controller counts as a press on empty space.
- Hands only: the ray goes through the object's interactions like a wall, and the object reacts to a hand touching it.
- Grabbing an object that has a Manipulable Placeholder is set on that component, not here.
- The value is read once, when the object is set up.
Before 2026.7 the Visual Scripting Interactable Placeholder had a field for this, which restricted only its graph nodes. It is obsolete now, and hidden. When you open a scene or prefab in the editor, a Ray only or Hands only value saved in it moves to VR Controllers by itself, and both components are marked as changed: save the scene. A scene that held both, or the default, moves nothing.
Doors, valves and switches
An object that opens, turns or switches is an Interactable plus a small script of yours: there is no component for it. A recipe that works on every platform:
- Put the Interactable prefab on the moving part (or on a collider that stands for it), and remove the Contextual Menu and Manipulable placeholders.
- Untick Selected in the Desktop Allowed States and the VR Allowed States of the Visual Scripting Interactable Placeholder: every click then interacts.
- In your script, subscribe to
OnInteract, flip a state, and move the part. Keep the state in the script, and expose events for the rest of your scene.
using System.Collections;
using UnityEngine;
using UnityEngine.Events;
using Virtuademy.Environments.ScriptingApi.Interaction;
using Virtuademy.Environments.ScriptingApi.Placeholders;
public class Door : MonoBehaviour
{
[SerializeField] private InteractablePlaceholder interactable;
[SerializeField] private Transform hinge;
[SerializeField] private float openAngle = 90f;
[SerializeField] private float seconds = 0.8f;
[SerializeField] private bool locked;
[SerializeField] private UnityEvent onOpened;
[SerializeField] private UnityEvent onClosed;
private bool open;
private bool moving;
public bool IsOpen => open;
// Call it from a graph, a task or another script.
public void SetLocked(bool value)
{
locked = value;
}
private void OnEnable()
{
interactable.OnInteract += OnInteract;
}
private void OnDisable()
{
interactable.OnInteract -= OnInteract;
}
private void OnInteract(InteractionEventArgs args)
{
if (locked || moving)
{
return;
}
StartCoroutine(Move(!open));
}
private IEnumerator Move(bool opening)
{
moving = true;
Quaternion from = hinge.localRotation;
Quaternion to = Quaternion.Euler(0f, opening ? openAngle : 0f, 0f);
for (float t = 0f; t < seconds; t += Time.deltaTime)
{
hinge.localRotation = Quaternion.Slerp(from, to, t / seconds);
yield return null;
}
hinge.localRotation = to;
open = opening;
moving = false;
(opening ? onOpened : onClosed).Invoke();
}
}
The door above opens for the user who clicked it only: the events are local, and a script's own state is not networked. For an object every user must see change, tick Is Networked on the Interactable and synchronise the state with the nodes described in Object Synchronization.
A door does not stop the teleport: the teleport lands on any Floor it can reach, and two floor colliders that touch at the doorway let the arc land on the other side. Split the floor per room and switch each floor on or off with the door. See Platform traps.
Colliders and the click
A click goes to the nearest collider along the ray, whichever object it belongs to. The colliders of another Interactable count too: a large Interactable takes the click meant for everything behind it, even where its mesh does not cover it.
- Fit the colliders to the visible shape. A box padded beyond the mesh takes the clicks meant for the objects behind it. Resize the Box Collider to the shape you can see, as in the note above.
- Use chains of small boxes for long, thin objects. One box around a cable, a pipe or a rail is either too thin to hit or so large that it hides its neighbours. Put several small boxes along the object and reference them in the Interaction Colliders list of the Interactable Placeholder.
- In VR the ray starts at the controller, which is lower and closer to the scene than the head. A collider that does not block the view from the head can still block the ray, so test the clicks with a controller, from the places a user can reach.
- A proxy that only shows a highlight needs no collider. A copy of a mesh used for a rim or an outline, or a hover-only cube, with a collider takes the clicks before the object does.
On WebGL the platform's bottom bar takes the clicks in about the lowest fifth of the screen, across its whole width and not only where its buttons are. An Interactable drawn there never receives the click. Keep click targets out of that band: see Screen areas the application uses.
Single Platform usage
InteractableVR and InteractableWeb are two variants of this prefab that are specialized to be used in a single platform.
Please refer to the Environments section in the Back Office documentation to see how to set up an Environment for a single or multiple platform usage.
Known limits
- The Interacting flag does nothing. The Interacting flag of Desktop Allowed States and VR Allowed States is read and never used: a click that reaches the object always interacts, with the flag on or off. Only Selected and Hovered change what the object does.
IsBlockedis true for more reasons than the ones that stop the click. The comment onIsBlockedin the code says that a blocked object cannot be hovered, selected or interacted with. That holds for one reason only,BlockedByTaskCompletion(see A blocked object). While another user manipulates or edits the object, or it is locked,IsBlockedis true andOnBlockedChangedis raised, but hover and click still reach the object: each behaviour (manipulation, contextual menu) decides for itself. Do not rely onIsBlockedalone to keep a click from your handler.