Download

Rewinding Time Using Blueprints

Hello guys,
I am working on a game that involves a player pushing around objects and I would like to rewind time. I have followed a video I found on YouTube that shows how to rewind time and I was able to recreate it. The issue is that the objects don’t reset with the player, the players looking direction doesn’t rewind and the only thing that rewinds is the player. I have thought of an alternative to this method and I came up with the idea of creating an array that will hold about 600 frames and as the player moves, the frame at the first index -> index[0] will be deleted and the rest of the values will move down. So to clarify this a bit more, here’s an example. We have array{5, 4, 3, 2, 1}. Here’s what I’m trying to do, delete array[0] which is the integer 5 then move everything down so the array will become array {4, 3, 2, 1, new value}. The new value will take on the value of the players next step in the game as he is walking. So once the player walks one value is deleted, every other value is shifted down to the previous index and a new value is added to the last index. I am just having trouble putting this together in unreal and I would like some help. Would it be possible to create it with blueprints? If not, a C++ class would work but where and how would I store the memory that the code is saving without slowing down the game and how would I be able to save the objects as well so they could rewind. Any help or advice would be appreciated, I know this is a bit tough as I am having trouble wrapping my mind around it as well. I will post screenshots of the blueprints that I currently am using in order to save the frames and rewind the game. Thanks in advance guys.

P.S. Sorry in advance for the amount of screenshots posted!