Play animation in a object's relative/local context

Hello i made simple small animations in Blender and exports actions in a JSON file. With the ObjectLoader i imported animations and use them with THREE.AnimationMixer() + .clipAction(animation).

My goal is to make addition of this animations for making the object going to a specified place. For exemple, like on a chess board if my piece is on case A1 and i play this animations -> [ “+1 front (B1)”, “+1 right(B2)”, “+1 front(C2)”, “+1 right(C3)”" +1 right(C4)" ], …i must finish my way to the C4 position, do you follow me ? :wink:

The problem i meet is i’m never going beyond B1 and A2, when i play one animation for going +1 to front (for exemple), even if i use the (action.clampWhenFinished = true;) property for keeping the state of the last animation’s frame, the next animation will start at the initial object position A1 (not the last frame position…). So I thought about a solution that consists of assign temporarily an empty Object3D as parent of the animated object and set the position of that Empty at the last frame, for starting relatively by the EmptyObject… it almost good… but there is weird behavior, not follow the quaternion orientation correctly…

So, is there someone who can tell me a simple trick for accumulate animations and keep position/orientation of the animated object at its last position ?

Thank you very much for your help :wink: ! :blush: