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.

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!! :slight_smile:

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.