Applied New Gun Model to Combat Character

This commit is contained in:
Philip W 2023-05-08 23:40:44 +01:00
parent 41d78d8846
commit b32e3c21d9
10 changed files with 25 additions and 4 deletions

BIN
Content/Assets/Gun/Gun.uasset (Stored with Git LFS) Normal file

Binary file not shown.

BIN
Content/Assets/Gun/GunMaterial.uasset (Stored with Git LFS) Normal file

Binary file not shown.

Binary file not shown.

BIN
Content/Assets/Gun/pCylinder9_lowpoly_lambert1_Height.uasset (Stored with Git LFS) Normal file

Binary file not shown.

Binary file not shown.

BIN
Content/Assets/Gun/pCylinder9_lowpoly_lambert1_Normal.uasset (Stored with Git LFS) Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -70,7 +70,7 @@ void UHoldToInitCombat::OnClickDown()
{
const AActor* PlayerActor = GetWorld()->GetFirstPlayerController()->GetPawn();
const UStaticMeshComponent* GunComponent = Cast<UStaticMeshComponent>(PlayerActor->GetComponentsByTag(UPrimitiveComponent::StaticClass(), FName("Gun"))[0]);
const FVector GunLocationOffset = GunComponent->GetSocketTransform("Muzzle").TransformPosition(FVector(-100, 0, 0));
const FVector GunLocationOffset = GunComponent->GetSocketTransform("Muzzle").GetLocation();
UNiagaraFunctionLibrary::SpawnSystemAtLocation(GetWorld(), GunEffect, GunLocationOffset, PlayerActor->GetActorRotation());
FOutputDeviceNull AR;
const FString Command = FString::Printf(TEXT("PlayCameraShakeShoot"));

View File

@ -272,7 +272,7 @@ void ATurnBaseCombatV2::ExecuteCast(FString Combo)
if (GunEffect)
{
const UStaticMeshComponent* GunComponent = Cast<UStaticMeshComponent>(PlayerActor->GetComponentsByTag(UPrimitiveComponent::StaticClass(), FName("Gun"))[0]);
const FVector GunLocationOffset = GunComponent->GetSocketTransform("Muzzle").TransformPosition(FVector(-100, 0, 0));
const FVector GunLocationOffset = GunComponent->GetSocketTransform("Muzzle").GetLocation();
UNiagaraFunctionLibrary::SpawnSystemAtLocation(GetWorld(), GunEffect, GunLocationOffset, PlayerActor->GetActorRotation());
FOutputDeviceNull AR;
const FString Command = FString::Printf(TEXT("PlayCameraShakeShoot"));