2016-11-15 72 views
0

我想爲一個盒子製作一個動畫,這使得盒子越來越接近用戶。我試過了,但這對我不起作用:A幀動畫位置

<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> 

回答

0

attribute拼錯了。

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

而且您需要爲框設置動畫,而不是框的父級。你的代碼是從動畫0 0 0敵人0 0 0

<a-entity> 
    <a-box><a-animation/></a-box> 
</a-entity> 
+0

但這也沒有工作,該框不動 –

+0

更新了答案 – ngokevin

+0

我可以控制這個動畫的速度? –