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

@ -581,8 +581,9 @@ void APlayerCharacter::ThrowWeaponCallback()
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())
{