Download

How to fill a sublevel (UWorld type) problem of LevelStreaming synthaxe

Hello,

I need to replace the 2nd parameter (the one at nullptr) in this function to play the replay in a sub level:



PlayReplay (ReplayURL, nullptr, Options);


I know the type of the parameter to fill in is a UWorld. I created a sub level in my level.
But no matter how much I read the documentation on UWorld, I can’t find the right syntax to fill it in.

Here is the API:



/**
* Start playing back a previously recorded replay.
*
* @param InName Name of the replay file.
* @param WorldOverride World in which the replay will be played. Passing null will cause the current world to be used.
* @param AdditionalOptions Additional options that can be read by derived game instances, or the Demo Net Driver.
*
* @return True if the replay began successfully.
*/
virtual bool PlayReplay(const FString& InName, UWorld* WorldOverride = nullptr, const TArray<FString>& AdditionalOptions = TArray<FString>());


Here is the doc: https://docs.unrealengine.com/en-US/…memorystreamer

Here is my .cpp code



#include "CPP_MultiplayerGameInstanceV2.h"

UCPP_MultiplayerGameInstanceV2::UCPP_MultiplayerGameInstanceV2()
{ RecordingName = "MyReplay";
FriendlyRecordingName = "My Replay";
 }

void UCPP_MultiplayerGameInstanceV2::StartReplay()
{ TArray<FString> Options;
Options.Add("ReplayStreamerOverride=InMemoryNetworkReplayStreaming");
PlayReplay(ReplayURL, **nullptr**, Options);
  }

void UCPP_MultiplayerGameInstanceV2::StartRecording()
{ TArray<FString> Options;
Options.Add("ReplayStreamerOverride=InMemoryNetworkReplayStreaming");
StartRecordingReplay(RecordingName, FriendlyRecordingName, Options);
  }

void UCPP_MultiplayerGameInstanceV2::StopRecording()
{ StopRecordingReplay();
 }


Please I need help. I absolutely need to override the nullptr parameter to make the replay play without reloading the current level.