Add functionality to ThrowThrowable
This commit is contained in:
parent
19d452be5c
commit
d3e775758d
|
@ -596,11 +596,19 @@ void APlayerCharacter::ThrowWeaponCallback()
|
||||||
|
|
||||||
void APlayerCharacter::ThrowExplosiveCallback()
|
void APlayerCharacter::ThrowExplosiveCallback()
|
||||||
{
|
{
|
||||||
auto throwable = ThrowThrowable();
|
if (ThrowableInventory.Num() > 0)
|
||||||
|
{
|
||||||
|
FVector Location;
|
||||||
|
FVector BoxExtent;
|
||||||
|
GetActorBounds(true, Location, BoxExtent, false);
|
||||||
|
|
||||||
|
FVector SpawnLocation = (BoxExtent.X * GetActorForwardVector()) * 2;
|
||||||
|
SpawnLocation += Location;
|
||||||
|
SpawnLocation += (25.0f * GetActorForwardVector());
|
||||||
|
SpawnLocation.Z += BoxExtent.Z;
|
||||||
|
|
||||||
// TODO: Set the collision size to the size of the static mesh in the throwable
|
AThrowable* Throwable = GetWorld()->SpawnActor<AThrowable>(ThrowableInventory.Pop(), SpawnLocation, FRotator::ZeroRotator);
|
||||||
// throwable->GetSphereComponent()->SetSphereRadius();
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
AThrowable* APlayerCharacter::ThrowThrowable()
|
AThrowable* APlayerCharacter::ThrowThrowable()
|
||||||
|
|
Loading…
Reference in New Issue