Spawn FieldSystemActor at Hit Result Impact Point
This commit is contained in:
parent
97c937d212
commit
a0c125c424
|
@ -239,6 +239,13 @@ void APlayerCharacter::CalculateHits(TArray<FHitResult>* hits)
|
||||||
DrawDebugLine(GetWorld(), TraceStart, Result.ImpactPoint, FColor::Blue, true, 500, 0U, 0);
|
DrawDebugLine(GetWorld(), TraceStart, Result.ImpactPoint, FColor::Blue, true, 500, 0U, 0);
|
||||||
|
|
||||||
// TODO: Handle hits in a meaningful way
|
// TODO: Handle hits in a meaningful way
|
||||||
|
FActorSpawnParameters SpawnParameters;
|
||||||
|
SpawnParameters.SpawnCollisionHandlingOverride = ESpawnActorCollisionHandlingMethod::AlwaysSpawn;
|
||||||
|
|
||||||
|
// Spawn field actor
|
||||||
|
FTransform transform;
|
||||||
|
transform.SetLocation(Result.ImpactPoint);
|
||||||
|
GetWorld()->SpawnActor<AFieldSystemActor>(CurrentWeapon->GetFieldSystemActor(), transform, SpawnParameters);
|
||||||
|
|
||||||
if (Result.GetActor()->ActorHasTag(FName("Destructable")))
|
if (Result.GetActor()->ActorHasTag(FName("Destructable")))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue