Hey everyone,
So currently I am trying to implement a simple spawning system. Taking an array of actors, generating a random int and using that as an index to get a location from the actor. I am just having an issue of getting all of the actors in the world. Is there an easy way to do this? I have searched and found something called Actor Iterators? I’ve tried but it’s not really working and I dont think i understand how they work
Any assistance would be awesome!
UPROPERTY(EditDefaultsOnly, BlueprintReadWrite, Category = "Waves")
TArray<AAuroraAISpawnPoint*> spawnLocations;
// Get all actors
for (TActorIterator<AAuroraAISpawnPoint*> ActorItr(GetWorld()); ActorItr; ++ActorItr)
{
// Add the actor to our spawn locations array
spawnLocations.Add(ActorItr);
}
I need to get all the instances of AAuroraAISpawnPoint and add them to my array, a little confused on this one thanks!