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
- Download the latest bhaptics Player SDK from bhaptics.com.
 - Extract the .zip file.
 - Import the bhaptics SDK package into your Unity project.
- Assets > Import Package > Custom Package
 
 - Select everything in the package and import.
 
Configure the Project
- Navigate to 
Edit > Project Settings > Player - Under the XR Settings:
- Check 
Virtual Reality Supported - Add 
bhapticsto the Virtual Reality SDKs list 
 - Check 
 - (Optional) Under 
Publishing Settingsadd:bhapticsto the list of target platformsWindowsto the list of target SDKs
 
Add bhaptics Objects
- Create a new 
BhapticsManagerobject (menu: bhaptics > Bhaptics Manager) - Create a new 
BhapticsReceiverobject (menu: bhaptics > Bhaptics Receiver) - 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.