Download

Async Load Asset fails for World soft reference (first time load works, second time doesn't)

I’m having an issue where I can load a given level once during a game session. If that level is loaded a second time, or the level was started in PIE, then the load will fail.

I’m using a TSoftObjectPtr<UWorld> to determine which level should be loaded so I don’t hardcode level names to prevent typos, and to async load the level before opening it as a workaround to having a UMG based animated loading screen.

I’m then loading the level in Blueprint like this:

This is so I can have a UMG based loading screen that animates.

The issue is that this works exactly once for each level.
So for example: if I load and open level A the first time; then it loads. If I then go back to the main menu and load into level A again it’ll fail at the Async Load Asset node with the following console output (certain names are redacted):



LogPackageName: SearchForPackageOnDisk took 0.128s, but failed to resolve None.umap.
LogPackageName: SearchForPackageOnDisk took 0.121s, but failed to resolve None.umap.
LogNet: Browse: /Game/FooProject/Maps/CORE_MainMenu
LogNet: Warning: Travel Failure: [InvalidURL]: Invalid URL: /Game/FooProject/Maps/CORE_MainMenu
LogNet: Warning: TravelFailure: InvalidURL, Reason for Failure: 'Invalid URL: /Game/FooProject/Maps/CORE_MainMenu'. Shutting down PIE.
PIE: Warning: TravelFailure: InvalidURL, Reason for Failure: 'Invalid URL: /Game/FooProject/Maps/CORE_MainMenu'. Shutting down PIE.
LogNet: Warning: Travel Failure: [ClientTravelFailure]: Invalid URL: /Game/FooProject/Maps/CORE_MainMenu
LogNet: Warning: TravelFailure: ClientTravelFailure, Reason for Failure: 'Invalid URL: /Game/FooProject/Maps/CORE_MainMenu'. Shutting down PIE.
PIE: Warning: TravelFailure: ClientTravelFailure, Reason for Failure: 'Invalid URL: /Game/FooProject/Maps/CORE_MainMenu'. Shutting down PIE.


I have checked by setting breakpoints and watches before that async load and both Level Data and Level World are valid and have the expected values (the same as the first run where it does load).

The issue also occurs when I start PIE in the level A, go back to the main menu, and then load level A. Then the async load won’t even work once.

If I go to level A, and then to level B, then level B will successfully load once (level B being a completely empty level to eliminate anything on that end).

I’ve also tried checking if the Level World soft object ptr is valid before the async load, but that didn’t seem to change anything.