Getting Started (Unity Oculus Quest) - bhaptics/haptic-library GitHub Wiki

1. How to set up

1.1 Pair your bHaptics gear to the Quest

  • Pair your TactSuit to your headset in the Oculus Quest settings.

(Settings > Experimental Features > Bluetooth Pairing)

1.2. Download bHaptics Haptic Plugin from Unity Asset Store.

(https://assetstore.unity.com/packages/tools/integration/bhaptics-haptic-plugin-76647)

1.3. Import all the bHaptics Plugin's files to your project.

1.4 Setup AndroidManifest.xml (This is for the bluetooth permission)

  • If you don't have one, make a new file to the path Assets/Plugins/Android/AndroidManifest.xml.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.unity3d.player"
    android:versionCode="1"
    android:versionName="1.0" >
    <queries>
        <package android:name="com.bhaptics.player" />  
    </queries>

    <application
      android:allowBackup="true"
      android:label="@string/app_name"
      android:supportsRtl="true" >
      <activity android:name="com.unity3d.player.UnityPlayerActivity" android:label="@string/app_name" android:screenOrientation="sensorPortrait" android:launchMode="singleTask" android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|orientation|screenLayout|uiMode|screenSize|smallestScreenSize|fontScale|layoutDirection|density" android:hardwareAccelerated="false">
        <intent-filter>
          <action android:name="android.intent.action.MAIN" />
          <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
        <meta-data android:name="unityplayer.UnityActivity" android:value="true" />
      </activity>
      <meta-data android:name="unityplayer.SkipPermissionsDialog" android:value="true" />
    </application>
    <uses-permission android:name="android.permission.BLUETOOTH" android:maxSdkVersion="30"/>
    <uses-permission android:name="android.permission.BLUETOOTH_ADMIN" android:maxSdkVersion="30"/>
    <uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />
    <uses-feature android:name="android.hardware.vr.headtracking" android:version="1" android:required="true" />
</manifest>
  • Or, just add the following into your AndroidManifest.xml
<manifest>
  <queries>
    <package android:name="com.bhaptics.player" />
  </queries>  
  <uses-permission android:name="android.permission.BLUETOOTH" android:maxSdkVersion="30"/>
  <uses-permission android:name="android.permission.BLUETOOTH_ADMIN" android:maxSdkVersion="30"/>
  <uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />
</manifest>

1.5 Build Setting

  • Change the build setting to Android to enable the bHaptics Widget.

image

2. How to setup in your scene

2.1. [bHaptics]

  • Add the [bHaptics] prefab to your scene.

[bHaptics] is located at 'Assets/Bhaptics/SDK/Prefabs' folder.

  • For more detail, please refer this link

2.2. [bHapticsAndroidUI]

  • Add the [bHapticsAndroidUI] prefab to your scene.

[bHapticsAndroidUI] is located in Assets/Bhaptics/SDK/Prefabs/Android

image

2.3. If you don't have one, add the UI/EventSystem to your scene in order to trigger events with [bHapticsAndroidUI].

image

2.4. For more detail on interacting with [bHapticsAndroidUI], you can check the example package(BhapticsOculusExample).

the example package is located in Assets/Bhaptics/SDK/Examples/ExamplePackages

⚠️ **GitHub.com Fallback** ⚠️