【问题标题】:A-frame animation positionA帧动画位置
【发布时间】:2016-11-16 03:31:40
【问题描述】:

我想为一个盒子制作动画,让盒子离用户越来越近。我试过了,但这对我不起作用:

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

【问题讨论】:

    标签: aframe


    【解决方案1】:

    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>
    

    【讨论】:

    • 但这也不起作用,盒子不动
    • 更新了答案
    • 我可以控制这个动画的速度吗?
    • @gaboraron,是的,使用动画的“dur”属性。这里的 aframe 文档有一个示例:aframe.io/docs/1.2.0/components/animation.html
    猜你喜欢
    • 2016-12-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-10-06
    • 2021-07-20
    • 2021-07-22
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多