function vibrate(duration) {
let gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : [])
[...gamepads].find(x=>x).vibrationActuator.playEffect('dual-rumble', {
startDelay: 0,
duration: duration,
weakMagnitude: 1,
strongMagnitude: 1,
})
}
function vibrate(duration) {
let gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : [])
[...gamepads].find(x=>x).vibrationActuator.playEffect('dual-rumble', {
startDelay: 0,
duration: duration,
weakMagnitude: 1,
strongMagnitude: 1,
})
}