SetRotation
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.
SetRotation(x, y, z)StableItem Manipulation- Fires
- On State Start · During State · On State Exit
Description
Sets the item's world rotation using Euler degrees. Requires the MovableItem component on this item.
Parameters
| Name | Type | Description |
|---|---|---|
x | number | Pitch around the world X axis, in degrees. |
y | number | Yaw around the world Y axis, in degrees. |
z | number | Roll around the world Z axis, in degrees. |
Side effects
- Calls the CCK
MovableItemAPI to set this item's world transform rotation, converting Euler degrees to the underlying quaternion. - 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. - Order of rotation axes follows Unity's standard
Z-X-Yconvention. If you care about exact orientation, set rotation once with a known triple rather than chaining multipleSetRotationcalls.
Example
Rotate a stimulus card to face the participant differently per condition. In a hypothetical orientation study, a within-subjects angle variable picks one of three yaws:
// On State Start, gated by angle === "left"
SetRotation(0, -30, 0);
// On State Start, gated by angle === "center"
SetRotation(0, 0, 0);
// On State Start, gated by angle === "right"
SetRotation(0, 30, 0);Same pattern as SetPosition: one SetRotation per condition branch, gated in the editor's if column.
Related
AddRotation(x, y, z)— relative rotation offset instead of absolute world rotation.SetChildRotation(childName, x, y, z)— rotates a named sub-node in local space; doesn't needMovableItem.SetPosition(x, y, z)— the position counterpart with the sameMovableItemrequirement.- Concepts → Within vs. between subjects — manipulating stimulus orientation per trial is a classic within-subjects pattern.
Source
Assets/Doc/LUIDA-StateListeningItemScriptDoc.md
Original markdown body
- **Description**: Sets the item's world rotation using Euler degrees. **Requires the `MovableItem` component on this item.**
- **Parameters**:
- `x`: `number`
- `y`: `number`
- `z`: `number`