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"

Array wont let me select an object to add to it in the blueprint defaults

I created a TArray in c++ and exposed it to be able to add elements into it dynamically in my blueprints defaults, however once i compiled and restarted the engine just in case, the array showed up in my defaults but would not let me select the blueprints I wanted to, it would also only let me select object that were of that class there were currently in the level.

Product Version: UE 4.8
Tags:
more ▼

asked Sep 10 '15 at 01:46 AM in C++ Programming

avatar image

Phil809
3 2 3 5

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

1 answer: sort voted first

Thats because blueprints are classes not objects and you can't select objects in defaults because they don't exist until you start the game or else object of your class is in the level and you can add other objects on level to variable in Details tab, because they indeed exist on the level and your object on level can reefer to them.

If you want to have classes selectable (Either C++ or Blueprints) use UClass* (which will let you select any class) or

 TSubclassOf<USomeClass>

which is UClass* template that limits selection in editor to specific class relation (in this case USomeClass). Remeber that this is class identifier (purple color pins in blueprints), so you will need to spawn objects of those classes first in order to use them. So if you make for example default inventory selection, you hide inventory from defaults and have array of UClass* and then on begin play you spawn all classes in that array to inventory array.

more ▼

answered Sep 10 '15 at 02:40 AM

avatar image

Shadowriver
37.2k 936 172 1116

avatar image Phil809 Sep 10 '15 at 02:50 AM

thank you very much that's exactly what i was looking for I had actually just figured it out moments before your reply.

Thank you again!! :)

(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