title: Unity VR Player camera not moving when running in real device
body: <p>I am a beginner in Unity and following Udemy tutorials for learning VR using Unity and making a game named <strong>Ninja Slash</strong>. Everything seems to be working fine in the <strong>Unity Editor Play mode</strong> but when I run my app in a <strong>real device</strong>, <strong>my player doesn't move at all</strong>. I can't figure out what is the problem here.</p>
  
  <p>Here is my Player script.</p>
  
  <pre><code>public class Player : MonoBehaviour {
  
  public GameObject sword;
  public float speed = 4.5f;
  public float walkingAmplitude = 0.25f;
  public float walkingFrequency = 2.0f;
  public float swordRange = 1.75f;
  public float swordCooldown = 0.25f;
  
  public bool isDead = false;
  public bool hasCrossedFinishLine = false;
  
  private float cooldownTimer;
  private Vector3 swordTargetPosition;
  
  // Use this for initialization
  void Start () {
      swordTargetPosition = sword.transform.localPosition;
  }
  
  // Update is called once per frame
  void Update () {
      if (isDead) {
          return;
      }
  
      transform.position += Vector3.forward * speed * Time.deltaTime;
      transform.position = new Vector3(
          transform.position.x,
          1.7f + Mathf.Cos(transform.position.z * walkingFrequency) * walkingAmplitude,
          transform.position.z
      );
  
      cooldownTimer -= Time.deltaTime;
  
      if (GvrViewer.Instance.Triggered ) {
          RaycastHit hit;
  
          if (cooldownTimer &lt;= 0f &amp;&amp; Physics.Raycast(transform.position, transform.forward, out hit)) {
              cooldownTimer = swordCooldown;
  
              if (hit.transform.GetComponent&lt;Enemy&gt; () != null &amp;&amp; hit.transform.position.z - this.transform.position.z &lt; swordRange) {
                  Destroy (hit.transform.gameObject);
                  swordTargetPosition = new Vector3 (-swordTargetPosition.x, swordTargetPosition.y, swordTargetPosition.z);
              }
          }
      }
  
      sword.transform.localPosition = Vector3.Lerp (sword.transform.localPosition, swordTargetPosition, Time.deltaTime * 15f);
  }
  
  void OnTriggerEnter (Collider collider) {
      if (collider.GetComponent&lt;Enemy&gt; () != null) {
          isDead = true;
      } else if (collider.tag == "FinishLine") {
          hasCrossedFinishLine = true;
      }
  }}
  </code></pre>
  
  <p>Here is the screenshot for hierarchy view.</p>
  
  <p><a href="https://i.stack.imgur.com/1ANxa.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/1ANxa.png" alt="enter image description here"></a></p>
  
  <p>I tried with different version gvr sdk unity package but I am getting same result everytime and I also tried running it different devices like htc,samsung etc.</p>