Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

InputSystem: Gamepad IDualMotorRumble vibration not working on Apple devices(iOS, OSX, tvOS)

Discussion in 'Scripting' started by ChangMrsWordsmith, Aug 17, 2021.

  1. ChangMrsWordsmith

    ChangMrsWordsmith

    Joined:
    Jul 17, 2021
    Posts:
    1
    Good day!
    So working in this project I have been using the new input system and I must say I've been loving it! the only issue I've found until now is that the vibration of the controllers doesn't work. In windows works as in the Editor of different machines the controllers vibrate and behave as I'd like, but can't seem to work on Apple products. Not even on the editor.

    I'm using the following code to vibrate all devices that are gamepads:
    Code (CSharp):
    1. public void DeviceHapticFeedback_All(float sharpness, float intensity)
    2.     {
    3.         if (GameSettingsController.Instance.GetSetting().IsSettingsOnFor[GameSettingConstOptions.HAPTIC_STATUS])
    4.         {
    5.             for (int i = 0; i < InputSystem.devices.Count; i++)
    6.             {
    7.                 if (InputSystem.devices[i] is Gamepad)
    8.                 {
    9.                     (InputSystem.devices[i] as Gamepad).SetMotorSpeeds(sharpness, intensity);
    10.                     StartCoroutine(stopVibration_All(i, 0.2f));
    11.                 }
    12.             }
    13.         }
    14.     }
    15.  
    16.     private System.Collections.IEnumerator stopVibration_All(int indexController, float timeToWait)
    17.     {
    18.         yield return new WaitForSeconds(timeToWait);
    19.         (InputSystem.devices[indexController] as Gamepad).ResetHaptics();
    20.     }
    Again in windows works like a charm, but in Mac even if the code is executed, nothing happens. Anyone has any clues?
     
  2. rahelgamma

    rahelgamma

    Joined:
    May 11, 2021
    Posts:
    2
    Hey I think I have the same issue, did you figure it out by now? Or is there a workaround?