A lightweight and consistent Haptic feedback plugin for Unity (Android).
It gives you precise vibration control across all Android devices — from older phones to the latest Android 14+ models.
- ✅ Simple API — just one line to trigger vibration.
- ✅ Works on all Android devices (API 21+)
- ✅ Uses
VibratorManagerautomatically on Android 12+ (multi-motor support) - ✅ Supports custom vibration duration and amplitude
- ✅ Provides 5 adjustable haptic levels — from subtle taps to strong impacts
- ✅ Safe fallback (
Handheld.Vibrate) in Editor or non-Android builds
- Clone or download this repository.
- Copy the folders into your Unity project.
- Ensure your Android Manifest includes: (This is already included if you use the provided manifest in /Plugins/Android/..)
<uses-permission android:name="android.permission.VIBRATE" />- Build your project for Android. That’s it — no Gradle or Java configuration needed.
1️⃣ Initialize (required once)
Call this early, like in your game’s startup scene:
void Start() => HapticManager.Initialize();
2️⃣ Simple Vibrate: predefined haptic levels
1. HapticManager.SimpleVibrate(HapticLevel.VeryLight);
2. HapticManager.SimpleVibrate(HapticLevel.Light);
3. HapticManager.SimpleVibrate(HapticLevel.Medium);
4. HapticManager.SimpleVibrate(HapticLevel.Heavy);
5. HapticManager.SimpleVibrate(HapticLevel.Extreme);
3️⃣ Custom Vibrate: define your own vibration
HapticManager.CustomVibrate(duration: 80, amplitude: 200); // Duration (ms), Amplitude (1–255)
4️⃣ Stop ongoing vibration
HapticManager.Stop();
🎛️ Simple Haptic Levels
| Level | Name | Duration (ms) | Amplitude |
|---|---|---|---|
| 1 | VeryLight | 15 | 40 |
| 2 | Light | 25 | 80 |
| 3 | Medium | 40 | 150 |
| 4 | Heavy | 70 | 220 |
| 5 | Extreme | 100 | 255 |
A sample scene is included at:
Assets\Plugins\Android\HapticPlugin\Demo\...
It provides UI buttons to test each Haptic Level and verify everything is working properly on your Android device.
⭐ If this plugin helps your project, consider giving it a star on GitHub! 🙏