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"

Restrict FStringAssetReference to Level assets only

I am using the following variable to set a reference to a Level asset in the editor.

UPROPERTY(EditDefaultsOnly, Category = "Maps") FStringAssetReference Mission10;

This works but the drop down list all assets in the project. I would like to restrict it to a list of level assets only. I tried the following:

UPROPERTY(EditDefaultsOnly, Category = "Maps", meta = (MetaClass = "Level")) and UPROPERTY(EditDefaultsOnly, Category = "Maps", meta = (AllowedClasses = "Level"))

But neither of these seem to be working. The list shows either everything or nothing at all. What specifiers do I need to use?

Product Version: UE 4.13
Tags:
more ▼

asked Dec 17 '16 at 05:15 PM in C++ Programming

avatar image

Waves
67 4 7 11

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

2 answers: sort voted first

FStringAssetReference (FSoftObjectPath since 4.18) will also work, "World" label does the magic trick ;)

     UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Content, meta = (AllowedClasses = "World"))
         TArray<FSoftObjectPath> Levels;
more ▼

answered Feb 11 '18 at 10:09 PM

avatar image

Doctor Ergot
265 15 28 38

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

Use a TAssetPtr<UWorld> (or TSoftObjectPtr in 4.18) instead. This is a typed wrapper around FStringAssetReference.

more ▼

answered Oct 30 '17 at 11:59 PM

avatar image

Digi Labs Dan
571 16 14 35

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
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