Skip to main content
Version: 2026.6

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.

Note

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.

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

interactable

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.

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

contextualMenuManageable

Note

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.

The Manipulable Placeholder component, with Gizmos Disabled under WebGL Only

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.

visualScriptingInteractable

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

Note that "selection" and "interaction" are not mutually exclusive: an object can support both states. In that case, selection is required before performing interaction, i.e. the first action puts the object in Selected state, the second in Interacting state.

For more information, refer to the tooltips provided in the script.

Running your own code on every click​

The Interacting state reaches a Visual Scripting graph on every click. A C# script cannot subscribe to it: the only interaction event of the scripting API, SelectedChanged, reports a change of selection, so it fires on the first click and the second click on the same object deselects it. To call a method of your script on every click, connect the On Interact event to a GameObject Send Message node: the steps and an example are in Writing scripts.

Clicks on your own UI

A click on a screen-space canvas of your own can also raise On Interact on the object you last pointed at. The platform skips only the clicks on UI objects on the UI layer (layer 5): put your canvas and all its children on that layer, and, in a script, check EventSystem.current.IsPointerOverGameObject(). This was seen in the WebGL player with a mouse; the details are in Writing scripts.

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.
WebGL: the lowest fifth of the screen

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.