My goal was to create a custom Blueprint that acts as a level selector. I found exactly what I was looking for in the Load Level Instance node.
I browsed through the code and found out that the type of the Level parameter is TSoftObjectPtr. My question is how does this work exactly? How does Unreal know how to populate that list? I know UWorld contains the levels, but it also contains many other objects, so why does it create a list of levels?
P.S. Is there any other way to do the same? I know I can use DataTable and Enumeration, but they are both hardcoded, I’m talking about dynamically creating a list and selecting an item from it so that when I rename it in the content browser the links don’t break.
I’m not 100% sure, but this could be that the LoadLevelInstance function uses TSoftObjectPtr as one of the variables. This means that when the variable is selected in the blueprints, only a type of UWorld will be usable in the list, and therefore will only show those.
In blueprints, this will only give you the option of choosing a texture, rather than everything in content. Soft pointers I believe just hold a reference to the object, rather than the object itself, so it probably uses the name to search for the level and load that when you call the load level funciton.
Yes, LoadLevelInstance uses TSoftObjectPtr as a parameter type. I understand what you mean by using UTexture2D, but my question is how does Unreal know to load all of the levels in UWorld? UWorld has access to many other things, including, I think, actors? So what if I wanted a list of all the actors in the world?