Add LevelInstance in the runtime

How to create the LevelInstance in the runtime? I want to load the .pak file and create the ALevelInstance as a sublevel.It can be created in editor mode.I have reviewed the relevant code. Is there any solution that can be implemented

Hi @842661047,

I’m not sure if anyone has tried that. Did you try it, and run into trouble? If so, we might be able to work through the problems if you can share your approach and results.

Thank you for your reply
I did encounter some trouble because the ‘LevelInstanceSubsystem ->CreateLevelInstanceFrom()’ function can only be used in editor mode. I also cannot use ‘ULevelStreamingDynamic’ because it cannot be converted to ALevelInstance. Do you have any way to dynamically create ALevelInstance in runtime mode and specify which level file to use. In this way, the UCesiumSubLevelSwitcherCompoonent component can be used to dynamically switch between sub levels.

Are you really using Cesium for Unreal v1.31? That release is over two years old, and v2.0+ got a whole new sub-level system that doesn’t depend on features that were deprecated in UE4. I definitely recommend you upgrade if you can. Whether there’s any way to dynamically add sublevels at runtime in that old version, I’m afraid I don’t know.