UnityRef is currently in early development. Some features may be incomplete and/or not functioning.

UNITYREF

Your Pit Stop For Solving ANYTHING in Unity

architecture

[Input System] Resolve Inconsistent Gamepad Haptics on macOS

Under Audit

graphicsinput system

Unity 2022.3.x - Unity 6.1.x

Published 30 days ago

Gamepad.current.SetMotorSpeeds() causes inconsistent haptic feedback behavior on macOS, particularly with Bluetooth controllers, due to limitations in Unity's underlying SDL2 implementation.

Issue

 Using Gamepad.current.SetMotorSpeeds() for haptic feedback (rumble) from gamepads yields inconsistent results on macOS. This functionality operates correctly when a DualShock 4 controller is connected via USB. However, haptic feedback is not triggered for DualShock 4 controllers connected wirelessly via Bluetooth on macOS. Similarly, Xbox controllers, regardless of whether they are wired or connected via Bluetooth, also fail to produce haptic feedback on macOS. These inconsistencies were observed in Unity 2022.3.53f1. The root cause is suspected to be Unity's reliance on the SDL2 library, which reportedly has incomplete haptic feedback support on macOS, particularly for wireless connections. This issue presents a challenge for developers seeking reliable, cross-platform haptic feedback without resorting to extensive third-party input system migrations.

Experimental Fixes
  • Ensure the Input System package is updated to its latest verified version to benefit from any bug fixes or improvements.
  • Review Player Settings > Other Settings > Configuration > Active Input Handling to confirm it is set to Input System Package (New) or Both.
  • Explore integrating platform-specific native plugins (e.g., using IOHID on macOS) to handle haptic feedback for devices not fully supported by the default SDL2 backend.

Editor's Note:

The above fixes have not been verified by our audit team yet. They are provided exclusively for your own technical research. We recommend creating a backup of your project before proceeding with any attempts. Utilize at your own discretion!

Related Posts Haven't quite found a solution to your problem? We think these posts might help you.

Content inspired by a Unity discussion post.