My project loads and unloads levels on the fly. These levels bring in a custom camera with them and some gameplay can’t progress until we know the camera is in place and BeginPlay is called on the camera actor.
IsLevelLoaded seems to trigger before the camera is activated. IsLevelVisible triggers afterward and is exposed on iphone but not on PC.
Solution: copy the contents of IsLevelVisible inline in my own CPP. I’m not the first person to hit this problem, I won’t be the last.
Question1: Is that the correct way to check that all components of a loaded scene are ready to play?
Question2: Why not expose IsLevelVisible on all platforms?
Request: Expose IsLevelVisible on all platforms and put a nice comment on it, or tell me that I need to do things a different way.
My general takeaway on streaming at the moment is that it’s nicely functional but the API could do with some love, at minimum in the comments region but possibly in terms of function names also!
ULevelStreaming::IsLevelVisible and ULevelStreaming::IsLevelLoaded are accessible on all platforms, not sure why you don’t see it on PC. IsLevelVisible means that all actors/components for sub-level was registered in the world and ready to play.
I’ll be honest, I have no idea why its not exported (on one platform, but not another) but when I looked it up I’m not the first to have have problems with it.
ULevelStreaming *pStreaming = UGameplayStatics::GetStreamingLevel(mp_World.Get(), FName(*LevelName));
if (pStreaming)
{
return pStreaming->GetLoadedLevel() && pStreaming->GetLoadedLevel()->bIsVisible;//IsLevelVisible(); IsLevelVisible is not available on all platforms.
}