LUIDA Docs

AddChildRotation

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.

AddChildRotation(childName, x, y, z)StableChild Manipulation
Fires
On State Start · During State · On State Exit

Description

Adds to the local rotation of a specified child object using Euler degrees.

Parameters

NameTypeDescription
childNamestringName of the child GameObject under this item to rotate. Case-sensitive.
xnumberPitch offset around the local X axis, in degrees.
ynumberYaw offset around the local Y axis, in degrees.
znumberRoll offset around the local Z axis, in degrees.

Side effects

  • Reads the child sub-node's current local rotation via $.subNode(childName), composes the supplied Euler offset on top, and writes the resulting rotation back.
  • Does not require MovableItem on the parent.
  • If the named child doesn't exist, 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 calls accumulate. The composition uses quaternion multiplication, so large offsets can produce non-obvious final rotations due to axis interaction — prefer SetChildRotation when you want a known absolute orientation.

Example

Use On State Start / On State Exit symmetry to tilt a feedback indicator forward at the start of the trial and back at the end, leaving the parent item untouched:

// On State Start
AddChildRotation("Indicator", 15, 0, 0);

// On State Exit
AddChildRotation("Indicator", -15, 0, 0);

Because both offsets are equal and opposite, the indicator returns to its rest pose between trials regardless of how many times the state fires.

Source

Assets/Doc/LUIDA-StateListeningItemScriptDoc.md

Original markdown body
- **Description**: Adds to the local rotation of a specified child object using Euler degrees.
- **Parameters**:
  - `childName`: `string`
  - `x`: `number`
  - `y`: `number`
  - `z`: `number`