How to pause an animation with a pause button

Here I am trying to start an animation with “Play” button and pause it anywhere with “Pause” button and restart it from there. If I use “scene.stopAnimation(mesh)”, the animation don’t play. Need help in this!!!

Thank you,
You can see line 137 and line 165

here is doc

Thank you!! :smiley: