##### Views

- Page
- Discussion
- View source
- History

# Joystick:setVibration

Available since LÖVE 0.9.0
This function is not supported in earlier versions.

Sets the vibration motor speeds on a Joystick with rumble support. Most common gamepads have this functionality, although not all drivers give proper support. Use Joystick:isVibrationSupported to check.

## Function

### Synopsis

success = Joystick:setVibration( left, right )

### Arguments

`number left`
  Strength of the left vibration motor on the Joystick. Must be in the range of [0, 1].
`number right`
  Strength of the right vibration motor on the Joystick. Must be in the range of [0, 1].

### Returns

`boolean success`
  True if the vibration was successfully applied, false if not.

## Notes

If the Joystick only has a single vibration motor, it will still work but it will use the largest value of the left and right parameters.

The Xbox 360 controller on Mac OS X only has support for vibration if a modified version of the Tattiebogle driver is used.

The very first call to this function may take more time than expected because SDL's Haptic / Force Feedback subsystem needs to be initialized.

## See Also

- Joystick
- Joystick:getVibration
- Joystick:isVibrationSupported

## Other Languages

Dansk – Deutsch – English – Español – Français – Indonesia – Italiano – Lietuviškai – Magyar – Nederlands – Polski – Português – Română – Slovenský – Suomi – Svenska – Türkçe – Česky – Ελληνικά – Български – Русский – Српски – Українська – עברית – ไทย – 日本語 – 正體中文 – 简体中文 – Tiếng Việt – 한국어
More info

Retrieved from "https://www.love2d.org/wiki/Joystick:setVibration"
Categories: Templates | Functions

##### Personal tools

- Log in

##### Search

##### Toolbox

- What links here
- Related changes
- Special pages
- Printable version
- Permanent link
- Browse properties