Search Unity

Bug Rumble doesn't work for Xbox controller on macOS

Discussion in 'Input System' started by grappler, Jan 29, 2023.

  1. grappler

    grappler

    Joined:
    Jun 26, 2015
    Posts:
    13
    I found an old question about this (and a closed bug in GitHub), but it appears it still hasn't been fixed. Is there no way to use rumble on macOS?

    To be clear, the controller works in every other way. It's an Xbox One controller connected via Bluetooth to macOS. If I use the "Identify" option for the controller from System Settings, it does rumble--so the O/S is supporting it. The code below triggers, and correctly identifies the type of gamepad, but there's no rumble.

    using UnityEngine.InputSystem.XInput;

    ...

    var gamepad = XInputController.current;
    Debug.Log("type " + gamepad.GetType());
    if (gamepad != null && gamepad is IXboxOneRumble rumble)
    {
    Debug.Log("is IXboxOneRumble!");
    rumble.SetMotorSpeeds(lowFrequency, highFrequency);
    stopRumbleAfterTime = StartCoroutine(StopRumble(duration, gamepad));
    }

    I also tried:

    rumble.SetMotorSpeeds(lowFrequency, highFrequency, 0.25f, 1f);

    Here's the test that successfully triggers the input action:

    if (InputManager.instance.controls.Rumble.RumbleAction.WasPressedThisFrame())
    {
    RumbleManager.instance.RumblePulse(0.50f, 0.50f, 0.50f);
    }

    Previous question: Question - How to I use IXboxOneRumble? - Unity Forum
     
    Last edited: Jan 29, 2023
  2. rahelgamma

    rahelgamma

    Joined:
    May 11, 2021
    Posts:
    2
    Hey I'm also having a weird issue with the rumble function on mac... did you find a solution for this or workaround?
     
  3. ReadPan_

    ReadPan_

    Joined:
    Jan 23, 2015
    Posts:
    4
    Hey I'm also having a weird issue with the rumble function on mac... did you find a solution for this or workaround?
     
  4. mysticcoder

    mysticcoder

    Joined:
    Oct 9, 2014
    Posts:
    9
    Bueller? Bueller?
     
  5. justdizzy

    justdizzy

    Joined:
    Mar 8, 2016
    Posts:
    89
    Here too, but for Dual Shock 4 connected via bluetooth. I also downloaded an Apple WWDC iOS sample from 3 years ago, and it rumbles properly.
     
  6. justdizzy

    justdizzy

    Joined:
    Mar 8, 2016
    Posts:
    89
    FYI, I filed a bug, and just got the response that Unity does not support setMotorSpeeds on Playstation controllers connected via Bluetooth.