Force set the hight of the pickup when spawned

This commit is contained in:
baz 2025-02-03 20:26:26 +00:00
parent 7611c87e21
commit a31e00c6e4

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);
}