Application.LoadedLevelName for level loaded from asset bundle isn't set

After building an asset bundle for a scene using BuildPipeline.BuildStreamedSceneAssetBundle() I can load the scene from the bundle just fine using Application.LoadLevel(). However, Application.LoadedLevelName is an empty string. This doesn’t seem right to me.

I can understand Application.LoadedLevel being -1 (the value it returns for a scene loaded from an asset bundle), but since the scene was loaded using its name, it baffles me that Application.LoadedLevelName should be empty. Am I missing something? Is this a bug? or is it intended behavior?

I’ve tried searching here and various other sites and haven’t managed to find anything dealing with these variables directly when loading scenes from an asset bundle. I know I can write my own wrapper for loading levels and tracking the name, but I’d prefer to utilize the built in functionality of Unity as much as possible.


This is intend behavior I assume because you could have unloaded the asset bundle by now with the unload(false) so loadlevel with the name would no longer work and thats exactly the use case for which LoadedLevelName is there, to reload the current level.

in any other case you would have another reference or something ‘telling you where you are’ cause you need to know what the next level is or management stuff about the current one