I am trying to implement Replay KillCam while maintaining connection with DedicateServer by referring to the above document.
Replay is implemented using a memory streamer, but the connection to the server is disconnected when playing the replay.
And I don’t know how to quit playing the replay and come back.
Currently, I have created a code to toggle the Visible of DynamicDuplicateLevel and DynamicSourceLevel when playing replays. I wonder if this is the right way.
Currently, I have created a code to toggle the Visible of DynamicDuplicateLevel and DynamicSourceLevel when playing replays. I wonder if this is the right way.
How did you do this?
I would also like to know. I have created a game instance with the following code which works well exposed to blueprints. The only problem is that I can’t exit the played recording. Any ideas on how to accomplish this.
DeathReplayGameInstance.h
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "Engine/GameInstance.h"
#include "DeathReplayGameInstance.generated.h"
/**
*
*/
UCLASS()
class DEMONETDRIVERTEST_API UDeathReplayGameInstance : public UGameInstance
{
GENERATED_BODY()
public:
UDeathReplayGameInstance();
UPROPERTY(EditDefaultsOnly, Category = "DeathReplay")
FString RecordingName;
UPROPERTY(EditDefaultsOnly, Category = "DeathReplay")
FString FreindlyRecordingName;
UFUNCTION(BlueprintCallable, Category = "DeathReplay")
void StartRecording();
UFUNCTION(BlueprintCallable, Category = "DeathReplay")
void StopRecording();
UFUNCTION(BlueprintCallable, Category = "DeathReplay")
void StartReplay();
};
DeathReplayGameInstance.cpp
// Fill out your copyright notice in the Description page of Project Settings.
#include "DeathReplayGameInstance.h"
UDeathReplayGameInstance::UDeathReplayGameInstance()
{
RecordingName = "MyReplay";
FreindlyRecordingName = "My Replay";
}
void UDeathReplayGameInstance::StartRecording()
{
TArray<FString> URLOptions;
URLOptions.Add("ReplayStreamerOverride=InMemoryNetworkReplayStreaming");
StartRecordingReplay(RecordingName, FreindlyRecordingName, URLOptions);
}
void UDeathReplayGameInstance::StopRecording()
{
StopRecordingReplay();
}
void UDeathReplayGameInstance::StartReplay()
{
TArray<FString> URLOptions;
URLOptions.Add("ReplayStreamerOverride=InMemoryNetworkReplayStreaming");
PlayReplay(RecordingName, nullptr, URLOptions);
}
Currently I use the exposed functions in my ThirdPersonCharacterBP, triggered by key inputs. I just need a way to transfer control back to the player. Thanks in advance.