Search Unity

Controller Inputs with Daydream Controller

Discussion in 'Daydream' started by hjcap1, Apr 24, 2018.

  1. hjcap1

    hjcap1

    Joined:
    Apr 24, 2018
    Posts:
    2
    Hi there,

    Relatively new to Unity so am after a little help regarding the Daydream Controller Inputs.

    My aim is to reset the scene by pressing the app button on the Daydream Controller. I'm guessing I need to have the Gvr Event System component in the scene? Where do the scripts relating to the button presses go?

    Thanks, all
     
  2. SiliconDroid

    SiliconDroid

    Joined:
    Feb 20, 2017
    Posts:
    302
    Hi,

    Yes, pretty much... Add GvrControllerInput script to any game object in your scene.

    After that the holding app btn to reset is handled auto.

    To read inputs: from any script you can call the static api of GvrControllerInput like:

    Code (CSharp):
    1. bool bButtonDown_app = GvrControllerInput.AppButton;
    2. bool bButtonDown_touch = GvrControllerInput.ClickButton;
    3. bool bTouchingPad = GvrControllerInput.IsTouching;
    4. Vector2 vTouchPos = GvrControllerInput.TouchPos;