:SetMotor() is not working for me in the game, but is working perfectly fine for me in studio. (In other words, I get haptic feedback in studio but it is missing in game.)
The Xbox controller model is 1697.
The Haptic feedback is triggered when the Left Joystick is pressed down calling the following function:
function setMotor(gamepad,strength,sec)
if gamepad then
if sec then
HapticService:SetMotor(gamepad, Enum.VibrationMotor.Small, strength)
coroutine.resume(coroutine.create(function()
HapticService:SetMotor(gamepad, Enum.VibrationMotor.Small, strength)
task.wait(sec)
HapticService:SetMotor(gamepad, Enum.VibrationMotor.Small, 0)
end))
else
HapticService:SetMotor(gamepad, Enum.VibrationMotor.Small, strength)
end
end
end
The code calling the function upon the click of the Left Joystick looks like this.
if HapticService:IsVibrationSupported(input.UserInputType, Enum.VibrationMotor.Small) then
setMotor(input.UserInputType,0.5,0.15)
print("DONE")
else
print("Um its not supported?")
end
I even went ahead and added prints to debug in game (as seen above) and I do see “DONE” in console. As well as just trying to not to use the function and setting the motor to .15 without setting it back to 0 with still no results in game.
Anyone have any ideas what is going on here?