Skip to content

Class · inherits Instance

HapticEffect

Official docs ↗

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 with Radius, 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 with Position, 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: HapticEffectTypeHapticEffectType describing the haptic type.

    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().

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 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.

  • Stop() → ()Stops the haptic effect.

Events 1

  • EndedHapticEffect.Ended:Connect(function())Fires when the HapticEffect has completed playback and stopped.

    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.

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.