Compare commits

...

2 Commits

Author SHA1 Message Date
baz
a31e00c6e4 Force set the hight of the pickup when spawned 2025-02-03 20:26:26 +00:00
baz
7611c87e21 Reset Health on retrieval from poo 2025-02-03 20:26:12 +00:00
2 changed files with 6 additions and 2 deletions

View File

@ -44,12 +44,15 @@ void AEnemyCharacter::OnDamaged(FDamageInfo damageInfo)
void AEnemyCharacter::OnDeath(FDamageInfo damageInfo)
{
// TODO: Replace pickup spawning with pooling
FActorSpawnParameters actorSpawnParameters;
actorSpawnParameters.Owner = this;
actorSpawnParameters.SpawnCollisionHandlingOverride = ESpawnActorCollisionHandlingMethod::AlwaysSpawn;
actorSpawnParameters.TransformScaleMethod = ESpawnActorScaleMethod::MultiplyWithRoot;
GetWorld()->SpawnActor<AEXPPickup>(EXPPickupTemplate, GetActorLocation(), FRotator::ZeroRotator,
auto spawnLocation = GetActorLocation();
spawnLocation.Z = 75.0f;
GetWorld()->SpawnActor<AEXPPickup>(EXPPickupTemplate, spawnLocation, FRotator::ZeroRotator,
actorSpawnParameters);
}

View File

@ -95,6 +95,7 @@ void AVampireGameMode::SpawnEnemy()
{
healthComponent->OnDeath.AddDynamic(this, &AVampireGameMode::HandleOnEnemyDeath);
}
healthComponent->ResetHealth();
}
}
}