Hi!
I created prototype version of my spawning function in blueprints. It takes unit class, number of units to spawn and a reference to an Array of Actors as parameters. I can pass any Array that holds object references of any class that is a child of Actor. I can then modify that Array inside my function.
Now I’m trying to rewrite this function with C++. Using TArray<AActor*>&
as parameter in function declaration does not let me use anything but TArray
of AActor
.
UFUNCTION()
void SpawnUnits(TSubclassOf<AActor> UnitClass, int Number, TArray<AActor*>& UnitArray);
I’m trying to achieve similar functionality as in blueprints version so that I could pass any TArray
of objects that are children of AActor
. Is there any way to do so? As for now IDE gives me this error: