SetChildRotation
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.
SetChildRotation(childName, x, y, z)StableChild Manipulation- Fires
- On State Start · During State · On State Exit
Description
Sets the local rotation of a specified child object using Euler degrees.
Parameters
| Name | Type | Description |
|---|---|---|
childName | string | Name of the child GameObject under this item to rotate. Case-sensitive. |
x | number | Pitch around the local X axis, in degrees. |
y | number | Yaw around the local Y axis, in degrees. |
z | number | Roll around the local Z axis, in degrees. |
Side effects
- Calls
$.subNode(childName).setRotation(...)— sets the child's local-space rotation via CCK's sub-node API. - Does not require
MovableItemon the parent. - If the named child doesn't exist or doesn't expose
setRotation, the runtime logs a warning and the call is a no-op. - No state keys are written, no signals fired, and
$.groupStateis untouched. The change is networked to all players. - Order of rotation axes follows Unity's standard
Z-X-YEuler convention.
Example
Reorient a stimulus's Card sub-node to one of three discrete yaws based on a per-trial angle condition, while leaving the parent item's transform untouched (e.g., because the parent is anchored to a fixed mount):
// On State Start, gated by angle === "left"
SetChildRotation("Card", 0, -30, 0);
// On State Start, gated by angle === "center"
SetChildRotation("Card", 0, 0, 0);
// On State Start, gated by angle === "right"
SetChildRotation("Card", 0, 30, 0);Related
AddChildRotation(childName, x, y, z)— relative rotation offset on the same sub-node.SetChildPosition(childName, x, y, z)— the position counterpart.SetRotation(x, y, z)— when you want to rotate the whole item instead of a sub-node (requiresMovableItem).- Reference → Variables →
CONDITION— picking per-trial angles from within-subjects variables.
Source
Assets/Doc/LUIDA-StateListeningItemScriptDoc.md
Original markdown body
- **Description**: Sets the local rotation of a specified child object using Euler degrees.
- **Parameters**:
- `childName`: `string`
- `x`: `number`
- `y`: `number`
- `z`: `number`