A帧动画位置

时间:2016-11-15 12:12:07

标签: aframe

我想为一个盒子制作动画,这使得盒子越来越接近用户。我尝试过这个,但这对我不起作用:

<a-entity id="enemy">
 <a-box material="src: #texture_4" width="0" height="15" depth="4" transparent="true" opacity="0.75" position="0 0 -150" rotation="0 100 0" scale="2 0.5 3"></a-box>
 <a-animation atribute="position" to="0 0 0" fill="forwards"></a-animation>
</a-entity>

1 个答案:

答案 0 :(得分:0)

<script> function foo() { var contact_name1 = document.getElementById( "contact_name_id" ).value; var contact_email1 = document.getElementById( "contact_email_id" ).value; var contact_phone1 = document.getElementById( "contact_phone_id" ).value; var contact_company_name1 = document.getElementById( "contact_company_name_id" ).value; var contact_subject1 = document.getElementById( "contact_subject_id" ).value; var contact_message1 = document.getElementById( "contact_message_id" ).value; $.ajax({ type: 'post', url: 'Contact_Us.php', data: { contact_name:contact_name1, contact_email:contact_email1, contact_phone:contact_phone1, contact_company_name:contact_company_name1, contact_subject:contact_subject1, contact_message:contact_message1 }, success: function (response) { document.getElementById( "response_result" ).innerHTML = response; } }); } </script> 拼写错误。

attribute

你需要为盒子设置动画,而不是盒子的父母。您拥有的代码是将敌人从0 0 0设置为0 0 0。

<a-animation attribute="position" to="0 0 0" fill="forwards"></a-animation>