How to add actor's location in TArray in Tick using c++?

Hey I’m planning to do killcam for my game. In that we need to store the current position in a TArray then after death we need to call the last 5 -10 stored TArray values to show a replay how he was dead.