It’s been a loooong time, but maybe this will be helpful for the prospectors from the future.
I was one of them, found this thread and it is not what I was looking for, but it led me to find the right (at least, working for me) way.
Right after your level is finished loading, you can block until all current streaming will be completed by doing this:
FStreamingManagerCollection& SMC = FStreamingManagerCollection::Get();
SMC.BlockTillAllRequestsFinished(0.f, true);
/**
* Blocks till all pending requests are fulfilled.
*
* @param TimeLimit Optional time limit for processing, in seconds. Specifying 0 means infinite time limit.
* @param bLogResults Whether to dump the results to the log.
* @return Number of streaming requests still in flight, if the time limit was reached before they were finished.
*/
One thing I can’t tell clearly is, where to put this lines of code, because in my case, I have my own code with my own events that dynamically loads and unloads levels, but one thing I can tell is, I’m using UGameplayStatics::LoadStreamLevel();
and UGameplayStatics::UnloadStreamLevel();
for this, along with FLatentActionInfo
But I had the same issue as yours and FStreamingManagerCollection::BlockTillAllRequestsFinished();
solved it in my case.