question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Animation Only Works On Initial Event, Breaks On Subsequent Events

See original GitHub issue

Here’s my component

<a-entity class="player-button" id="back-button"
  geometry="primitive: plane; height: 1; width: 1"
  position="0 0 0"
  material="shader: flat; src: #back; transparent: true;"
  animation__enter="property: scale; easing: linear; dir: forward; dur: 100; to: 1.2 1.2 1.2; startEvents: mouseenter;"
  animation__leave="property: scale; easing: linear; dir: forward; dur: 100; to: 1 1 1; startEvents: mouseleave;">
</a-entity>

animation__enter happens once and then never happens on subsequent mouseenter events. What’s weird is that it does actually change the scale it just ceases to animate the change (pops into place).

Further more, after executing animation__enter, animation__leave never works. Once again, the values change on the event, but there’s no animation.

It’s very hard to see in this video http://recordit.co/qa9op6AeIc but what happens is that the initial enter animation works but then on mouseleave it breaks. Then I hover over the pause button and the same thing happens, enter works but all else fails from then on in – meaning each component gets one chance to animate. Very weird.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:3
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

4reactions
wazynskicommented, May 23, 2017

I am having a similar issuse with these animations:

animation__fadeout={{
     property: 'material.color',
     dur: '1000',
     from: '#FFF',
     to: '#000',
     startEvents: 'set-image-fade-out',
}}

animation__fadein={{
     property: 'material.color',
     dur: '1000',
     from: '#000',
     to: '#FFF',
     startEvents: 'set-image-fade-in',
}}

The first time either of the startEvents are called the animation works perfectly. On subsequent calls the material colour changes but there is no tranisitions, like the duration has been set to 0.

0reactions
c4augustuscommented, Jul 22, 2017

Yes, I needed this fix as well, so I forked the original repo and merged the fix into my master. Thanks for it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Animation event not triggering - Unity Forum
Currently in my game a lot of events are triggered from within an animation and occasionally they seem to be skipped over.
Read more >
Animations don't occur when the same animation is requested ...
Animations only either autoplay or are triggered by events. You can add an event to startEvents and emit it on the entity when...
Read more >
Highcharts pie chart slice animation only works when an error ...
After playing with the code I found out that if I have a window resize event handler with jQuery that throws any error...
Read more >
Using CSS animations - CSS: Cascading Style Sheets | MDN
Specifies whether an animation's first iteration should be forward or backward and whether subsequent iterations should alternate direction ...
Read more >
An Interactive Guide to CSS Transitions - Josh W Comeau
It's the first animation tool that most front-end devs learn, ... transition can take a number of values, but only two are required:....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found