Causes the device to vibrate with a custom strength, duration, and frequency, if possible.

vibrated = lovr.headset.vibrate(device, strength, duration, frequency)


deviceDevice'head'The device to vibrate.
strengthnumber1The strength of the vibration (amplitude), between 0 and 1.
durationnumber.5The duration of the vibration, in seconds.
frequencynumber0The frequency of the vibration, in hertz. 0 will use a default frequency.


vibratedbooleanWhether the vibration was successfully triggered by an active headset driver.


When using the openvr headset driver on an HTC Vive, the value for the duration currently must be less than .004 seconds. Call this function several frames in a row for stronger or prolonged vibration patterns.

On the Oculus Quest, devices can only be vibrated once per frame. Any attempts after the first will return false.

See also