Varsha Kamble Posted May 24, 2018 Share Posted May 24, 2018 Hi , I want to show some progress bar while playing the animations. I am using following code to play all animations within given min-max values Quote for (let i = 0; i < this._scene.meshes.length; i++) { var animationPlayed = this._scene.beginAnimation(this._scene.meshes, 10, 500, false, 1.0, () => { console.log('Animation loop'); }); console.log('currentFreame',animationPlayed.getAnimations()[0].currentFrame) } I want to get currently playing animation frame, so that i can assign it to my progress bar. In above codebase, Log printed to get currentFrame is always returning me 0. Please help for the same. Thanks. Regards, Varsha Quote Link to comment Share on other sites More sharing options...
Guest Posted May 24, 2018 Share Posted May 24, 2018 Hello and welcome beginAnimation callback is called onAnimationEnd: http://doc.babylonjs.com/api/classes/babylon.scene#beginanimation If you want progress, you have to check it on a timeout based way: https://www.babylonjs-playground.com/#4VNNY1 Varsha Kamble 1 Quote Link to comment Share on other sites More sharing options...
Varsha Kamble Posted May 25, 2018 Author Share Posted May 25, 2018 Hi Deltakosh, Thanks for the quick reply. It worked perfectly. Thanks Regards, Varsha Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.