Forum Discussion

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

GearVR controller Not working as expected with Unity 2017.2.0f3

Unity Plus 2017.2.0f3 

OVRPlugin 1.18.1 

GearVR controller 



i start new empty project && I
import the Oculus utilities 1.18.1 only.



i run the project Scene
"GearVrControllerTest".



the controller Orientation
values && all data update only when i press trigger or touch , so 
we need an work around for this problem  

because its working fine in Unity Plus 2017.1.1f1 

Thanks


2 Replies

Replies have been turned off for this discussion
  • Thanks 
    here is my Temporary workaround 

    edit OVRInput.cs  inside Update

    Change:

            // Promote TrackedRemote to Active if one is connected and no other controller is active
    if (activeControllerType == Controller.None)
    {
                if ((connectedControllerTypes & Controller.RTrackedRemote) != 0)
                {
                    activeControllerType = Controller.RTrackedRemote;
                }
                else if ((connectedControllerTypes & Controller.LTrackedRemote) != 0)
                {
                    activeControllerType = Controller.LTrackedRemote;
                }
    }

    To:

            // Promote TrackedRemote to Active if one is connected and no other controller is active
    if (activeControllerType > 0)
    {
                if ((connectedControllerTypes & Controller.RTrackedRemote) != 0)
                {
                    activeControllerType = Controller.RTrackedRemote;
                }
                else if ((connectedControllerTypes & Controller.LTrackedRemote) != 0)
                {
                    activeControllerType = Controller.LTrackedRemote;
                }
    }

    i change activeControllerType  from Controller.None to activeControllerType  > 0
    because we have already an Active Controller but it register to system only when i press trigger Button,
    so with my edit we can force system to 
    register the Controller.

    i have working 
    Controller now inside Unity 2017.2.0f3 .

    hope it help till updating from Oculus.

  • @MohamedElmazen  Thanks for the patch code, still useful. I just fixed an issue with the Unity Asset Easy GearVR using it... I'm using OVR v 1.21.0