ivarmartin
ivarmartin

Reputation: 11

Aframe-animation-component direction: alternate bug

I'm using the following code, but can't get the animations to work with direction: alternate. The animations refuse to alternate but always start from their initial value.

<a-entity 
gltf-model="models/u323/u323-2k1024.gltf"  
position="-0.4 1.7 -1.7" 
rotation="-2.7 0 0" 
scale="1.2 1.2 1.2" 

animation__position="property: position;
dir: alternate;
startEvents: click; 
from: -0.4 1.7 -1.7;
to: -0.47272469351429525 2.3 -2;
dur: 2000"

animation__light="property: light.intensity;
dir: alternate;
startEvents: click; 
from: 0;
to: 5;
dur: 2000"

>

Upvotes: 1

Views: 604

Answers (1)

Piotr Adam Milewski
Piotr Adam Milewski

Reputation: 14645

try adding loop: 2, the second animation should be in the alternate direction:

animation__position="property: position;
dir: alternate;
startEvents: click; 
from: -0.4 1.7 -1.7;
to: -0.47272469351429525 2.3 -2;
dur: 2000"
loop: 2

Upvotes: 4

Related Questions