A listener to listen for changes in each frame of the animation

I only found an api that listens for specific frames.

    let event = new BABYLON.AnimationEvent(
        40,
        function () {
            //
        },
        true
    );
    animation.addEvent(event);

Is there a function to listen to every frame?
thanks

There’s onAfterAnimationsObservable on the scene that runs after processing all the animations in a frame. Does that work for you?

1 Like

scene.afterRender =()=>{}
scene.registerAfterRender(func: (() => void))
scent.onAfterRenderCameraObservable.add(()=>{})

That’s one way to solve the problem