Add to TArray<AActor*> from details panel

I have written a c++ class with a TArray<AActor*> property. I then created a blueprint class based on this c++ class, and I want to set the actors in the array via the editor. These actors which I want to add to the array are existing blueprint class actors in the content drawer, and are NOT placed in the world.

My issue is that these actors do not appear as selectable options for the array within the details panel. I would assume that the issue is due to TArray requiring pointers, meaning I can only add actors that are currently placed in the world. How can I solve this issue without having the actors already be placed in the world?

.h:

UPROPERTY(EditAnywhere, BlueprintReadWrite) TArray<AActor*> RoomVariations;

Actors in content drawer I want to add:
actorIssue1

Details panel not showing these actors:

I know I can use CreateDefaultSubobject to get individual references to each of these classes, but I specifically need them in an array. Is there an alternative to TArray that would allow this?

I think what you need to use is TSubclassOf<AActor> instead, since the blueprints themselves are not technically instanced actors but rather default objects for classes

(I’m assuming you will spawn actors of these classes at runtime)

Thanks,
Instead of creating a TArray of Actor pointers, I did this:

UPROPERTY(EditAnywhere, BlueprintReadWrite) TArray< TSubclassOf<class AActor>> RoomVariations;

And this did exactly what I needed it to.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.