Integrating Bhaptics with Unity - utwente-interaction-lab/interaction-lab GitHub Wiki

How to Integrate bhaptics SDK into Unity

Below are steps on how to install and integrate the bhaptics tactile vibration SDK into a Unity project. This allows sending tactile feedback to bhaptics devices.

Requirements

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

Install the bhaptics SDK

  1. Download the latest bhaptics Player SDK from bhaptics.com.
  2. Extract the .zip file.
  3. Import the bhaptics SDK package into your Unity project.
    • Assets > Import Package > Custom Package
  4. Select everything in the package and import.

Configure the Project

  1. Navigate to Edit > Project Settings > Player
  2. Under the XR Settings:
    • Check Virtual Reality Supported
    • Add bhaptics to the Virtual Reality SDKs list
  3. (Optional) Under Publishing Settings add:
    • bhaptics to the list of target platforms
    • Windows to the list of target SDKs

Add bhaptics Objects

  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.

Send Haptic Feedback

To send haptic feedback call:

BhapticsManager.instance.SubmitRegistered("HapticKey", position, intensity);

Conclusion

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.