LUIDA Docs

SetPosition

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.

SetPosition(x, y, z)StableItem Manipulation
Fires
On State Start · During State · On State Exit

Description

Sets the item's world position. Requires the MovableItem component on this item.

Parameters

NameTypeDescription
xnumberWorld-space X coordinate, in meters.
ynumberWorld-space Y coordinate, in meters.
znumberWorld-space Z coordinate, in meters.

Side effects

  • Calls the CCK MovableItem API to set this item's world transform position. The new pose is networked: every player in the room sees the item teleport (not glide) to the new coordinates.
  • Requires the item to have a MovableItem component. Without it, the runtime logs a warning and the call is a no-op.
  • No state keys are written, no signals fired, and $.groupState is untouched. The position change is purely visual.
  • Use sparingly inside During State listeners — teleporting every tick produces visible jitter on remote clients. Most studies set position once on On State Start and leave the item alone until the next state.

Example

In Tutorial 3 (Stroop), Text_RedFont × Trial - Start uses SetPosition to place the stimulus near or far from the participant based on the within-subjects depth variable:

// On State Start, gated by depth === "near"
SetPosition(0, 1.5, 1);

// On State Start, gated by depth === "far"
SetPosition(0, 1.5, 3);

The Text_RedFont item carries a MovableItem component plus a kinematic RigidBody (gravity off), which is the standard "stationary stimulus that we move programmatically" combo.

Source

Assets/Doc/LUIDA-StateListeningItemScriptDoc.md

Original markdown body
- **Description**: Sets the item's world position. **Requires the `MovableItem` component on this item.**
- **Parameters**:
  - `x`: `number`
  - `y`: `number`
  - `z`: `number`