Demo PlayReplay not working

Hi, I am new to Unreal Engine. I have issue with play replay using C++ code. I use the ThirdPerson template to create a C++ project, and add my custom replay code as below:

void AReplayTestCharacter::SetupPlayerInputComponent(class UInputComponent* PlayerInputComponent)
{   
    //......
    PlayerInputComponent->BindAction("RecordReplay", IE_Pressed, this, &AReplayTestCharacter::StartRecordReplay);
    PlayerInputComponent->BindAction("PlayReplay", IE_Pressed, this, &AReplayTestCharacter::StartPlayReplay);
}

void AReplayTestCharacter::StartRecordReplay() {
    if (IsRecordReplay) {
        IsRecordReplay = false;
        GetWorld()->GetGameInstance()->StopRecordingReplay();
    } else {
        IsRecordReplay = true;
        GetWorld()->GetGameInstance()->StartRecordingReplay(TEXT("TEST"), TEXT("TEST"));
    }
}

void AReplayTestCharacter::StartPlayReplay() {
    GetWorld()->GetGameInstance()->PlayReplay(TEXT("TEST"));
}

I press the “RecordReplay” button twice for start and stop record, and then press the “StartPlayReplay” button, but no replay start, and the viewing camera changed to a very strange position.

And I tested a few things more:

  1. Use command of “demorec TEST”, “demostop”, “demoplay TEST”, its working.
  2. Use command of “demorec TEST”, “demostop” and press “StartPlayReplay” button, its not working.
  3. Press button “RecordReplay” button twice and use command “demoplay TEST”, its working.
  4. I also tested in UE 4.14, its not working as well.

Its really helpful for having this replay system, but I want to achieve this functionality using C++ code, any help would be very grateful. Thanks in advance!

I have the same question.And I think the viewing camera’s world location changed to (0,0,0).So,is there any solution?

Seems that in the next hotfix this issue will be solved:

Hi, I think I am not setup replay system correctly, I need add

[/Script/Engine.GameEngine]
+NetDriverDefinitions=(DefName="DemoNetDriver",DriverClassName="/Script/Engine.DemoNetDriver",DriverClassNameFallback="/Script/Engine.DemoNetDriver")

in Config/DefaultEngine.ini.

Its working correct for me now.

It didn’t work for me, though this config was set in the beginning. It’s working only in 4.13 but not 4.15. Do you have crash after closing the app?

Hi, its work for me and no crash, did you try the tutorial here: A new, community-hosted Unreal Engine Wiki - Announcements - Unreal Engine Forums ?