0

I use Unity 3D with Samsung Gear. I have a working OVRPlayerController in my scene but I am having difficulties mapping the oculus tap, swipe and return button.

I have tried with something like:

if (Input.GetMouseButtonDown(0))      
{            
   Debug.Log("input detected");
}

And with this I detect the tap encircled in red enter image description here

I have tried also something like:

if (OVRInput.Get(OVRInput.Button.PrimaryThumbstick))
    {            
        Debug.Log("Input detected");
    }

Or :

if (OVRInput.Get(OVRInput.Button.One))
    {
        Debug.Log("Input detected");
    }

But nothing seems to work. Is there any documentation that explains how is the input mapped on Samsung Gear that I encircled in yellow ? Does anyone have experience with this or can maybe guide me to some useful documentation on this matter ?

Cheers

My project settings for input:

enter image description here

Adrian Ivasku
  • 1,118
  • 3
  • 16
  • 31
  • 1
    Since `Input.GetMouseButtonDown(0)` is working for a tap, `Input.GetMouseButtonDown(1)` should work for the return button. As for swiping, you use `Input.GetAxis ("Mouse X");` and `Input.GetAxis ("Mouse Y")`. – Programmer Oct 23 '16 at 02:05
  • @Programmer - You were right about the return button. Thanks. But about the "swipes" - arrows they don`t seem to work even with Input.GetAxis("Horizontal") or "Mouse X". – Adrian Ivasku Oct 23 '16 at 09:14
  • When you import the Oculus SDK, override the `projectsettings` with the one that comes with the `projectsettings`. I think that one contains mapping information about the Axis that will get it working. If this does not work let me know. I have one more possible solution. – Programmer Oct 23 '16 at 13:41
  • @Programmer - Check the image I added to the question. If you mean about this project settings you can see that I have these defined. I tried something like Input.GetAxis ("Oculus_GearVR_LThumbstickX") but no luck. – Adrian Ivasku Oct 23 '16 at 19:53
  • Why not try [this](http://stackoverflow.com/a/39819973/3785314)? It will help you detect which key is being pressed – Programmer Oct 25 '16 at 10:59
  • @Programmer I will try this Sunday because the gear is not with me at the moment. – Adrian Ivasku Oct 27 '16 at 07:06

1 Answers1

0

For swipes, you can get the current Vector2 on the touchpad (either the HMD and/or the incoming remote controller touchpad) by using:

CurrentVector = OVRInput.Get(OVRInput.Axis2D.PrimaryTouchpad);

as for the back button, it is accessible using OVRInput.Button.Back either on Get, GetDown or GetUp. But know that a 2 seconds long back press is reserved for the Universal Menu and should not have any implications inside your game or app.

Scott
  • 1,863
  • 2
  • 24
  • 43
Omar Guendeli
  • 322
  • 1
  • 8