I want to create a replay system, but instead of saving the player’s position, I want to record the player’s input (keyboard and mouse) so I can later convert it into movement on a rig.
Your approach is going to be a lot more challenging since you’ll also need to account for character model rotation and camera position/orientation at every frame, as they affect how movement inputs move the character model.
no
all i can say is that choosing to record input over position is way less reliable because the final product will be slightly different from the original one because of the physics being quite random (also player lag can interrupt it)
It’s not impossible, but it will be unreliable and not worth it in the long run.
The reason people are saying it’ll “drift” is because in Roblox, movement isn’t determinable. Physics, camera rotation, and framerate will slightly change the result each time and that will accumulate over time and it won’t match perfectly later.
If your goal is a rig that acts like the player did then Instead of saving key and mouse presses, it’s better to record the results of the movement (position + rotation) and play those back on the rig.
- Record the character’s position (HumanoidRootPart CFrame)
- Record rotation
- Record camera CFrame (if you want the same view)
- Optionally record animations or velocities
If you want to store the animations as well, I’d recommend storing the animation track ID, the time position of the animation, and the playback speed. Then during gameplay you can load the animation onto a rig, set its TimePosition and play it at the recorded speed.
Now usually you don’t actually need to record animation data because Roblox’s default humanoid animations are state-based. When you move the rig through the same position, the Animate script should trigger the same animations automatically. This wont work for custom emotes, attacks, or any custom animations.
Just to be clear, I am basing all of this on how Roblox handles movement/animation and how replay systems are typically built. You’d still need to experiment and adjust for your specific game.