How can I record and play back the movement in ARkit?

How do I record and play back movements with ARkit?


As you can see in the video below.

https://www.youtube.com/watch?v=7NnSuAprFnY


I thought about using ReplayKit, but ReplayKit records the entire screen, so you can't just record the character's movements.


I know that I can do motion capture with the code below.

I would appreciate it if you could tell me how I can change this code to record and play it.

https://developer.apple.com/documentation/arkit/capturing_body_motion_in_3d

How can I record and play back the movement in ARkit?
 
 
Q