Haptics not working with Unity and Oculus Quest? Works fine with Rift S
Hi. I am trying to get haptics working on my Oculus Quest and my unity app (unity 2018.3.6f, Oculus integration1.37). When I test it in editor in the rift S, it works great but when I run it on the quest it doesnt work. I get no errors and no haptic vibration. The line I am using is OVRInput.SetControllerVibration(160, 0.5f, OVRInput.Controller.RTouch); Has anyone got haptics working on quest for their apps? Thanks Tim1.1KViews0likes2CommentsOVRHaptics.Process() throwing exception when removing headset (v1.28.0 / SDK 1.39.0, Unity 2019.1)
Hello, Getting this exception being thrown in the console when removing a Rift S headset... This is happening in the Unity Editor, using Unity v2019.1.11f1, Oculus Utilities v1.28.0, OVRPlugin v1.28.0, SDK v1.39.0. Not using touch controllers, it's currently a passive presentation-type app. ArgumentException: start_index + length > array length Parameter name: length System.Runtime.InteropServices.Marshal.Copy (System.Byte[] source, System.Int32 startIndex, System.IntPtr destination, System.Int32 length) (at <7d97106330684add86d080ecf65bfe69>:0) OVRHaptics+OVRHapticsOutput.Process () (at Assets/ThirdParty/Hardware/Oculus/VR/Scripts/OVRHaptics.cs:243) OVRHaptics.Process () (at Assets/ThirdParty/Hardware/Oculus/VR/Scripts/OVRHaptics.cs:369) OVRManager.LateUpdate () (at Assets/ThirdParty/Hardware/Oculus/VR/Scripts/OVRManager.cs:1458) Screengrab of the camera rig prefab using the OVRManager component, pretty standard implementation:1.2KViews0likes1CommentOculus Integration Unity Asset - Haptics not working on Rift S
I'm trying to use the Oculus Integration Unity Asset (version 1.42) to get haptic feedback on the Rift S controllers. In the past I've used OVRHaptics to do this but I see this has been deprecated now (even though I've tried OVRHaptics and that doesn't work on Rift S either) So I'm trying to use OVRInput.SetControllerVibration and I'm just getting no haptic feedback at all on either controller. If I use the built in UnityEngine.XR InputDevice.SendHapticImpulse, then I get haptic feedback on the Rift S just fine so the haptics are working fine on the controllers and are working fine within Unity. But no matter what I try, I cannot get the OVRInput.SetControllerVibration or the OVRHaptics stuff working at all on the Rift S Am I missing something or is this just broken somehow in the SDK?2.5KViews0likes3CommentsHaptic frequency has no effect on Rift S or Quest
Using the OVR haptic APIs, I can't seem to find any difference at all using difference values for the frequency parameter. From my experiments, only amplitude has any impact on the resulting haptic effect on Rift S and Quest, besides setting frequency to 0 which turns haptics off. So assuming a constant value for amplitude, frequency == 0 results in no haptics, any value of frequency > 0 results in identical haptics.674Views0likes0CommentsGetting number of current clips in a OVRHapticsChannel
Is there a way to get the number of currently queued clips in the OVRHapticsChannel? I could do it myself by keeping track of the time and the length of samples in there, but I figured it'd be better to check the actual channel but i'm not sure if i can?464Views0likes0Comments[Bug report / Tip] Unity 5.5 freezing on start while VR support is not enabled. Caused by OVRHaptics
Hello. Some info: Unity 5.5.0f3. Newest Oculus SDK UnityPackage (I dont see a readme.txt with version number or anything), at the time of writing. Newest OVRAvatar UnityPackage (same). I have been trying to debug a strange issue that I encountered when trying to build a Non-VR mode for team mates with no headset. If I disabled VR Support in player settings, or simply disconnected my Rift, Unity would freeze when hitting Play. No way out of it, other than to kill Unity and try again. This appears to be caused by me initalizing OVRHapticsClips a few places in Start / Awake. If I stop doing this, Unity runs fine. Repro steps are: Step 1: Have a class with an OVRHapticsClip declared. Step 2: Initialize the clip with the new OVRHapticsClip(AudioClip clip) overload. Step 3: Go to player settings and disable VR support. Step 4: Press Play. For now, the best workaround I found is to check VRDevice.isPresent before init'ing any clips. Happy dev'ing. Hope this helps the Oculus team as well.1KViews0likes1Commentthe "OVRHapticsClip" can't work, help me to write some codes for example.
if use the "OVRHapticsClip " create with " AudioClips" it cause unity crash, there is a Infinite loop in "while" private void InitializeFromAudioFloatTrack(float[] sourceData, double sourceFrequency, int sourceChannelCount, int sourceChannel) { double stepSizePrecise = sourceFrequency / OVRHaptics.Config.SampleRateHz; int stepSize = (int)stepSizePrecise; double stepSizeError = stepSizePrecise - stepSize; double accumulatedStepSizeError = 0.0f; int length = sourceData.Length; Count = 0; Capacity = length / sourceChannelCount / stepSize + 1; Samples = new byte[Capacity * OVRHaptics.Config.SampleSizeInBytes]; int i = sourceChannel % sourceChannelCount; while (i < length) { if (OVRHaptics.Config.SampleSizeInBytes == 1) { WriteSample((byte)(Mathf.Clamp01(Mathf.Abs(sourceData)) * System.Byte.MaxValue)); // TODO support multi-byte samples } i+= stepSize * sourceChannelCount; accumulatedStepSizeError += stepSizeError; if ((int)accumulatedStepSizeError > 0) { i+= (int)accumulatedStepSizeError * sourceChannelCount; accumulatedStepSizeError = accumulatedStepSizeError - (int)accumulatedStepSizeError; } } } I find the crux of problem: "OVRHaptics.Config.SampleRateHz" is zero!! and can't get the right value from "OVRHaptics.Config",all value is zero in "OVRHaptics.Config". I just want to make the touch vbration, somebady can help me? tell me how to use vbration API with some right code for example. the "OVRInput.SetControllerVibration" is not my need, it can't control vibration duration. please.2.5KViews0likes3CommentsHow 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?Solved1.3KViews0likes1Comment