API:Class/HapticService

Client only:This object is client-side only! You should use a LocalScript instead of a Script when using it.
Filtered-inheritance mode: While this class technically inherits all Instance class members, some (if not all) have been hidden because they serve no purpose for this object.
Service: This class is a service. It is a top-level singleton which can be obtained with the GetService method.
Uncreatable: This object cannot be created with Instance.new.

UserInputService.pngHapticService : Object Icon.pngInstance

The Xbox One controller and some other USB gamepad controllers have motors built in to provide haptic feedback. Adding rumbles and vibrations can greatly enhance a game’s experience and provide subtle feedback that is hard to convey through visuals or audio.

Functions

Functions [toggle]

Variant<double, void>GetMotor ( UserInputType inputType, VibrationMotor vibrationMotor )

Returns the current vibration value set to the specified UserInputType and VibrationMotor. This will not return anything if SetMotor has not been called prior.

|RMD member="API:Class/HapticService/GetMotor"|Returns the current vibration value set to the specified UserInputType and VibrationMotor.

This will not return anything if SetMotor has not been called prior.|/RMD|

boolIsMotorSupported ( UserInputType inputType, VibrationMotor vibrationMotor )

Returns true if the specified motor is available to be used with the specified UserInputType.

|RMD member="API:Class/HapticService/IsMotorSupported"|Returns true if the specified motor is available to be used with the specified UserInputType.|/RMD|
boolIsVibrationSupported ( UserInputType inputType )

Returns true if the specified UserInputType supports haptic feedback.

|RMD member="API:Class/HapticService/IsVibrationSupported"|Returns true if the specified UserInputType supports haptic feedback.|/RMD|
voidSetMotor ( UserInputType inputType, VibrationMotor vibrationMotor, Tuple<double> vibrationValues )

Sets the vibration intensity of the specified UserInputType and VibrationMotor.

|RMD member="API:Class/HapticService/SetMotor"|Sets the vibration intensity of the specified UserInputType and VibrationMotor.|/RMD|
GetMotor ( UserInputType inputType, VibrationMotor vibrationMotor )
Returns the current vibration value set to the specified UserInputType and VibrationMotor. This will not return anything if SetMotor has not been called prior.
IsMotorSupported ( UserInputType inputType, VibrationMotor vibrationMotor )
Returns true if the specified motor is available to be used with the specified UserInputType.
Returns true if the specified UserInputType supports haptic feedback.
SetMotor ( UserInputType inputType, VibrationMotor vibrationMotor, Tuple<double> vibrationValues )
Sets the vibration intensity of the specified UserInputType and VibrationMotor.


|RMD member="API:Class/HapticService"|The Xbox One controller and some other USB gamepad controllers have motors built in to provide haptic feedback. Adding rumbles and vibrations can greatly enhance a game’s experience and provide subtle feedback that is hard to convey through visuals or audio. |/RMD|



Tutorials Used In