Change SpawnLocation to forward vector of player
This commit is contained in:
parent
ea06181a01
commit
27fc0d5212
|
@ -581,8 +581,9 @@ void APlayerCharacter::ThrowWeaponCallback()
|
||||||
FVector BoxExtent;
|
FVector BoxExtent;
|
||||||
GetActorBounds(true, Location, BoxExtent, false);
|
GetActorBounds(true, Location, BoxExtent, false);
|
||||||
|
|
||||||
FVector SpawnLocation = FVector(Location.X, Location.Y + (BoxExtent.Y / 2), Location.Z + (BoxExtent.Z / 2));
|
FVector SpawnLocation = (BoxExtent.X * GetActorForwardVector()) * 2;
|
||||||
SpawnLocation += GetTransform().GetLocation();
|
SpawnLocation += Location;
|
||||||
|
SpawnLocation.Z += BoxExtent.Z;
|
||||||
|
|
||||||
if (TSubclassOf<AWeaponThrowable> WeaponThrowableTemplate = GetCurrentWeapon()->GetWeaponThrowableTemplate())
|
if (TSubclassOf<AWeaponThrowable> WeaponThrowableTemplate = GetCurrentWeapon()->GetWeaponThrowableTemplate())
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue