I am working on a hotwheels like car game where we can pickup cars and place them on tracks.
My aim is to:
Record a car placement and its motion on track in Game [for last n seconds/last n placements]
You need to have a structure, first of all. It’ll need to contain at least transform in it and other variables that you need to record.
You can do the logic in dynamic game instance, game mode, or pawn blueprint, but I recommend creating a game instance. There, have some booleans: IsRecording and IsPlaying. You’ll need also the structure as an array and int Frame that tells you which frame is currently playing.
You’ll need also a timer that loops for example every 0.2 seconds. From there, you check IsRecording and if is, you get all the necessary data from the pawn and you add item to the structure array.
If not, check if IsPlaying. If is, you’ll need to get from the structure array using the int Frame, set the pawn transform, etc and add 1 to the Frame
There you go. Hopefully you understood something ;D Cheers