GearVR Touchpad help

hello,
i’m new to unity and i’m trying to use Touchpad in C# script to make simple movement either by swipes or single taps. Can anyone help with a basic script for this purpse?
Thankyou in advance

The touch panel of the Samsung works as the mouse of unity, and the tap functions as the click (INPUT) of unity

using UnityEngine;
using System.Collections;
using UnityEngine.UI;

public class RayCast2 : MonoBehaviour
{
    public Ray ray;
    RaycastHit hitInfo;
   

    void Start()
    {

    }

   
    void Update()
    {
        if (Input.GetButtonDown ("Fire1"))
        {
            Code/code/Accion
        }

        if (Input.GetKey (KeyCode.Escape))
        {
            //button functions as the Samsung Gear VR
        }
        ray = new Ray(transform.position, transform.forward);
        Debug.DrawRay (ray.origin, ray.direction*10, Color.blue);
        if(Physics.Raycast(ray, out hitInfo))
        {
            if(hitInfo.transform.CompareTag("sometag"))
            {
                //Object-tag
                if(Input.GetButtonDown("Fire1"))
                {
                    code
                }
            }
        }
    }
}

Actually i tried this method but i couldn’t make the transform.translate() to make movement according to the swipes. Can you help with that?

I do not understand your question friend.

if (Input.GetButtonDown (“Fire1”))
{
Code/code/Accion
}

lets say i want my character to move to the point where the pointer was tapped on touchpad. how do i accomplish that?

Hello, there are many ways to do this, one is launching a raycasts and when you give click to touch samsung, this will keep the position where coliciono lightning.
the easiest way is transforming the position of the object you want to move to the mouse position, that the following code is done as samples-.

using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour {
    public GameObject particle;
    void Update() {
        if (Input.GetButtonDown("Fire1")) {
            Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
            if (Physics.Raycast(ray))
                Instantiate(particle, transform.position, transform.rotation);
        }
    }
}
using UnityEngine;
using System.Collections;

public class Example : MonoBehaviour
{
    public GameObject SomeObject;
    public Ray ray;

    void Update()
    {
        Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
        Debug.DrawRay (ray.origin, ray.direction*100, Color.blue);
        if (Input.GetButtonDown("Fire1"))
        {
            if(Physics.Raycast(ray))
                Instantiate(SomeObject, ray.direction, transform.rotation);
        }
    }
}

You can print the raycast outside the input so you can see on the screen.

thank you so much. i will try this

it says “object reference not set to the instance of an object”

My Mobile VR movement pack has this example:
https://www.assetstore.unity3d.com/en/#!/content/69041

I also have a lot of VR movement tutorials on my channel:

https://www.youtube.com/watch?v=JmgOeQ3Gric