x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

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.

alt text

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.

Product Version: UE 4.19
Tags:
untitled.png (30.9 kB)
more ▼

asked Mar 29 '18 at 07:44 AM in Blueprint Scripting

avatar image

BorisKipi
5 1 3

(comments are locked)
10|2000 characters needed characters left

1 answer: sort voted first

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.

more ▼

answered Mar 29 '18 at 11:15 AM

avatar image

Dune
1.9k 52 39 200

avatar image BorisKipi Mar 29 '18 at 11:46 AM

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?

(comments are locked)
10|2000 characters needed characters left
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question