Skip to main content

Guide

Using our Unity SDK Plugin, you can implement the haptic into your content made with Unity.

  1. Import SDK Plugin
  2. Link the Haptic App
  3. Add Prefab to Initialize

Prerequisite​

Before we start, make sure you have a haptic application(haptic app, for short) corresponding to your game, and the haptic app should contain at least one haptic event. By following this guide, You will link the haptic app to your game.

note

You can create and manage haptic apps in Portal, a web-based program. If you don't know about haptic app or don't have one, please visit Portal first and make your own haptic app. (Protip: Use template to make the app quickly)

Setting tab in Portal

Link process requires App ID and API Key which can be browsed in Portal. Go to your haptic app in Portal, move to "Settings" tab, and prepare App ID and API Key.

note

There is no API Key until you create it. Navigate to the "API Key" tab and click the "New" button to generate one.

Import SDK Plugin​

bHaptics Haptic Plugin in Unity AssetStore

Get bHaptics Haptic Plugin in Unity Asset Store, and import the package into your Unity project.

For more information about importing the Unity package to your Unity project, follow the official Unity documentation.

  1. In the toolbar, select "bHaptics" → "Developer Window".

    Unity toolbar

  2. Enter your App ID and API Key from Portal, then click "LINK" button.

    bHaptics Developer Window Log-in

    note

    You can press "Forgot your App ID & API Key?" to visit Portal and retrieve the information.

  3. After successful certification, the application will appear on bHaptics Developer Window.

Browse App in bHaptics Developer Window​

bHaptics Developer Window

There are multiple tabs you can explore.

  • Home: View the sample guide, and information about your application.

  • Events: Browse and play the latest events you deployed from bHaptics developer portal.

  • Documentation: Browse the documents about the SDK(including this site!)

  • Latest Deployed Version: Check the version or refresh.

    note

    Ensure the version in the portal matches the version in the editor; if not, press refresh icon.

  • Unlink: Disconnet between the game and the haptic app.

Add Prefab for Initialization​

There is a prefab named "[bhaptics]" for initalizing the haptic environment. It should be instantiated before using haptic-related functions. We highly recommend to place it at the first scene.

Prefab initialization

  1. Go to your first scene.
  2. In the Project Window, Go to "Assets" → "Bhaptics" → "SDK2" → "Prefabs".
  3. Add "[bHaptics]" prefab into your scene.

The component in this prefab uses the common Unity Singleton pattern with DontDestroyOnLoad. You only need to place it in the first scene, but it is okay to place multiple places since duplicates are automatically destroyed.

Further Reading​

You're now ready to use the bHaptics haptic feature! Visit our Unity References page to play haptics in your game.

note

If you want to feel haptics right now, we provide a sample scene to explore the haptic events you can playtest. Go to "Assets" → "Bhaptics" → "SDK2" → "Examples" → "Scenes", and open "PlayParamSample" scene. You can play all haptic events with adjusting related parameters.

Troubleshooting​

Migration Guide​