Hi,
I have a small problem and I hope you guys could help me out.
My idea: I currently generate a dungeon at design time (but it should be possible to generate the dungeon on runtime later on). I want to place a “spawn object” using an emitter and as soon as the dungeon is generated the player sould be moved to this spawn position.
What I did: I implemented an C+±EventListener and tried to use an TActorIterator in the OnPostDungeonBuild_Implementation to walk over all generated spawn positions. If I press “generate dungeon” the event method is called, but no actors can be found using the TActorIterator. I thought that the OnPostDungeonBuild_Implementation would be called after Actors are created. Is that assumption wrong?
UWorld* world = Dungeon->GetWorld();
TArray<AActor*> playerSpawns;
TActorIterator<AActor> playerSpawnsIt(world);
for (; playerSpawnsIt; ++playerSpawnsIt)
{
UE_LOG(TADungeonEventListenerLog, Log, TEXT("Found Actor: %s"), *(*playerSpawnsIt)->GetName()); // Only the actory that are not generated by the dungeon are found
playerSpawns.Add(*playerSpawnsIt);
}