aframe-react icon indicating copy to clipboard operation
aframe-react copied to clipboard

a-animation primitive does not seem to work

Open joshmarinacci opened this issue 8 years ago • 1 comments

I have created a ring and I want to make the outer radius get bigger over time. I'm using an entity inside the ring to do this. However the animation isn't being run. I am using primitive='a-animation' then setting the standard properties.

After some debugging I can see that an underlying a-animation element is being created, but the attribute property is set to 'rotation', not 'radius-outer'. However, I can't figure out why this is happening.

                 <Entity 
                         geometry={{primitive:'ring', radiusInner:0.5, radiusOuter:2}}
                         material={{color:'teal', opacity:1}}
                 >
                     <Entity primitive='a-animation'
                             attribute='radius-outer'
                             begin='tapped'
                             dur='1000'
                             from='2'
                             to='10'
                     />

joshmarinacci avatar Jul 24 '17 15:07 joshmarinacci

a-animation isn't a primitive. I'd recommend following the example from Kevin's boilerplate and use the import 'aframe-animation-component';. There's a chance a-animation will be removed from A-Frame because it's an outlier in the API, so this is a generally future proof approach as well.

cwervo avatar Sep 18 '17 09:09 cwervo