HapticEffect
An object that provides waveform-based haptic feedback (vibrations and rumbles) on supported controllers and mobile devices.
| Memory category | Instances |
|---|
Member index 10
Removed member index 2
| History | Member | |
|---|---|---|
| 719 | Waveform: FloatCurve | |
| 655 | SetKeys(keys: Array): null |
Description
Modern controllers and devices have motors built‑in to provide haptic feedback. Adding rumbles and vibrations can provide subtle feedback that is hard to convey through visuals or audio.
Roblox supports haptics for the following devices:
- Android and iOS phones supporting haptics including most iPhone, Pixel, and Samsung Galaxy devices
- PlayStation gamepads
- Xbox gamepads
- Quest Touch controller
History 32
- 746 Add GetWaveformKeys
- 731 Add
- 731 Change Default of Type from to UIClick
- 731 Change Default of Radius from to 3
- 731 Change Default of Position from to Vector3(0, 0, 0)
- 731 Change Default of Looped from to false
- 726 Remove
- 726 Change Default of Type from UIClick to
- 726 Change Default of Radius from 3 to
- 726 Change Default of Position from Vector3(0, 0, 0) to
- 726 Change Default of Looped from false to
- 719 Remove Waveform
- 692 Add Ended
- 689 Add
- 689 Change Tags of Waveform from [] to [Deprecated]
- 688 Change Tags of HapticEffect from [NotBrowsable] to []
- 665 Change Tags of HapticEffect from [] to [NotBrowsable]
- 655 Add SetWaveformKeys
- 655 Remove SetKeys
- 655 Change WriteSecurity of Radius from RobloxScriptSecurity to None
- 655 Change ReadSecurity of Radius from RobloxScriptSecurity to None
- 655 Change WriteSecurity of Position from RobloxScriptSecurity to None
- 655 Change ReadSecurity of Position from RobloxScriptSecurity to None
- 648 Add SetKeys
- 638 Add Stop
- 638 Add Play
- 638 Add Waveform
- 638 Add Type
- 638 Add Radius
- 638 Add Position
- 638 Add Looped
- 638 Add HapticEffect
Members 10
Ended
| Parameters (0) | ||
|---|---|---|
| No parameters. | ||
Fires when the HapticEffect has completed playback and stopped.
Note this event will not fire for haptics with
Looped set to true since they continue
playing upon reaching the end. This event will also not fire when the
haptic is stopped before playback has completed.
This event is often used to destroy an HapticEffect when it has completed playback.
| Thread safety | Unsafe |
|---|
GetWaveformKeys
| Parameters (0) | ||
|---|---|---|
| No parameters. | ||
| Returns (1) | ||
| Array | ||
Returns the waveform
SetWaveformKeys() stored on this
effect. Keys are FloatCurveKey objects sorted by time. Each
key's time is in milliseconds and its value ranges from 0 (no haptic) to
1 (full intensity).
This method only works when Type is
HapticEffectType.Custom. Any other type throws
HapticEffect.Type is not Custom. A custom effect with no keys set
returns an empty array.
Each call returns a new array. Editing that array does not change the
effect; pass it back to SetWaveformKeys() to apply a change.
| Thread safety | Unsafe |
|---|
History 1
- 746 Add GetWaveformKeys
Looped
| Type | Default | |
|---|---|---|
| bool | false | |
Whether the haptic effect loops continuously.
| Thread safety | ReadSafe |
|---|---|
| Category | Data |
| Loaded/Saved | true |
Play
| Parameters (0) | ||
|---|---|---|
| No parameters. | ||
| Returns (1) | ||
| null | ||
Plays the haptic effect.
| Thread safety | Unsafe |
|---|
Position
| Type | Default | |
|---|---|---|
| Vector3 | 0, 0, 0 | |
Along with Radius, specifies the impact position relative to the input device and, effectively, how broadly that impact effects nearby motors. Note that some gamepads do not have both "small" and "large" motors, and that "gamepad large left/right" is not supported on PC.

| Thread safety | ReadSafe |
|---|---|
| Category | Data |
| Loaded/Saved | true |
Radius
| Type | Default | |
|---|---|---|
| float | 3 | |
Along with Position, specifies the impact radius relative to the input device and, effectively, how broadly that impact effects nearby motors. Note that some gamepads do not have both "small" and "large" motors, and that "gamepad large left/right" is not supported on PC.

| Thread safety | ReadSafe |
|---|---|
| Category | Data |
| Loaded/Saved | true |
SetWaveformKeys
| Parameters (1) | ||
|---|---|---|
| keys | Array | |
| Returns (1) | ||
| null | ||
This method lets you define a custom waveform as a table and apply it to
the haptic. It takes an array of FloatCurveKey objects, each
constructed with three arguments: time in milliseconds, value
ranging from 0 (no haptic) to 1 (full intensity), and an
KeyInterpolationMode that controls how the curve interpolates.
between keys.
| Thread safety | Unsafe |
|---|
History 1
- 655 Add SetWaveformKeys
Stop
| Parameters (0) | ||
|---|---|---|
| No parameters. | ||
| Returns (1) | ||
| null | ||
Stops the haptic effect.
| Thread safety | Unsafe |
|---|
Type
| Type | Default | |
|---|---|---|
| HapticEffectType | UIClick | |
The haptic type, such as HapticEffectType.GameplayCollision for a large immediate rumble that dies down quickly. The HapticEffectType.Custom value lets you specify a haptic with custom waveform keys defined through SetWaveformKeys() and read back with GetWaveformKeys().
| Thread safety | ReadSafe |
|---|---|
| Category | Data |
| Loaded/Saved | true |
Removed members 2
SetKeys
| Parameters (1) | ||
|---|---|---|
| keys | Array | |
| Returns (1) | ||
| null | ||
| Security | RobloxScriptSecurity |
|---|---|
| Thread safety | Unsafe |
Waveform
| Type | Default | |
|---|---|---|
| FloatCurve | ||
| Security | RobloxScriptSecurity |
|---|---|
| Thread safety | ReadSafe |
| Category | Data |
| Loaded/Saved | true |