Forum Discussion

🚨 This forum is archived and read-only. To submit a forum post, please visit our new Developer Forum. 🚨
Anonymous's avatar
Anonymous
9 years ago
Solved

How do I use OVRHapticsClip?

I'm trying to add haptic feedback to Touch Controllers in my game but I'm completely stuck on how to do that.  I've read all the documentation provided by Oculus which recommends several different methods, the most recent of which relies on playing OVRHapticsClips.

My problem is that Unity freezes when trying to create any OVRHapticsClip.  It doesn't just error, the entire program stops responding the same as when stuck in an infinite loop.

Are there any examples of code to play haptic feedback on the Touch controllers?  Or is there a limitation on the type of audioclip that can be used to create an OVRHapticsClip?


  • Anonymous's avatar
    Anonymous
    9 years ago
    Ok, problem solved.  I figured out it was InitializeFromAudioFloatTrack in OVRHapticsClip.cs that was getting stuck in an endless loop, so I added a loop counter and made it break out of the loop when it reached 1000.  I hope this function will work more reliably in the future.

1 Reply

  • Anonymous's avatar
    Anonymous
    Ok, problem solved.  I figured out it was InitializeFromAudioFloatTrack in OVRHapticsClip.cs that was getting stuck in an endless loop, so I added a loop counter and made it break out of the loop when it reached 1000.  I hope this function will work more reliably in the future.