LUIDA Docs

AddRotation

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.

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

Description

Adds to the item's world rotation using Euler degrees. Requires the MovableItem component on this item.

Parameters

NameTypeDescription
xnumberPitch offset around the world X axis, in degrees.
ynumberYaw offset around the world Y axis, in degrees.
znumberRoll offset around the world Z axis, in degrees.

Side effects

  • Reads the item's current world rotation from the CCK MovableItem API, composes the supplied Euler offset on top, and writes the resulting rotation back.
  • 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 AddRotation calls accumulate. The composition uses quaternion multiplication, so large offsets can produce non-obvious final rotations due to axis interaction — prefer SetRotation for absolute placement.

Example

A small "tilt to acknowledge" animation that nods a feedback item when the participant submits a correct answer:

// On State Start
AddRotation(15, 0, 0);

// On State Exit
AddRotation(-15, 0, 0);

Paired with Sleep and ToNextState in the same state, this can serve as a 1-second visual confirmation between trials.

Source

Assets/Doc/LUIDA-StateListeningItemScriptDoc.md

Original markdown body
- **Description**: Adds to the item's world rotation using Euler degrees. **Requires the `MovableItem` component on this item.**
- **Parameters**:
  - `x`: `number`
  - `y`: `number`
  - `z`: `number`