Array of ActorClass / Blueprints?

Hey guys,

i’m converting my Blueprint Project into C++ and while setting up my Arrays i can’t find a valid type to get an ActorClass Array.

This is the Blueprint version of the Array i need. I save the Blueprints in it so that i can spawn them via Actor Spawn from Class.

I want to add them inside the blueprint later, so not via c++. I only want to setup the array ):

Or do i have to rethink how to save and spawn my items when i use c++?

http://puu.sh/atyyo/92f457cacc.png

You can create an array like this

TArray< TSubclassOf<class AActor> > ActorClassArray;

UHT is a little sensitive so it’s important you have a space padding inside the < > for the TArray type.

// This will FAIL!
TArray<TSubclassOf<class AActor>> ActorClassArray;

And of course you change change AActor to a base class of your own if the array is supposed to hold something more specific like all types of weapons in your game.

Thanks! I also made this work with UClass*. Although i don’t know if comparing a found Actor in seen with the content of this array would also work.

But anyway! Thanks for that awesome answer, i find my items now! (: