Create a "Replay" system to let the player see what they did

How can I create a “Replay” system, where if the player is close to the goal, then it starts recording, and then if they score it’ll play the video? All the tutorials I found are for preset cutscenes that can’t record in the past… I know how to get if the player is close to the goal, but how do I start recording, and play that recording? The playback should be in-game, like a cutscene.

This might help?