[Input System] Resolve Inconsistent Gamepad Haptics on macOS
Under Audit
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.
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.
- Ensure the
Input Systempackage is updated to its latest verified version to benefit from any bug fixes or improvements. - Review
Player Settings > Other Settings > Configuration > Active Input Handlingto confirm it is set toInput System Package (New)orBoth. - 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:
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.