How can I stream levels while pausing?

I want to pause the game to avoid it progressing while the level is loading, but pausing stops the level streaming from continuing.

Streaming is done on the game instance.

It was stated that game instances are not affected by pausing, but level streaming seems to be an exception.

Also, in Open Levels, it’s unclear when the loading is complete.

How should i deal with this problem?

1 Like

I don’t -think- ( without testing ) that streaming is affected by pausing, because it’s asynchronous, but it does need to be called from something that ticks during pause, like the game instance.

Either that or, unpause briefly, start the stream, and pause again.

Another option ( I use ), is to not pause the game, but just hold the player still and put up a blurring widget ( Loading… ) until the level has streamed.

If you’re using a blueprint, the Load Stream Level node will continue when it’s done loading if you set it to block on load. My guess is that pausing pauses latent blueprint actions. But even then, I don’t think it returns when the sub level is visible, it returns when the call is done. Making the level visible takes many many frames after that.

In C++, you can bind an event to OnLevelShown. But in a blueprint, they don’t give you access to the ULevelStreamingDynamic instance so you don’t have the same kind of control. If you have a project that allows C++, I can provide you a function where you can give it an event or implement a function in the BP when a level is done. This sub forum doesn’t seem to allow posting formatted code… likely because it’s the BP only forum.

Thank you everyone for your replies.

To be honest, I’m surprised that the Blueprint doesn’t provide a fundamental solution to this problem.

I don’t understand why it’s difficult to do level streaming in the background…

I thought this was something that could naturally be done given the purpose of the function.

The temporary solution I found is to set Set Global Time Dilation to an extremely low value and mute all sounds.

Once loading is complete, reset Time Dilation to 1.0 and return the sound volume to original.

However, I am not satisfied with this solution…

The game isn’t frozen, so I’m worried that a glitch might occur somewhere down the line.