I’m trying to implement an Instant Replay Killcam feature in my game where when the play dies, it plays back the last couple of seconds before their death in an instant replay. Right now I have it set to when the player character spawns, their client creates a DemoNetDriver on the local machine using an InMemory Replay Streamer. The recording part works fine. It’s when I try to play back the replay is where I get confused.
Following the code in AGameInstance from PlayReplay(), it destroys the current DemoNetDriver and creates another one. I can understand this logic for on disk replays, but I can’t figure out how to translate this logic for In Memory replays. According to the “DemoNetDriver and Streamers” page in the documentation, you’re supposed to create 2 different DemoNetDrivers, one for the live game and one for the collection of Dynamic Duplicate Levels where the replay is actually played. I can’t figure out how I would go about doing this.
If I follow the code for regular replays, when I call InitConnect() on the DemoNetDriver using InMemoryReplayStreamer, it disconnects from the live game to travel to the replay world, which is undesired. I want it to switch visibility to the Dynamic Duplicate Levels collection without disconnecting from the live game.
So that leaves my question: how do you connect to a DemoNetDriver to watch the replay without disconnecting from and destroying the IpNetDriver that connects to the live server?