title: aframe - changing camera position dynamically
body: <p>I am new to aframe and trying to change the camera position dynamically based on user interaction in the scene to go closer to object and come back to previous position.</p>
  
  <p>But somehow this is not working in VR mode. In desktop browser, the camera is changing the position as desired.</p>
  
  <p><strong>HTML:</strong></p>
  
  <pre><code>&lt;a-entity id='cameraWrappers1' position="0 0 0" rotation="0 90 0"&gt;
              &lt;a-camera position="0.001 1.85 -0.52" id="cameraPositions1"&gt;
                      &lt;a-cursor id="cam2cursor" color="#f000f0" material="" raycaster="" cursor="" geometry="" position="-0.007 -0.04 -2.05" scale="3 3 3"&gt;&lt;/a-cursor&gt;
              &lt;/a-camera&gt;
          &lt;/a-entity&gt;
  </code></pre>
  
  <p><strong>Script:</strong></p>
  
  <pre><code>var m1HotSpot = document.querySelector("#cameraPositions1");
                      var position = m1HotSpot.getAttribute("position");
                      console.log("position:::::" + position.z)
                      //document.querySelector("#m-1").setAttribute('scale', '1 1; 1');
                      if(position.z == -0.52){
  
                          m1HotSpot.setAttribute("position",'0.001 1.85 -2.35');
  
                      }
                      else if(position.z == -2.35){
  
                          m1HotSpot.setAttribute("position",'0.001 1.85 -0.52');
                    }
  
  
      }
  </code></pre>
  
  <p>I have tried the solution</p>
  
  <ol>
  <li><p>disabled the orbit control, change the position and then enable the orbit control</p></li>
  <li><p>Putting up a camera wrapper and try to change the position of the wrapper still not working in VR</p></li>
  </ol>
  
  <p>I am using latest aframe version. Kindly let me know if you have any idea on how to achieve this.</p>
  
  <p>I have put a demo in below pen. When you click on sphere you will be transform close to sphere and again clicking on it will come back at original place. This is working in browser of desktop but not in pixel chrome browser in VR mode.
  Kindly help.
  <a href="https://codepen.io/anon/pen/zaMZEV" rel="nofollow noreferrer">DEMO replica</a></p>
  
  <p>Thanks,
  Akki</p>