LUIDA Docs

AddPosition

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.

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

Description

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

Parameters

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

Side effects

  • Reads the item's current world position from the CCK MovableItem API, adds the supplied offset, and writes the new position back. The networked transform is updated for every player in the room.
  • 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.
  • Repeated AddPosition calls accumulate. If you want to "nudge then return" semantics, pair an On State Start AddPosition with an equal-and-opposite On State Exit AddPosition.

Example

A simple cue-bobbing pattern: nudge a stimulus upward on state entry, then back down on exit, to draw attention without moving it to a fixed spot:

// On State Start
AddPosition(0, 0.1, 0);

// On State Exit
AddPosition(0, -0.1, 0);

For a step-change setup, prefer SetPosition so the new pose doesn't depend on whatever the previous pose happened to be.

Source

Assets/Doc/LUIDA-StateListeningItemScriptDoc.md

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