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
| Name | Type | Description |
|---|---|---|
x | number | Pitch offset around the world X axis, in degrees. |
y | number | Yaw offset around the world Y axis, in degrees. |
z | number | Roll offset around the world Z axis, in degrees. |
Side effects
- Reads the item's current world rotation from the CCK
MovableItemAPI, composes the supplied Euler offset on top, and writes the resulting rotation back. - 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. - Repeated
AddRotationcalls accumulate. The composition uses quaternion multiplication, so large offsets can produce non-obvious final rotations due to axis interaction — preferSetRotationfor 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.
Related
SetRotation(x, y, z)— absolute world rotation; less prone to drift across calls.AddChildRotation(childName, x, y, z)— relative rotation on a named sub-node in local space.AddPosition(x, y, z)— the position counterpart.- Concepts → State machine lifecycle — common
On State Start/On State Exitsymmetry patterns.
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`