AnimationMixer finished event fires prematurely
See original GitHub issueDescription of the problem
As far as I understand it, the finished event on AnimationMixer should only fire when an action has finished.
In practice, it seems to often fire just before I’d expect.
For a 1000ms clip, at the point in time the finished fires, action.time will often be 983.4ms. This looks a lot like a single frame gap (ie 16.6ms) from the end. In addition, the property being manipulated will be just short (say, by 16.6 / 1000) of the lerp to the terminal value in a track associated with the clip.
Is this intended behavior? If so, can an event be added that only fires when the action is truly finished? If not, is this a matter of moving the location of the logic that fires the event to be a bit later in its code path?
Three.js version
- Dev
- r81
- …
Browser
- All of them
- Chrome
- Firefox
- Internet Explorer
OS
- All of them
- Windows
- Linux
- Android
- IOS
Issue Analytics
- State:
- Created 7 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
How to fire an Aframe animation-mixer event using Javascript ...
1 Answer 1 · I am facing two problems: 1). The part of code in animation-finished event is not firing and 2). Is...
Read more >Animation: finish event - Web APIs | MDN
The finish event of the Animation interface is fired when the animation finishes playing, either when the animation completes naturally, ...
Read more >Three.js Making a Game
I ended up writing quite a but of code to make this simple unfinished game like ... To play the animations each model...
Read more >AnimationMixer – three.js docs
The AnimationMixer is a player for animations on a particular object in the scene. ... This is usually done in the render loop,...
Read more >AdCube: WebVR Ad Fraud and Practical Confinement of Third ...
ports a fusing event that fires when a user locates the cursor on a targeted entity. ... played a game for five minutes,...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

@takahirox I wound find that much more intuitive.
Still haven’t had a chance to put together a jsfiddle showing the not-yet-final-value issue I mentioned originally, but I’ll try do that this week.
BTW, I think ‘finished’ and ‘loop’ should be fired after accumulation here.
https://github.com/mrdoob/three.js/blob/fcd6fd23b6612db1579c7d907fa0ec31156082a5/src/animation/AnimationAction.js#L377