Welcome to the Oculus Developer Forums!

Your participation on the forum is subject to the Oculus Code of Conduct.

In general, please be respectful and kind. If you violate the Oculus Code of Conduct, your access to the developer forums will be revoked at the discretion of Oculus staff.
New to the forums? Click here to read the How To guide. -- Developers click here.

Bug when both controllers are vibrating

playsnakvrplaysnakvr Posts: 5
NerveGear
edited September 2018 in Unity Development
If I trigger both controllers to vibrate for N seconds, instead I get an N second delay, followed by the requested vibration. This seems to happen quite consistently any time we have both controllers vibrating simultaneously.

I'm using Unity 2018.2.7f1 and Oculus Integration 1.27, and I'm triggering the vibration with:

            byte[] samples = new byte[90];
            for (int Idx = 0; Idx < samples.Length; ++Idx)
            {
                samples[Idx] = 255;
            }
            OVRHapticsClip testClip = new OVRHapticsClip(samples, samples.Length);
            OVRHaptics.LeftChannel.Mix(testClip);
            OVRHaptics.RightChannel.Mix(testClip);

Is this a known issue?

Comments

  • imperativityimperativity Posts: 3,587 Valuable Player
    edited September 2018
    Hi,

    Thanks for reporting this!

    I am not aware of a specific issue along these lines currently.

    I'll forward this internally for feedback and will update this post with any guidance I can source.

    EDIT: this is a known issue and can be worked around by not using OVRHaptics+OVRHapticsClip and using SetControllerVibration instead.
  • playsnakvrplaysnakvr Posts: 5
    NerveGear
    @imperativity Thanks for the suggestion. The SetControllerVibration fix worked fairly well, but still breaks sometimes when both hands are vibrating simultaneously - it seems to easily get "stuck on", and will vibrate for the next two seconds no matter how often I call SetControllerVibration(0,0). It seems to be a timing issue, I was able to reproduce it quite consistently (about once every three times I press the button) with the following code:

    public class VibrateTest : MonoBehaviour
    {
        private void Update()
        {
            if (OVRInput.GetDown(OVRInput.Button.Four))
            {
                StartCoroutine(Vibrate());
            }
        }

        IEnumerator Vibrate()
        {
            OVRInput.SetControllerVibration(1, 1, OVRInput.Controller.LTouch);
            OVRInput.SetControllerVibration(1, 1, OVRInput.Controller.RTouch);
            yield return null;
            yield return null;
            OVRInput.SetControllerVibration(0, 0, OVRInput.Controller.LTouch);
            OVRInput.SetControllerVibration(0, 0, OVRInput.Controller.RTouch);
            yield return null;
            yield return null;
            OVRInput.SetControllerVibration(1, 1, OVRInput.Controller.LTouch);
            OVRInput.SetControllerVibration(1, 1, OVRInput.Controller.RTouch);
            yield return null;
            yield return null;
            OVRInput.SetControllerVibration(0, 0, OVRInput.Controller.LTouch);
            OVRInput.SetControllerVibration(0, 0, OVRInput.Controller.RTouch);
        }
    }
  • playsnakvrplaysnakvr Posts: 5
    NerveGear
    edited October 2018
    @imperativity Any chance one of these bugs in OVRHaptics or SetControllerVibration might be fixed soon? This is basically making it impossible to have both controllers vibrate at the same time (in our case, holding a two-handed machine gun).
  • dannyhabibsdannyhabibs Posts: 1
    NerveGear
    I'm hitting the same issue.
    Should we not be using OVRHaptics at all if we need to vibrate both controllers simultaneously? 
Sign In or Register to comment.