LUIDA Docs

SendHaptics

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.

SendHaptics(participantId, target, frequency, amplitude, duration)StableUser Feedback & Utilities
Fires
On State Start · During State · On State Exit

Description

Sends haptic feedback to the player specified by participantId. target should be filled in with "left", "right", or null for both hands. duration is in seconds.

Parameters

NameTypeDescription
participantIdinteger (≥ 1)1-based participant index. Resolved through the PARTICIPANTS array.
targetstring or null"left", "right", or null for both controllers.
frequencynumberVibration frequency in Hz.
amplitudenumberVibration amplitude, 0.01.0.
durationnumberPulse duration in seconds.

Side effects

  • Resolves the target player via PARTICIPANTS[participantId] and dispatches a haptics request through the player handle (the underlying CCK call is what PlayerHandle.send("haptics", {...}) shows in Reference → Variables → PARTICIPANTS).
  • The haptic pulse is rendered locally on that participant's VR controller(s) — other players in the room feel nothing.
  • Silently no-ops if the participant is not present, if PARTICIPANTS[participantId] is undefined, or if the participant is on a non-VR platform (Windows/Mac/Android/iOS).
  • No state keys are written, no signals fired, and $.groupState is untouched.

Example

A short right-hand pulse to confirm a correct response inside a Customized Action on the response state's On State Exit:

// Right hand only, 200 Hz, moderate amplitude, 100 ms
SendHaptics(1, "right", 200, 0.7, 0.1);

For paired studies you can address each participant by index:

SendHaptics(1, null, 150, 0.5, 0.2); // both hands, participant 1
SendHaptics(2, null, 150, 0.5, 0.2); // both hands, participant 2

Source

Assets/Doc/LUIDA-StateListeningItemScriptDoc.md

Original markdown body
- **Description**: Sends haptic feedback to the player specified by `participantId`. `target` should be filled in with "left", "right", or null for both hands. `duration` is in seconds.
- **Parameters**:
  - `participantId`: `integer` (start from 1)
  - `target`: `string`
  - `frequency`: `number`
  - `amplitude`: `number`
  - `duration`: `number`