Change SpawnLocation to forward vector of player

This commit is contained in:
baz 2023-09-19 02:06:16 +01:00
parent ea06181a01
commit 27fc0d5212
1 changed files with 4 additions and 3 deletions

View File

@ -580,9 +580,10 @@ void APlayerCharacter::ThrowWeaponCallback()
FVector Location;
FVector BoxExtent;
GetActorBounds(true, Location, BoxExtent, false);
FVector SpawnLocation = FVector(Location.X, Location.Y + (BoxExtent.Y / 2), Location.Z + (BoxExtent.Z / 2));
SpawnLocation += GetTransform().GetLocation();
FVector SpawnLocation = (BoxExtent.X * GetActorForwardVector()) * 2;
SpawnLocation += Location;
SpawnLocation.Z += BoxExtent.Z;
if (TSubclassOf<AWeaponThrowable> WeaponThrowableTemplate = GetCurrentWeapon()->GetWeaponThrowableTemplate())
{