# How to play animations forward and backward using mode LoopPingPong starting from last executed step?

**URL:** <https://discourse.threejs.org/t/how-to-play-animations-forward-and-backward-using-mode-looppingpong-starting-from-last-executed-step/42312>\
**Category:** Questions\
**Tags:** animation\
**Created:** [September 7, 2022, 12:04pm UTC](https://discourse.threejs.org/t/how-to-play-animations-forward-and-backward-using-mode-looppingpong-starting-from-last-executed-step/42312 "2022-09-07T12:04:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![TKey99](https://avatars.discourse-cdn.com/v4/letter/t/73ab20/32.png) [@TKey99](https://discourse.threejs.org/u/TKey99)\
**Post date:** [September 7, 2022, 12:04pm UTC](https://discourse.threejs.org/t/how-to-play-animations-forward-and-backward-using-mode-looppingpong-starting-from-last-executed-step/42312/1 "2022-09-07T12:04:35Z")

</div>

I have prepared a fiddle to showcase my problem and also added a TODO in line 81, where i think some more implementations are necessary to resolve my issue: [three.js dev template - module - JSFiddle - Code Playground](https://jsfiddle.net/x4zrq9so/5/)

I am trying to play an animation forward and backward with mode LoopPingPong starting from its current step. For example, if I set the number of repetitions to 3 (with the input field on top) and press the button “PingPong”, I expect the cube to move right → left → right and stop there (for some reason the cube is flickering right before it stops!?). As soon as I click “PingPong” again, I want the cube to start here (end of last loop), move left → right → left and stop. On the next click the cube should move right → left → right again and so on… As a cherry on top, I would like to be able to click “PingPong” in the middle of the animation to “rewind” the current running loop.

I would appreciate any help. Thanks in advance.
