[UE4 4.22.3 & C++] How can I do a 'Point Of View' replay?

Hey all,

I’m trying to do a replay system where when you playback the replay you have the same point of view as when the replay was recorded. By this I mean the camera maintains the same position & rotation as it was when you controlled the character, and its attached to the character like in regular gameplay.

I have the basic replay working where you looking at the replay from a spectator point of view. But I would like to have it so the replay is from the point of view of the player recording the replay.

The biggest problem I’m running into now is how do I get the pawn that was possessed and controlled when the replay was being recorded? Also how would I replicated the HUD interactions happening on the pawns HUD?

If you have any insight on this please let me know.

-London

Idk why this term didn’t occur to me in the first place, But I essentially want a first person replay system. With the HUD and everything being played back as it happened during the recording. Does anyone know how to achieve this?

I did this by creating a little actor that followed and recorded (via a NetMulticast function) the position and rotation of the PlayerCameraManager found on the player controller. Then when the replay started I my ReplayPlayerController found that actor (which is replicated) and moved based off of the recorded camera position and rotation. I also smoothed out the ReplayPlayerController movement because it was a little jittery, even at higher recording Hz.

I smoothed it like this:

// smooth things out
// replayLoc & replayRot are the places the replay camera should be

FVector locDiff = replayLoc - sPawn->GetActorLocation();
float locMult = FMath::Clamp(Delta * 25.0f, 0.0f, 1.0f);
sPawn->SetActorLocation(sPawn->GetActorLocation() + locDiff * locMult);
		
FRotator rotDiff = (replayRot - ControlRotation).GetNormalized();
float rotMult = FMath::Clamp(Delta * 15.f, 0.0f, 1.0f);
ControlRotation += rotDiff * rotMult;

now i’m trying to figure out the HUD.

Hopefully this answer helped you out. I’ve looked around a lot for an answer for this… I don’t think one really exists.

Hi LDOGLONDON, did you managed to replicate the original local player HUD as well?

Hey man! This could very well be the solution to the problem I’m having right now, I’m just wondering how you accomplished this, as you can’t actually “move” a player controller.