I there a way to record player input and play it back once the game has stopped?

I understand that this is a very awkwardly phrased question but what i am trying to ask is if there is a way to record what i input into the game ( such as if i press play and press jump) that I can unplay and make a gameObject do that action or, possible more, actions.
I will try to explain more if I am not clear

I dont fully understand what your trying to do, why you would want to track if a person jumped in your example, but if you simply mean to just have a way to store data on the user, like a “save game” almost, you could look into something called PlayerPrefs. There actually pretty simple to use.

This information is kept after the game ends, if you dont delete the Key afterwards. I have no idea where its saving this information to, but its kept with the game after you finish playing your game.

Usage Example:


int jumps = 0;

//if the user presses the spacebar key




//After the use presses the spacebar key, show them their stored jump count



You can also save the the list of the actions in the list (or something) which player has performed. Then call that event manually …

Like player has input Right turn > Jump > Left turn > Slide and then he dies.

Suppose, you want to show the replay or you want to show the bot ( dummy player to demonstrate what the heck you have done) .

Now the events you have tracked ( lets say in ‘PlayerTrackerList’ ) , call manually each event with the exact time interval to demonstrate the same actions that user has done …

*Note :- This is theoretical definition or approach. It may be vary upon the project requirements.

May be someone even more better approach.