GameObject › LUIDA menu
Insert LUIDA-aware prefabs (Data Collector, Questionnaire) into the active scene with one click.
These pages are not yet fully reviewed. The LUIDA team is continuing to review and improve them. If you find anything wrong on these pages, or have questions that aren't resolved by reading them, please ask or report to the LUIDA team.
The GameObject › LUIDA sub-menu adds LUIDA-aware prefabs to the currently-open scene in a single click. Each entry is essentially "drag this prefab from the package folder into the scene and hook up the right scripts" — automated, so you don't have to remember the prefab paths or the auxiliary wiring.
This menu is the standard way to add LUIDA runtime prefabs to a scene. Using it (versus dragging prefabs by hand) guarantees the auxiliary assets — per-scene data calculator scripts, condition-manager references — get created and wired up correctly.
The menu entries
GameObject › LUIDA › Data Collector
Inserts the LUIDA-DataCollector prefab into the active scene and ensures everything around it is wired up. This is one of two entry points for setting up data collection — the other is the dedicated Configure data collector window, which can also create the same prefab from inside its builder UI.
What it does, step by step:
- Checks that no
LuidaDataCollectoralready exists in the scene (only one allowed). If one does, shows an error and stops. - Instantiates the
LUIDA-DataCollectorprefab fromAssets/ClusterMetaverseLab/LuidaExpTemplate/Runtime/Prefabs/CustomDataCollection/LUIDA-DataCollector.prefab. The instance is renamed toLUIDA-DataCollectorin the scene hierarchy. - Finds or creates a per-scene data-calculator script at
Assets/_Experiment_/Scripts/DataCollectors/<SceneName>.js. The script body is generated by the Configure data collector window from the per-sceneLuidaDataCollectorConfigasset; if no config exists yet, the menu creates an empty one. - Assigns the script to the new
LuidaDataCollectorcomponent'sScript Assetfield, so whenProcessAndSaveCollectedData()fires at runtime, the right calculator runs. - Ensures the scene has access to the
ConditionManager(theLUIDA-ExpManagersprefab usually provides it; if missing, the menu adds it). - Selects the new GameObject in the Hierarchy so you can immediately adjust its position.
Use this menu entry once per scene that needs to log custom data. The complete data-collection pipeline is:
- Push data — write
(label, value)pairs into the scratchpad. Either via theSendDataToCollectoraction ("Push data to collector" in the editor) or by attaching aLuida Data Collection Gimmickto a CCK trigger with its Push data phase enabled. - Save pushed data — snapshot the scratchpad into one queued row. Action:
ProcessAndSaveCollectedData("Save pushed data in collector"), or the gimmick's Save pushed data phase. - Upload saved data — flush the queue to the Web Console via
callExternal. Action:UploadCollectedData("Upload saved data from collector"), or the gimmick's Upload saved data phase.
The merged LuidaDataCollectionGimmick lets you enable any combination of the three phases on one component, so a single trigger can push-and-save in one step (or push-save-upload as a one-shot).
Edit the per-scene calculator visually through LUIDA › Configure data collector. That window owns the calculator schema (Section A: collected labels; Section B: field definitions) and regenerates Assets/_Experiment_/Scripts/DataCollectors/<SceneName>.js whenever you save. Hand-editing the .js file works for one-off tweaks, but the next save from the window will overwrite it. See Configure data collector for the window walkthrough.
GameObject › LUIDA › Questionnaire
Inserts a Questionnaire prefab into the active scene, ready to bind to a Web Console qID.
What it does:
- Opens a small dialog asking for the questionnaire's
qID(the 1-based index from the Web Console's questionnaire list for this experiment). - Instantiates the Questionnaire prefab from the template package and configures its
qIDfield. - The prefab carries a
LuidaQuestionnairecomponent which subscribes to state-machineqIDevents: when a state with the matchingqIDbecomes active, the prefab renders the questionnaire UI in front of the participant; when answered (or skipped), it dispatches answers to the Web Console. - The prefab is parented under the scene root and selected in the Hierarchy.
Insert one Questionnaire prefab per questionnaire you want to display. The Web Console questionnaire builder defines the questions and their qID; the Unity prefab is just the in-world renderer.
For more on qID binding, see Concepts → Questionnaires.
Screenshot pending — the
GameObject › LUIDA › Questionnairemenu, plus the qID input dialog set to2, plus the resulting Questionnaire prefab in the Hierarchy.
What lives where
The prefabs the menu inserts come from:
Assets/ClusterMetaverseLab/LuidaExpTemplate/Runtime/Prefabs/
├── LUIDA-ExpManagers.prefab ← session manager (already in template scenes)
├── CustomDataCollection/LUIDA-DataCollector.prefab ← inserted by Data Collector menu
├── ConditionManagement/ConditionManager.prefab ← auto-added by Data Collector menu if missing
└── Questionnaire/Questionnaire.prefab ← inserted by Questionnaire menuThe per-scene assets the menus generate end up under Assets/_Experiment_/:
Assets/_Experiment_/Scripts/DataCollectors/<SceneName>.js ← created by Data Collector menuYou can edit the calculator script freely; the prefab in the scene retains its reference to it.
Why use the menu instead of dragging prefabs
You can drag the prefabs from the Project panel into a scene manually, but you'll have to:
- Manually create the per-scene calculator script.
- Manually assign it to the
LuidaDataCollector'sScript Assetfield. - Manually verify
ConditionManageris present in the scene hierarchy. - (For Questionnaires) manually set the
qIDon the prefab instance.
The menu does all of that in one click and prevents the most common omission — forgetting to wire the calculator script — which would result in ProcessAndSaveCollectedData() having nothing to process at runtime.
Common pitfalls
- Trying to add a second Data Collector to the same scene. The menu refuses, by design. One Data Collector serves all custom-data logging in the scene; the calculator script is where you branch by condition or event type.
qIDnot matching the Web Console list. Off-by-one is the most common mistake — the Web Console is 1-indexed, so the first questionnaire you registered isqID = 1. Verify by opening the experiment detail page and counting from the top.- Editing the calculator template directly.
CustomDataCalculatorTemplate.jsis in the package folder; if you edit it, your changes get overwritten when you upgrade LUIDA. Always edit the per-scene copy atAssets/_Experiment_/Scripts/DataCollectors/<SceneName>.js.
Where to go next
- Configure data collector — the visual builder for the per-scene calculator script and label registry.
- Concepts → Data collection — the push → save → upload lifecycle.
- Concepts → Questionnaires — the qID binding model and built-in templates.
- Reference → Variables →
COLLECTED_DATA— how to read accumulated values inside the calculator script. - Tutorial 1 — Priming + Proteus Effect (without LUIDA automation) — first walkthrough that inserts a Data Collector + Questionnaire prefab.