# How to use memory streamer replay correctly?

**URL:** <https://forums.unrealengine.com/t/how-to-use-memory-streamer-replay-correctly/480422>\
**Category:** C++\
**Tags:** replay-system, replay, unreal-engine, question\
**Created:** [March 17, 2021, 6:21am UTC](https://forums.unrealengine.com/t/how-to-use-memory-streamer-replay-correctly/480422 "2021-03-17T06:21:50Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![HappyBroccoli](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@HappyBroccoli](https://forums.unrealengine.com/u/HappyBroccoli)\
**Post date:** [March 17, 2021, 6:21am UTC](https://forums.unrealengine.com/t/how-to-use-memory-streamer-replay-correctly/480422/1 "2021-03-17T06:21:50Z")

</div>

> **[DemoNetDriver and Streamers](https://docs.unrealengine.com/5.0/en-US/demonetdriver-and-streamers-in-unreal-engine/)**
>
> Overview of the Replay system for recording and playback of gameplay

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.

---

<div class="post-metadata">

**Author:** ![Tare\_E](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Tare\_E](https://forums.unrealengine.com/u/Tare_E)\
**Post date:** [March 24, 2021, 7:59am UTC](https://forums.unrealengine.com/t/how-to-use-memory-streamer-replay-correctly/480422/2 "2021-03-24T07:59:47Z")

</div>

> 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?

---

<div class="post-metadata">

**Author:** ![Andrea\_92](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Andrea\_92](https://forums.unrealengine.com/u/Andrea_92)\
**Post date:** [January 4, 2023, 8:50pm UTC](https://forums.unrealengine.com/t/how-to-use-memory-streamer-replay-correctly/480422/3 "2023-01-04T20:50:27Z")

</div>

Do you post a tutorial of this?

---

<div class="post-metadata">

**Author:** ![FullDeckOfFools](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/fulldeckoffools/32/603490_2.png) [@FullDeckOfFools](https://forums.unrealengine.com/u/FullDeckOfFools)\
**Post date:** [February 1, 2023, 10:54pm UTC](https://forums.unrealengine.com/t/how-to-use-memory-streamer-replay-correctly/480422/4 "2023-02-01T22:54:06Z")

</div>

> [@HappyBroccoli](#):
>
> code to toggle the Visible of DynamicD

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

```auto
// 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

```auto
// 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.
