MOST Haptic Feedback
Quick and simple MOST, but it's essential for all mobile games...

Key Features 🔥
Works on iOS (10+ / iPhone 7 or above) and Android (5.0+)
Automatically adapts to device capabilities
No dependencies required
iOS: All HapticFeedback from IOS UIKit + Custom Haptic Pattern generator
Android: Custom vibration patterns generator with amplitude control
Regular Vibrate: fallbacks for unsupported devices
GetHapticStatus() to check device support
Editor-safe (no errors in Play Mode)
One-line setup: `HapticManager.Generate(HapticTypes.Success);`
No manual Xcode/AndroidManifest edits required
Includes ready-to-use prefabs and example scripts
Toggle haptics globally with `HapticManager.HapticsEnabled`
Auto-fallback for unsupported devices
Enable and Disable Haptic feedback globally
// Enable or disable haptic feedback globally
Most_HapticFeedback.HapticsEnabled return or set bool
Generate a Basic haptic feedback
// generate a haptic feedback from the built-in(API) haptics
Most_HapticFeedback.Generate(Most_HapticFeedback.HapticTypes);
// generate a haptic feedback from the built-in(API) haptics and set a cooldown after
// Haptic With Cooldown is very useful for continuous haptic spamming
// for example... Sliders, Scrolling, continuous damage...
Most_HapticFeedback.GenerateWithCooldown(Most_HapticFeedback.HapticTypes, cooldown);
// ___________ All Baisc Haptics from iOS UIToolKit ___________ //
// These names from iOS UIToolKit // call it default haptics
Selection // case 0 // IOS 10+
Success // case 1 // IOS 10+
Warning // case 2 // IOS 10+
Failure // case 3 // IOS 10+
LightImpact // case 4 // IOS 10+
MediumImpact // case 5 // IOS 10+
HeavyImpact // case 6 // IOS 10+
RigidImpact // case 7 // IOS 13+ <<
SoftImpact // case 8 // IOS 13+ <<
// I used these names to make a default haptics for Android as well
// you will find IOSDefaultHapticsToAndroidPatterns() function inside MOST_HapticFeedback
// and edit these values if you want
Examples: Basic haptic feedback
// To call haptic type
Most_HapticFeedback.HapticTypes.Type;
// example // define a selection haptic
Most_HapticFeedback.HapticTypes.Selection;
// example // haptic feedback as a public property
public Most_HapticFeedback.HapticTypes BasicHaptic;
// example // for activating a haptic feedback
Most_HapticFeedback.Generate(Most_HapticFeedback.HapticTypes.Selection);
// example // for activating a haptic feedback using public property
Most_HapticFeedback.Generate(BasicHaptic);
// example // for activating a haptic feedback with cooldown using public property
Most_HapticFeedback.GenerateWithCooldown(BasicHaptic, 0.1f);
Custom Haptic Pattern
// define a custom haptic as a public property
public Most_HapticFeedback.CustomHapticPattern CustomHapticPattern;

iOS Haptic Pattern
Delay: the delay before starting this pulse in milliseconds
Pulse Type: Haptic type of this pulse
Android Haptic Pattern
Delay: the delay before starting this pulse in milliseconds
Pulse Time: Pulse time in milliseconds
Pulse Strength: vibration strength of the pulse integer (0-255)
After creating the haptic pattern for Android and iOS you can now test it on a real device.
// Call a custom haptic pattern // This function is only for the custom haptic patterns
StartCoroutine(Most_HapticFeedback.GeneratePattern(CustomHapticPattern));
// has to be a Coroutine function to apply the delay
Last updated