动画不重新启动一帧 0.9.2 的事件

Animation not restarting on event for a-frame 0.9.2

美好的一天!

我完全是 a-frame 的菜鸟,我试图在每次事件发生时实现简单的动画重播。

我注意到在带有动画组件的 v0.8.2 上,它使用相同的代码和动画重新启动,但在新的 v0.9.2 上不会发生这种行为。

<!--This works as i want!--> <script src="https://aframe.io/releases/0.8.2/aframe.min.js"></script><script src="https://unpkg.com/aframe-animation-component@^4.1.2/dist/aframe-animation-component.min.js"></script<a-scene cursor="rayOrigin:mouse"><a-box position="0 2 -2" color="blue" radius="1" foo animation="property: scale; to: 2 2 2; dur: 200; startEvents: mousedown;"></a-box></a-scene>

As you can see in the animation this only works once :(

根据要求编辑:这是故障项目:https://glitch.com/edit/#!/join/4aaf9ff9-4dd6-4780-bf1f-f75648f2149f

有什么见解吗?

提前致谢!

尝试了各种版本,甚至摆弄了 .emit js 组件,但行为在 v0.9.2 中仍然相同。动画不会重播。

我希望每次发生事件时都重播相同的动画,而不使用循环和暂停控件。

您好像少了一个“>” 在此行的末尾:

'src="https://unpkg.com/aframe-animation-component@^4.1.2/dist/aframe-animation-component.min.js" /script '

这可能会破坏脚本中的功能。 很难知道,因为您已经将所有代码都塞进了上面的一行。 如果您将项目代码放在故障或 fiddle 中,我们调试起来会容易得多。 (glitch.com)