Buzzkit Documentation
User manual for version 1.0.0. Also included in the package as Documentation.pdf. Back to the product page.
Contents
1. Introduction
1.1 What Buzzkit does
Buzzkit makes phones vibrate and game controllers rumble. You write one line of C#, and Buzzkit plays the right kind of haptic on whatever the player is holding: an iPhone, an Android phone, or a gamepad.
A haptic is a short pattern of vibration. Buzzkit describes every haptic with two values that change over time:
- Intensity: how strong the vibration is, from 0 (off) to 1 (full).
- Sharpness: how it feels, from 0 (a soft, dull rumble) to 1 (a crisp, clicky tap).
1.2 What is included
- A single C# class,
Haptics, for playing haptics. - 42 ready-made haptics (coins, explosions, footsteps, menu clicks and more) that you can use as they are or change.
- The Haptics window, for browsing, testing and creating haptics.
- A player setting for turning haptics on or off and changing their strength, saved automatically.
- A demo scene.
1.3 Supported hardware
| Hardware | What you get |
|---|---|
| iPhone with iOS 13 or later | Full intensity and sharpness, using Apple's Core Haptics |
| Android 11 or later | Rich haptics using Android's built-in effects |
| Android 8 to 10 | Vibration with varying strength |
| Older Android phones, or phones without strength control | Simple on and off vibration |
| Gamepads on Windows, macOS and Linux (through Unity's Input System) | Rumble from both motors |
| Anything else | Nothing happens, and nothing breaks |
Buzzkit never shows an error because the hardware cannot vibrate. On a computer with no gamepad, every call simply does nothing.
2. Installing Buzzkit
2.1 Requirements
- Unity 2021.3 or later.
- Optional: Unity's Input System package, if you want gamepad rumble. Phone haptics work without it.
2.2 Importing the package
- Open your project in Unity.
- Open Window > Package Manager.
- In the drop-down at the top left, choose My Assets.
- Find Buzzkit in the list and click Download, then Import.
- In the import window, leave everything ticked and click Import.
2.3 Checking it worked
When the import finishes, a folder named Assets/Zest Studios/Buzzkit appears in the Project window, and the menu Tools > Buzzkit appears at the top of the Unity window.
Assets/Zest Studios/Buzzkit folder. Buzzkit finds its icons and its built-in haptics by that path.3. Setting up your project
3.1 Phones
There is nothing to set up.
- Android: Android only lets an app vibrate if it asks for permission. Buzzkit adds that permission to your build for you.
- iOS: Buzzkit includes the small native file it needs. Xcode compiles it automatically.
3.2 Gamepads
Gamepad rumble uses Unity's Input System package.
- Open Window > Package Manager.
- Choose Unity Registry in the drop-down, find Input System, and click Install.
- If Unity asks whether to enable the new input backends, click Yes. Unity restarts.
- To check, open Edit > Project Settings > Player, expand Other Settings, and find Active Input Handling. It must say Input System Package (New) or Both.
If you skip this, Buzzkit still works on phones. Gamepads simply do not rumble.
4. Your first haptic
This section plays a haptic in about two minutes.
4.1 Turn on haptic logging
Your computer cannot vibrate, so Buzzkit can print a message in the Console instead each time a haptic would play on a phone. Open Tools > Buzzkit and click Log Haptics In Editor. A tick appears next to it.
4.2 Add a haptic to your game
- In the Project window, right-click and choose Create > MonoBehaviour Script (in older Unity versions, Create > C# Script). Name it
HapticTest. - Open the script and replace its contents with the code below.
- Save the script and return to Unity.
- Drag the script onto any object in your scene.
- Press Play.
using UnityEngine; using Zest.Buzzkit; public class HapticTest : MonoBehaviour { void Start() { Haptics.Impact(ImpactStyle.Heavy); } }
4.3 What you should see
The Console shows a line that starts with:
[Buzzkit] (editor) would play preset Impact(Heavy) on Device
If a gamepad is connected and you completed section 3.2, the gamepad also rumbles. On a phone, the phone gives one strong tap.
5. Playing haptics from code
Every script that uses Buzzkit needs this line at the top:
using Zest.Buzzkit;
5.1 Quick haptics with one line
These need no setup and work everywhere:
Haptics.Selection(); // the lightest tick, for scrolling through a list Haptics.Impact(ImpactStyle.Medium); // a tap: Light, Medium, Heavy, Soft or Rigid Haptics.Notify(NotifyType.Success); // a result: Success, Warning or Error
5.2 Playing one of the 42 built-in haptics
The built-in haptics are files in Assets/Zest Studios/Buzzkit/Presets/, sorted into folders such as Combat, Rewards and UI. The easiest way to use one:
- Add a field to your script:
using UnityEngine; using Zest.Buzzkit; public class Coin : MonoBehaviour { [SerializeField] HapticPattern pickupHaptic; void OnTriggerEnter(Collider other) { Haptics.Play(pickupHaptic); } }
- Select the object with this script. In the Inspector, a Pickup Haptic field appears.
- Drag
Presets/Rewards/Coinfrom the Project window into that field.
You can also look a built-in haptic up by its name:
if (BuiltinPatterns.Library.TryGetValue("Explosion Big", out var explosion)) Haptics.Play(explosion);
Names must match exactly, including capital letters and spaces. The Haptics window (section 6) lists every name.
5.3 Choosing where a haptic plays
By default a haptic plays everywhere the player can feel it: the phone and any gamepads. To choose, add a target:
Haptics.Play(explosion, HapticTarget.Gamepad); // gamepads only Haptics.Play(explosion, HapticTarget.Device); // the phone only
To make one haptic weaker or stronger just this once, add a strength from 0 to 1:
Haptics.Play(explosion, HapticTarget.All, 0.5f); // half strength
5.4 Local multiplayer: one controller at a time
Each connected gamepad has a number, starting at 0. To rumble only player 2's controller:
Haptics.PlayOnGamepad(explosion, 1);
Haptics.GamepadCount tells you how many gamepads are connected.
5.5 Stopping a haptic
Haptics.Stop();
You never need to stop haptics yourself when the game is paused, minimised or closed. Buzzkit does that automatically, so a controller is never left rumbling.
5.6 Avoiding a delay on the first haptic
On some phones the very first haptic can start slightly late. Call this once while your level loads:
Haptics.Prepare();
5.7 Checking what the hardware can do
bool canVibrate = Haptics.IsSupported; // anything at all bool hasGamepad = Haptics.Supports(HapticTarget.Gamepad); // a controller is connected
You do not need these checks before playing a haptic. Use them only to change your game, for example to hide a vibration option on a computer with no controller.
6. The Haptics window
Open it with Tools > Buzzkit > Haptics.
| Part | What it does |
|---|---|
| Built-in tab | Lists the 42 haptics that come with Buzzkit, grouped by type |
| Custom tab | Lists the haptics you have made |
| Search box | Filters the list by name or group |
| Play button on a row | Plays that haptic. Works only while the game is running in Play mode |
| Duplicate | Copies a built-in haptic so you can change the copy |
| Select | On the Custom tab, shows that haptic in the Project window |
| Create New Haptic | Makes a new haptic file |
To feel haptics from this window, press Play first and connect a gamepad. With logging turned on (section 4.1), each play also prints a line in the Console.
7. Creating your own haptics
7.1 Making a new haptic
Choose one of these:
- Tools > Buzzkit > Create New Haptic, then choose where to save it. It starts as a single medium tap.
- In the Project window, right-click and choose Create > Zest > Buzzkit > Haptic Pattern. It starts empty.
- In the Haptics window, click Duplicate next to a built-in haptic. This is the quickest way to start from something that already feels close.
7.2 Editing a haptic
Select the haptic file. The Inspector shows its Events. Each event is one part of the haptic.
| Setting | What it means |
|---|---|
| Type | Transient is a single instant tap. Continuous is a vibration that lasts |
| Time | When the event starts, in seconds from the start of the haptic |
| Duration | How long a Continuous event lasts, in seconds. Transient events ignore it |
| Intensity | Strength, from 0 to 1 |
| Sharpness | Feel, from 0 (dull rumble) to 1 (crisp click) |
| Intensity Curve, Sharpness Curve | Optional. Draw how the value changes from the start to the end of the event. A curve needs at least two points; otherwise the plain value is used |
Tips:
- A click or a tap: one Transient event with high sharpness.
- A rumble: one Continuous event with low sharpness.
- A rumble that fades out: an Intensity Curve that goes from 1 down to 0.
- Where two Continuous events overlap, the stronger one is used.
Under the events, the Inspector shows the haptic's total Duration and number of Events.
7.3 Testing a haptic
- Press Play.
- Select the haptic file.
- In the Inspector, click Play, Device or Gamepad. Click Stop to end it.
A connected gamepad rumbles. Phone haptics can only be felt on a phone (section 10).
7.4 Changing a built-in haptic
You can edit the files in Presets/ directly, but the change affects every place that haptic is used, and updating Buzzkit replaces it (section 12). It is safer to Duplicate the built-in haptic and change the copy.
7.5 Making a haptic in code
For haptics that depend on gameplay, such as a thud that gets stronger the harder something lands:
using UnityEngine; using Zest.Buzzkit; public class LandingHaptic : MonoBehaviour { HapticPattern thud; void Awake() => thud = HapticPattern.Create(HapticEvent.Transient(0f, 1f, 0.3f)); void OnDestroy() => Destroy(thud); void OnCollisionEnter(Collision collision) { float strength = Mathf.Clamp01(collision.relativeVelocity.magnitude / 20f); Haptics.Play(thud, HapticTarget.All, strength); } }
Create the haptic once, as above, rather than every time it plays.
8. Letting players control haptics
Some players dislike vibration, and some need it gentler. Buzzkit has two settings for this:
Haptics.Enabled: turns every haptic in the game on or off.Haptics.Intensity: makes every haptic weaker or stronger, from 0 to 1.
Both are saved automatically and remembered the next time the game starts. On first launch, haptics are on at full strength.
8.1 Connecting a toggle and a slider
- In your settings menu, add a Toggle and a Slider (from GameObject > UI, or UI (Legacy) in newer Unity versions).
- Create this script and add it to your settings menu:
using UnityEngine; using UnityEngine.UI; using Zest.Buzzkit; public class HapticsSettings : MonoBehaviour { [SerializeField] Toggle onOffToggle; [SerializeField] Slider strengthSlider; void Start() { onOffToggle.isOn = Haptics.Enabled; onOffToggle.onValueChanged.AddListener(value => Haptics.Enabled = value); strengthSlider.minValue = 0f; strengthSlider.maxValue = 1f; strengthSlider.value = Haptics.Intensity; strengthSlider.onValueChanged.AddListener(value => { Haptics.Intensity = value; Haptics.Selection(); // a small tick so the player feels the new strength }); } }
- Drag your Toggle and Slider into the script's two fields in the Inspector.
Changes apply straight away, even to a rumble that is already playing on a gamepad.
9. The demo scene
Open Assets/Zest Studios/Buzzkit/Demo/Buzzkit Demo.unity and press Play.
- Click any row to play that haptic.
- Target switches between all outputs, the phone only, and gamepads only.
- Enabled and Intensity are the real player settings from section 8.
- The status line shows whether the device can vibrate and how many gamepads are connected.
- Stop all stops every haptic.
To try this inside one of your own scenes instead, add the Buzzkit Demo component to any object and press Play. Build the demo scene to a phone to feel the haptics on the device.
10. Testing on a phone
Haptics on a phone can only be felt in a build on a real phone. The Unity editor and phone simulators cannot vibrate.
10.1 Android
- Open File > Build Profiles (in older Unity versions, File > Build Settings), choose Android, and switch to it.
- Connect your phone with a USB cable, with USB debugging turned on.
- Click Build And Run.
When the build is made, the Console shows a line starting [Buzzkit] Added android.permission.VIBRATE. That confirms Buzzkit added the vibration permission. If your project already declares that permission itself, Buzzkit leaves it alone and prints nothing.
If the phone does not vibrate, check that vibration and touch feedback are turned on in the phone's own settings. Buzzkit never shows an error on screen, but it writes warnings to the phone's log. To read them, run adb logcat -s Unity in a terminal and look for lines containing [Buzzkit].
10.2 iOS
- Choose iOS in Build Profiles and click Build.
- Open the generated Xcode project, choose your iPhone, and click Run.
Haptics need an iPhone 8 or later with iOS 13 or later. iPads and the iOS Simulator do not vibrate.
11. Supporting other hardware (advanced)
Buzzkit can drive hardware it does not support on its own, such as a games console controller, if you have access to that hardware's development kit. You write a small class, called a renderer, that passes Buzzkit's haptics to that kit. Your existing haptics and settings then work on the new hardware with no other changes.
using UnityEngine; using Zest.Buzzkit; public sealed class MyConsoleRenderer : IHapticRenderer { public HapticTarget Target => HapticTarget.Gamepad; public bool IsSupported => true; // return false when no controller is available public void Prepare() { } public void PlayPreset(in HapticPreset preset, float strength) => Play(BuiltinPatterns.ForPreset(preset), strength); public void Play(HapticPattern pattern, float strength) { /* start playing pattern on your hardware */ } public void Tick(float deltaTime) { /* called every frame: update your hardware */ } public void Stop() { /* turn the hardware off */ } public void SetPaused(bool paused) { if (paused) Stop(); } public void Dispose() => Stop(); [RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)] static void Install() => Haptics.RegisterRenderer(new MyConsoleRenderer()); }
Rules for a renderer:
- It must never throw an error. If the hardware is missing, return
falsefromIsSupported. - Multiply every strength you send by
HapticSettings.Intensity, so the player's setting from section 8 still works. StopandSetPaused(true)must turn the hardware off immediately.- To read a haptic over time, use
PatternSampler.SampleContinuousandPatternSampler.CollectTransients. - To address controllers one at a time (section 5.4), implement
IIndexedHapticRendererinstead.
Buzzkit does not include any console development kit. Those are licensed separately by each platform holder.
12. Updating Buzzkit
- Back up your project, or commit it to version control.
- Import the new version as in section 2.2.
- Read
Assets/Zest Studios/Buzzkit/CHANGELOG.mdto see what changed.
What happens to your work:
- Your own haptics are kept, as long as they are saved outside
Assets/Zest Studios/Buzzkit/. - Changes to the built-in haptics in
Presets/are replaced by the new version. Duplicate a built-in before changing it (section 7.4). - Player settings are kept. They are stored on the player's device, not in the package.
13. Troubleshooting
| Problem | Fix |
|---|---|
| Nothing happens when I press Play | Your computer cannot vibrate. Turn on Tools > Buzzkit > Log Haptics In Editor (section 4.1), connect a gamepad, or test on a phone (section 10). |
| Haptics do nothing outside Play mode | Haptics only run while the game is running. Press Play first. |
| The gamepad does not rumble | The Input System is missing or not active. Follow section 3.2. |
| "The type or namespace name 'Zest' could not be found" | Add using Zest.Buzzkit; at the top of the script. If the script is inside an Assembly Definition, select it and add Zest.Buzzkit.Runtime and Zest.Buzzkit.Data to its references. |
| The Haptics window's Built-in tab is empty | Resources/Buzzkit/HapticLibrary was moved or deleted. Reimport Buzzkit (section 12). The one-line haptics from section 5.1 keep working meanwhile. |
| A new haptic does nothing | It has no events, or a Continuous event has a Duration of 0. Add an event, or give it a Duration above 0. |
| A curve has no effect | The curve has fewer than two points. Add a second point. |
| The Android phone does not vibrate | Turn on touch feedback in the phone's settings, then check the log as in section 10.1. |
| A haptic feels weaker on a gamepad than on a phone | Gamepad motors are slower and less precise. This is normal; test each haptic on every kind of hardware you support. |
| Haptics stopped for some players | They turned haptics off or the strength down. This is the player setting from section 8 working as intended. |
14. Support
Discord: discord.gg/2ths8Hj9QE (the fastest way to reach us)
Email: studioszest@gmail.com
When you get in touch, please include your Unity version, the platform you are building for, the phone or gamepad model, and any lines from the Console or phone log that contain [Buzzkit].