FAQ (Unity) - bhaptics/haptic-library GitHub Wiki

1. Can I find out through the api which devices are connected? Couldn't find that so far.

// ~ version 1.5.1
BhapticsManager.GetHaptic().IsActive(PositionType pos);

// version 1.5.2 ~
BhapticsManager.GetHaptic().IsConnect(PositionType pos);

2. Is there an easy way to mirror a pattern? I see lots of files for the left side only.

  • Update to version 1.5.2. The right side was also added.
  • If you want to make a new one, Using HapticClip is easier way. Duplicate the HapticClip file and check IsReflect. image
  • The script uses the following:
// For the clips type of ArmsHapticClip and FeetHapticClip and HandsHapticClip, you can use
public ArmsHapticClip clip;
clip.IsReflect = true;
clip.Play();
  • Unfortunately, clips type of HeadHapticClip and VestHapticClip are not possible.

3. Can I define patterns programmatically / procedurally?

  • Reference 6_DotPoint_via_script example scene(need version 1.5.2).
  • Use the following functions. And, if necessary, use Coroutine.
BhapticsManager.GetHaptic().Submit(string key, PositionType position, List<DotPoint> points, int durationMillis)
BhapticsManager.GetHaptic().Submit(string key, PositionType position, List<PathPoint> points, int durationMillis)
⚠️ **GitHub.com Fallback** ⚠️