This repository contains useful tools that might come in handy and I will keep updating it with new methods and functions.
You can use this to record the position and rotation of a transform and replay it. https://github.com/developers-hub-org/unity-tools/tree/main/Assets/DevelopersHub/Tools/TransformRecorder