How to Integrate bhaptics SDK into Unity - Daniel

This guide contains steps on how to install and integrate the bhaptics tactile vibration SDK into a Unity project using bHaptics developer. This allows sending tactile feedback to bhaptics devices inside a Unity Project. This guide will use bhaptics Tactgloves as an example, however, the steps should work with all bhpatic devices.

  • Unity 2019.4 or later
  • bhaptics Player SDK
  • One of the types of bhaptics hardware (vest, gloves, etc.).

Download bHaptics player at the following link: https://www.bhaptics.com/software/player. Once installed, Login and follow setup instructions. Within the player, you can pair your devices as instructed by the manual associated with the bhaptic tool you plan to connect. In the case of Tactgloves, this is done via turning them on and pairing them under the device settings in bhaptics player. Once paired, can test the device by pressing ping. This should send a haptic signal given that pairing worked correctly.

  • Click on create a new project

  • You can either choose an empty project or to use a template. In this case, we will use the shooting template.
  • Retrieve API key and Project ID to use in Unity. This can be down by going to the API subsection and pressing NEW to generate a usable API key.
  • Once API key is generated, go to settings. API key and APP ID should be there. Keep this in mind for reference in Unity later on.

  • Press Deploy Now to make haptic events reachable from Unity
  • Once downloaded, install plugin into unity by following install instructions
  • Open bHaptics plugin by going to My Assets from the Explore option under the Services tab. Then import the bhaptics plugin to your project.

  • Once bhaptics is imported, you can sync bhaptics by clicking on developer window and entering your unique APP ID and API Key.
    • This will only work if you already pressed deploy on your bhaptics developer template

This will link your bhaptics template to your unity project. It will show you documentation you can use to develop your haptic effects and how to combine them.

  1. Create a new BhapticsManager object (menu: bhaptics > Bhaptics Manager)
  2. Create a new BhapticsReceiver object (menu: bhaptics > Bhaptics Receiver)
  3. Position both objects under a manager object in the hierarchy.

To send haptic feedback call:

BhapticsManager.instance.SubmitRegistered(“HapticKey”, position, intensity);

The bhaptics SDK is now integrated into your Unity project. You can send haptic feedback to bhaptics devices by calling the SubmitRegistered() method. Refer to the bhaptics documentation for more advanced usage.