Aframe move vr-camera-component

Multi tool use
Multi tool use


Aframe move vr-camera-component



I move my camera when i trigger an event and it works perfectly on pc but not when im on my phone in the vr-mode. Need to fix this here some code:


<a-entity id="camentity" rotation="0 90 0">
<a-camera id="cam" user-height="0" wasd-controls-enabled="false" look-controls>
<a-animation attribute="position" begin="movecam_1" duration="500" from="0 0 0" to="-40 0 -50"></a-animation>
<a-animation attribute="position" begin="movecam_1_bc" duration="500" from="-40 0 -50" to="0 0 0"></a-animation>
</a-camera>
</a-entity>

function kameramove_1() {
document.querySelector( "#cam" ).emit('movecam_1');
}

function kameramove_1_back() {
document.querySelector( "#cam" ).emit('movecam_1_bc');
}




1 Answer
1



Animate the camera rig (parent of the camera, camentity in your case) not the camera itself:


<a-entity id="camentity" rotation="0 90 0">
<a-animation attribute="position" begin="movecam_1" duration="500" from="0 0 0" to="-40 0 -50"></a-animation>
<a-animation attribute="position" begin="movecam_1_bc" duration="500" from="-40 0 -50" to="0 0 0"></a-animation>
<a-camera id="cam"></a-camera>
</a-entity>





works great thx a lot :)
– Delidragon
Jul 3 at 8:25






By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

nlsWHx6N9EB7 dzIMAQICc8LEpZBmW1H AdkmuKY4KPmyTkFx0Y9ID0hhehQ jvQ J2iYvgA7 9oUkZxWBCh1k,EiQ82 Ce
91JN,hhwWBS1fJ

Popular posts from this blog

PHP contact form sending but not receiving emails

Do graphics cards have individual ID by which single devices can be distinguished?

Create weekly swift ios local notifications