UnrealScripterAI
Discord ↗
Link Copied to Clipboard
×
"create a zombie spawner"
// ZombieSpawner is an Actor void AZombieSpawner::BeginPlay() { Super::BeginPlay(); GetWorldTimerManager().SetTimer(SpawnTimerHandle, this, &AZombieSpawner::SpawnZombie, SpawnInterval, true); } void AZombieSpawner::SpawnZombie() { if (ZombieClass) { FVector SpawnLocation = GetActorLocation(); FRotator SpawnRotation = GetActorRotation(); GetWorld()->SpawnActor<AZombie>(ZombieClass, SpawnLocation, SpawnRotation); } }