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
| Name | Type | Description |
|---|---|---|
participantId | integer (≥ 1) | 1-based participant index. Resolved through the PARTICIPANTS array. |
target | string or null | "left", "right", or null for both controllers. |
frequency | number | Vibration frequency in Hz. |
amplitude | number | Vibration amplitude, 0.0–1.0. |
duration | number | Pulse 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 whatPlayerHandle.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]isundefined, or if the participant is on a non-VR platform (Windows/Mac/Android/iOS). - No state keys are written, no signals fired, and
$.groupStateis 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 2Related
SendViaOsc(participantId, address, values)— the other per-client "send a side-channel message to this participant's machine" action.- Reference → Variables →
PARTICIPANTS— the arrayparticipantIdindexes into, with the 1-indexed gotcha. - Concepts → Conditions, sessions, participants — how
participantId(pID) maps to actual players.
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`