gabor aron
gabor aron

Reputation: 410

A-frame animation position

I want to make an animation for a box, which makes the box is coming closer and closer to the user. I tried this, but this doesn't worked for me:

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

Upvotes: 1

Views: 1563

Answers (1)

ngokevin
ngokevin

Reputation: 13233

attribute was misspelled.

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

And you need to animate the box, not the box's parent. The code you have is animating enemy from 0 0 0 to 0 0 0.

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

Upvotes: 1

Related Questions