Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

capture samsung gear vr touch input with unity

Discussion in 'AR/VR (XR) Discussion' started by rameshp, Mar 2, 2015.

  1. rameshp

    rameshp

    Joined:
    Feb 18, 2015
    Posts:
    10
    I have got the following UI going so far using NGUI + Unity4 and Oculus Unity Integration.

    Capture.JPG

    Could anyone please help me out with how can I capture the Samsung gear VR touch pad input using unity ?.
     
  2. rameshp

    rameshp

    Joined:
    Feb 18, 2015
    Posts:
    10
    Anyone anything ? :(:(:(:(:(:(. I am starting to go crazy here o_Oo_O
     
  3. curtfl

    curtfl

    Joined:
    Jan 9, 2014
    Posts:
    2
    sure, make sure you have the latest SDK (I have 0.4.3) and:

    Code (csharp):
    1.  
    2. Input.GetAxis("Mouse Y");
    3. Input.GetAxis("Mouse X");
    4.  
    Will return differential data, and
    Code (csharp):
    1.  
    2. Input.GetMouseButtonDown(0);
    3.  
    Will detect taps.
     
  4. charnold

    charnold

    Joined:
    Mar 31, 2014
    Posts:
    31
    Is it correct, that Input.GetAxis returns delta values? (I don't have a Gear VR yet)

    Is there a way to get the absolute positions where the finger is on the touch pad?
     
  5. s4wolf64

    s4wolf64

    Joined:
    Dec 5, 2014
    Posts:
    4
    yes touch pad Gear = mouse move
    Fire1 = tap touchpad
    keycode.quit = back boton
     
  6. VirtualMan

    VirtualMan

    Joined:
    Mar 5, 2014
    Posts:
    1
    Mhh I dont get it...
    Im trying to rotate an Object via Touchpad. Its rotating correcty the first time im touching the GearVR´s touchpad...BUT the second time i touch it the Object rotate instantly to a "random" degree. From that deegree on im able to rotate it correcty again. This Error appears every time i touch the pad.

    I hope someone can help me :)

    Code looks like this



    Code (CSharp):
    1. void Update ()
    2. {
    3. Mouse_X = Input.GetAxis("Mouse X");
    4. transform.Rotate(0,0,Mouse_X);
    5. }
     
  7. joschi27

    joschi27

    Joined:
    Jul 31, 2016
    Posts:
    9
    Please keep in mind that this is not a VR related question but just a misunderstanding of the unitymechanics. Please research on how to rotate objects in unity yourself, it's pretty well explained in the docs.

    The Mouse_X variable in your project probably reaches from -1 to 1. If you press the middle of the touchpad, it's 0, left side 1 and right -1. You need to either store the variable mouse_x_old when releasing the finger and continue rotating from there once you press again, or rotating with time.deltatime and an angle that you save.