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
| Name | Type | Description |
|---|---|---|
x | number | World-space X coordinate, in meters. |
y | number | World-space Y coordinate, in meters. |
z | number | World-space Z coordinate, in meters. |
Side effects
- Calls the CCK
MovableItemAPI 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
MovableItemcomponent. Without it, the runtime logs a warning and the call is a no-op. - No state keys are written, no signals fired, and
$.groupStateis untouched. The position change is purely visual. - Use sparingly inside
During Statelisteners — teleporting every tick produces visible jitter on remote clients. Most studies set position once onOn State Startand 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.
Related
AddPosition(x, y, z)— relative offset instead of absolute world position; uses the sameMovableItemrequirement.SetChildPosition(childName, x, y, z)— when you want to move a named sub-node of the item instead of the whole item (doesn't needMovableItem).- Concepts → Within vs. between subjects — the depth-based stimulus placement above is a textbook within-subjects manipulation.
- Tutorial 2 → Build the stimulus items — full walkthrough including the
MovableItemsetup.
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`