# 6. Haptics Pitfalls
Part of [[Haptics and Controller Rumble]]. Previous: [[5. Worked Example Haptics Test Bench and Settings]].
> [!warning] Code not compiled
> One small safety script. Not compiled.
## 6.1 Symptom table
| Symptom | Cause | Fix |
|---|---|---|
| Controller keeps buzzing in the menu | `SetMotorSpeeds(x, y)` with no matching stop (object destroyed, exception, cancelled await) | Only the service talks to motors; it resets in `OnDisable` and `OnApplicationQuit` (part 2) |
| Buzzing continues while paused | Pause menu sets `timeScale = 0` but nothing pauses haptics | `GamepadRumbleService.SetPaused(true)` / `PauseHaptics` |
| A 0.1 s rumble lasts seconds | Timing with scaled time during hit-stop or slow-mo | Patterns use unscaled time |
| Second hit cuts off the first | Each effect stops the motors at its own end | Voice mixing by max (part 2) |
| Rumble on the wrong player's pad | `Gamepad.current` in local multiplayer | `PlayerInput.GetDevice<Gamepad>()` via `PlayerRumble` |
| Nothing on an Android phone with a Bluetooth pad | Android gamepad rumble needs **Unity 6000.6+** | Upgrade for that target, or accept no rumble |
| Long rumble stops by itself on Android | Auto-stop about **10 s** after the last call | Keep-alive re-send (part 2) |
| Android 11 pad only has one motor | Older Android supports a single motor | Design patterns that still read with one motor (use both curves similarly) |
| Switch Pro / generic pads do not rumble on PC | Not in the Input System supported list for desktop | Do not rely on rumble; always pair it with audio/visual |
| Nothing on iOS/visionOS | Needs **Unity 6000.7+** | Same as above |
| Quest: no haptics while using hands | Hands have no actuator | Sound + visual; `ControllerActive` false (part 3) |
| Quest: long effect feels like clicks | Impulses too short or too far apart | Smaller step, overlap ≥ 1.3 (part 3) |
| Quest: `frequency` makes no difference | Device or runtime ignores it **(unverified for Quest 2)** | Design with amplitude and duration only |
| Everything buzzes all the time | Too many kinds wired, no cooldowns | Budget rules (part 1), router cooldowns |
| Rumble feels late | Raised after a coroutine/animation event instead of in `ApplyDamage` | Raise on the same frame as the hit sound |
## 6.2 Design pitfalls
- **Rumble as the only signal.** Players with vibration off, unsupported pads or hand tracking miss it. Every haptic event needs an audio/visual twin ([[Accessibility]]).
- **Same pattern for everything.** If hit dealt and hit taken feel identical, the player cannot tell which happened with eyes on the screen elsewhere.
- **Continuous texture rumble** (engine, rain) under combat rumble. It masks the important events; duck or stop textures during combat, like audio ducking.
- **Testing only with one controller model.** Xbox and DualShock motors feel very different; tune on both, and on a Quest Touch controller for VR builds.
## 6.3 Engineering pitfalls
- **Static events and disabled domain reload.** Reset static events in `SubsystemRegistration` (part 4) or old scene objects keep receiving events.
- **Several services.** A second `GamepadRumbleService` in an additive scene would fight over the motors; the singleton guard destroys extras.
- **`SetMotorSpeeds` every frame** with identical values: wasted device commands. Send on change plus keep-alive only.
- **Calling haptics from a background thread.** Input System device commands belong on the main thread.
## 6.4 RumbleSafetyNet.cs
A belt-and-braces component for the bootstrap scene: whatever else happens, motors stop on scene unload and quit.
```csharp
using UnityEngine;
using UnityEngine.InputSystem;
using UnityEngine.SceneManagement;
/// <summary>
/// Resets all device haptics when any scene unloads and when the app quits.
/// Put it on a DontDestroyOnLoad bootstrap object. Not compiled in Unity.
/// </summary>
public sealed class RumbleSafetyNet : MonoBehaviour
{
void Awake() => DontDestroyOnLoad(gameObject);
void OnEnable() => SceneManager.sceneUnloaded += OnSceneUnloaded;
void OnDisable() => SceneManager.sceneUnloaded -= OnSceneUnloaded;
static void OnSceneUnloaded(Scene scene) => InputSystem.ResetHaptics();
void OnApplicationQuit() => InputSystem.ResetHaptics();
}
```
Scene loading itself is covered in [[SceneManagement]].
## 6.5 Ship checklist
- [ ] Off switch and intensity in the first settings screen; Test button works.
- [ ] Pause, alt-tab, unplugging the pad mid-rumble, quitting mid-rumble: no stuck motors.
- [ ] Two local players: correct routing.
- [ ] Hit-stop and rumble start on the same frame.
- [ ] Quest build: grab ticks, combat hits on the right hand, nothing while hand tracking.
- [ ] Played a full level with rumble on and asked "did any of that get annoying?"
## Sources
- Input System 1.20 gamepad haptics (support, Android 6000.6+, 10 s auto-stop, single motor on Android 11 and earlier, iOS 6000.7+): https://docs.unity3d.com/Packages/
[email protected]/manual/gamepad-haptics.html
- Input System 1.20 `InputSystem.ResetHaptics`: https://docs.unity3d.com/Packages/
[email protected]/api/UnityEngine.InputSystem.InputSystem.html
- `SceneManager.sceneUnloaded` (6000.5): https://docs.unity.com/en-us/engine/6000.5/script-reference/unityengine/scenemanagement/scenemanager/sceneunloaded
- XRI 3.4 `HapticImpulsePlayer`: https://docs.unity3d.com/Packages/
[email protected]/api/UnityEngine.XR.Interaction.Toolkit.Inputs.Haptics.HapticImpulsePlayer.html