Why does TSoftObjectPtr display as a list of levels?
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.
asked Mar 29 '18 at 07:44 AM in Blueprint Scripting
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.
I believe it is similar to using:
UPROPERTY(BlueprintReadOnly) UTexture* SomeTexture;
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.
Follow this question
Once you sign in you will be able to subscribe for any updates here