Hello,
I’m importing a baked animation, and I’m using it as animationGroups[0]. https://playground.babylonjs.com/#IQPBS4#3
I should do some stuff when the animation is, for example, at 50% of the lenght.
How can I know the actual time of an animation that is playing?
I’ve looked in the docs of the " AnimationGroup" Class
but I can’t see any property of method for it.
Many thanks!
IDK if there’s a better or easier way, but you can for example drill down to one of the RuntimeAnimation objects and see what frame it’s at, then divide by the number of frames to get a progress value.
Note, this is based on the assumption that all animations in the group are normalized to have the same number of frames and that they start at frame 0. This is already true in this case for the your PG, but animationGroup.normalize could be used if it wasn’t.
I think each Animation can be added with an animations observable. If there are many animations, it will be very troublesome to use scene’s onafteranimations observable.
What’s your opinion?
I want to use the onAnimationProgressObservable as @brightMoon mentioned before. I thought Its a property of an Animation but its a property of an animatable, so I need an animatable from the animationgroup
Meaningful. For example, if there are 10 frames of animation, I need the return value of each frame of animation, and then perform business logic operations