Skip to main content
New Participant
September 12, 2018

Bug when both controllers are vibrating

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?

    This topic has been closed for replies.

    3 replies

    New Participant
    September 26, 2018
    @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);
        }
    }
    New Participant
    October 16, 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).
    January 9, 2019
    I'm hitting the same issue.
    Should we not be using OVRHaptics at all if we need to vibrate both controllers simultaneously?