Class · inherits Instance
HapticEffect
An object that provides waveform-based haptic feedback (vibrations and rumbles) on supported controllers and mobile devices.
About HapticEffect
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
Properties 4
Looped
: booleanWhether the haptic effect loops continuously.Position
: Vector3Along withRadius, specifies the impact position relative to the input device and, effectively, how broadly that impact effects nearby motors.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.Radius
: floatAlong withPosition, specifies the impact radius relative to the input device and, effectively, how broadly that impact effects nearby motors.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.Type
: HapticEffectTypeHapticEffectTypedescribing the haptic type.The haptic type, such as
HapticEffectType.GameplayCollisionfor a large immediate rumble that dies down quickly. TheHapticEffectType.Customvalue lets you specify a haptic with custom waveform keys defined throughSetWaveformKeys().
Methods 3
Play
() → ()Plays the haptic effect.SetWaveformKeys
(keys: Array) → ()Defines a custom waveform as a table and applies it to the haptic.This method takes in an array of [`FloatCurveKey`](/docs/datatype/FloatCurveKey) objects.This method lets you define a custom waveform as a table and apply it to the haptic. It takes an array of
FloatCurveKeyobjects, each constructed with three arguments: time in milliseconds, value ranging from0(no haptic) to1(full intensity), and anKeyInterpolationModethat controls how the curve interpolates. between keys.Stop
() → ()Stops the haptic effect.
Events 1
Ended
HapticEffect.Ended:Connect(function())Fires when theHapticEffecthas completed playback and stopped.Fires when the
HapticEffecthas completed playback and stopped. Note this event will not fire for haptics withLoopedset totruesince 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
HapticEffectwhen it has completed playback.
HapticEffect also has every member of Instance. Deprecated and Roblox-only members are hidden.
Reference text from the Roblox Creator Documentation, licensed CC BY 4.0, reorganized by rbxtoolshub.com · Studio 0.743.0.7431133.