Gear VR moving like Horizontal and Vertical axis with Touchpad on HMD problem

Tell me please, very much I puzzle my head. How to tie the player’s control in the same way like the “horizontal” and “vertical” axis to the panel on the Gear VR Headset? It is necessary for the player to move while the user holds his finger on the panel and does not release it in any directions.

if (OVRInput.Get(OVRInput.Touch.PrimaryTouchpad)) // finger on HMD pad?
        {
            // not using controller, same behavior as before.
            Vector2 touchPosition = OVRInput.Get(OVRInput.Axis2D.PrimaryTouchpad);
            Tex[0].text = touchPosition.ToString();
        }

And i need converting 2D Vector of Dpad to Horizontal and Vertical directions like (1,-1)

Vector3 directionVector;
directionVector = new Vector3(Input.GetAxis(“Horizontal” < touchPosition.x ???), 0, Input.GetAxis(“Vertical” < touchPosition.y ???));

Tex[0] has zero digits(
Nothing reactions doesn’t work. Help please.

The headsets touchpad (unlike the controllers touchpad) is swipe based. This means you can’t just touch in an area it will always report 0,0 if you do. You have to touch and swipe in a direction for those values to change. However if you do swipe it generally seems to be in about a 0 - .6 range depending on where you started your swipe from.

May be can you tell me please why this code works with touchpad? It’s really works but so strange…

public class OWInputManager : MonoBehaviour
{
    public static Vector3 DirectionVector;
    public static Vector3 Delta;
    public static Vector3 TapPoint;
    public float swipeSensivity = 54f;
    public GameObject directionGO;
    private Transform _cameraTransform;
    bool _mouseDown;
    Vector3 _mousePosition;


    void Start()
    {
        if(!directionGO)
            directionGO = new GameObject();
        _cameraTransform = Camera.main.transform;
    }

    void Update()
    {
        directionGO.transform.eulerAngles = new Vector3(0,_cameraTransform.transform.eulerAngles.y,0);
        DirectionVector = Vector3.zero;
        if (Input.GetButtonDown("Fire1"))
        {
            _mouseDown = true;
            _mousePosition = Input.mousePosition;
            TapPoint = _mousePosition;
        }
        if (Input.GetButtonUp("Fire1"))
        {
            _mouseDown = false;
            transform.GetComponent<Controller>().vecV = 0;
            transform.GetComponent<Controller>().vecH = 0;
            Delta = Vector3.zero;
        }

        if (_mouseDown)
        {
            Vector3 curMousePosition = Input.mousePosition;
            Vector3 deltaMousePosition = curMousePosition - _mousePosition;
            Delta = deltaMousePosition;

            float x = deltaMousePosition.x;
            float y = deltaMousePosition.y;

            float moduleX = Math.Abs(x);
            float moduleY = Math.Abs(y);

            float radius = (float)Math.Sqrt(x * x + y * y);

            if(radius>=swipeSensivity)
            {
                if (y > moduleX)
                    transform.GetComponent<Controller>().vecV += moduleX / 30;
                    DirectionVector = directionGO.transform.forward;// right
                if (moduleY < x)
                    transform.GetComponent<Controller>().vecH += moduleY / 30;
                DirectionVector = -directionGO.transform.right;// up
                if (y < -moduleX)
                    transform.GetComponent<Controller>().vecV -= moduleX / 30;
                DirectionVector = -directionGO.transform.forward;// left
                if (-moduleY > x)
                    transform.GetComponent<Controller>().vecH -= moduleY / 30;
                DirectionVector = directionGO.transform.right;// down
            }
        }
    }
}
if(radius>=swipeSensivity)
            {
                if (y > moduleX)
                    transform.GetComponent<Controller>().vecV += moduleX / 30;
                    DirectionVector = directionGO.transform.forward;// right
                if (moduleY < x)
                    transform.GetComponent<Controller>().vecH += moduleY / 30;
                DirectionVector = -directionGO.transform.right;// up
                if (y < -moduleX)
                    transform.GetComponent<Controller>().vecV -= moduleX / 30;
                DirectionVector = -directionGO.transform.forward;// left
                if (-moduleY > x)
                    transform.GetComponent<Controller>().vecH -= moduleY / 30;
                DirectionVector = directionGO.transform.right;// down
            }

It is in this part of the code, when I hold my finger and drive in different directions on the touchpad, the character moves very quickly, then very slowly, the impression is that you have somewhere to limit the maximum speed, but I do not know where.
vecV and vecH it’s a Vertical and Horizontal movement vectors.

You didn’t post a full snippet of your original code but the concepts of either example can be the same regardless of whether you are using Input.mouse or OVR.Get. The HMD pad sends out either events (unlike the controller) so it will essentially be the same where on intial touch it’s 0,0 but then will have values as you swipe up until you release.

In general just set a breakpoint and debug why it isn’t working in your first example. If you are looking for an HMD only game then it doesn’t matter and you can certainly use the second scripts. Limiting maxiumum speed is simply setting a maximum magnitude on the vector in whichever makes sense for your game.

I tried to do so, but still no result, the touch is ignored.

public class FPSInputControllerC : MonoBehaviour
{
    private CharacterMotorC cmotor;
    public bool jumpKey = false;
    private Vector2 primaryAxis;
    public Text[] Tex;
    // Use this for initialization
    void Awake()
    {
        cmotor = GetComponent<CharacterMotorC>();
    }

    // Update is called once per frame
    void Update()
    {
        if (OVRInput.GetActiveController() == OVRInput.Controller.Touchpad)
            Tex[2].text = "Touchpad is true";
        else
            Tex[2].text = "false";

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

        Tex[0].text = "Horizontal: " + (primaryAxis.x).ToString(); // 0
value  
        Tex[1].text = "Vertical: " + (primaryAxis.y).ToString();  // 0 value   
        Tex[3].text = OVRInput.Get(OVRInput.Button.Two).ToString(); //nothing
        Tex[4].text = OVRInput.GetDown(OVRInput.Button.One).ToString(); //nothing

        // Get the input vector from keyboard or analog stick
        Vector3 directionVector;
        directionVector = new Vector3(Input.GetAxis("Horizontal"), 0, Input.GetAxis("Vertical"));
        if (directionVector != Vector3.zero)
        {
            // Get the length of the directon vector and then normalize it
            // Dividing by the length is cheaper than normalizing when we already have the length anyway
            float directionLength = directionVector.magnitude;
            directionVector = directionVector / directionLength;

            // Make sure the length is no bigger than 1
            directionLength = Mathf.Min(1, directionLength);

            // Make the input vector more sensitive towards the extremes and less sensitive in the middle
            // This makes it easier to control slow speeds when using analog sticks
            directionLength = directionLength * directionLength;

            // Multiply the normalized direction vector by the modified length
            directionVector = directionVector * directionLength;
        }

        // Apply the direction to the CharacterMotor
        cmotor.inputMoveDirection = transform.rotation * directionVector;
        cmotor.inputJump = jumpKey || Input.GetButton("Jump");
        jumpKey = false;
    }

}

In your asset “Easy Input For Gear VR”, implemented such control via the touchpad?

At what stage in that script is ignored when debugging? Does primary axis ever have a non zero value when you debug. It should let you know at what stage it’s failing.

I’m adding stuff all the time to my asset but under this category there are currently two controls. One is a dpad where the movement speed would increased based on the values meaning the further you swipe the faster you go. The other is a touchpad where the deltas frame to frame is all that matters (basically only moving when your finger is swiping). Either control can be set to control position, rotation, etc. in the inspector. I will say that most of the product currently centers around the new motion controller, so if you are using HMD only I wouldn’t say it’s worth the price, even though those controls do work with the HMD touchpad.

I need just these dpad values

The primary axis always shows 0.0 when I touch nothing.
When i touching, the debugging is silent, the values do not change.

simply touch like mouse button doesn’t work((((

if (OVRInput.GetDown(OVRInput.Button.One))
        {
            Tex[0].text = "true: ";
        } else
            Tex[0].text = "false "; //always false

For touching the pad I usually use.

OVRInput.Get(OVRInput.Touch.PrimaryTouchpad)

For the coordinates I usually use the same as your using.

What version of the Oculus Utilities are you using and you do have OVRManager somewhere in your scene correct? Also, you do have virtual reality supported checked, build target to android, and Oculus at the top of the Virtual Reality SDKs and are testing on device, correct?

Oculus Platform and Utilities imported with last version.
VR support checked true
Work in VR mode on Galaxy S7 perfectly
But i don’t know where i need attach OVRManager? I’m using non standard oculus FPSController.

In your screenshot OVRManager is already in the scene so that’s not it. In general, that’s all I’ve ever had to do in any of my examples so not sure where things are going wrong for you. Given the fact that you aren’t even getting values no matter what you do, I would think that it’s more likely to be a setup issue than with the code in your script itself, the mouse code you posted previously doesn’t use the Oculus SDK so wouldn’t need the same setup items. If you look in logcat when running on device do you see any errors? The only thing you didn’t specifically mention is Oculus being in the list for Virtual Reality SDKs and providing your signature file but I presume you did those.