I have modified the “ShooterGame” to be a third person shooter. So far it was gone really well, everything is working great. I am having difficulty getting the “HeroTPP Reload” animation to work.
I currently have my player pawn set up like this. I set the Mesh to “HeroTPP” and under Mesh set the Reload animation to “HeroTPP_RifleReload” I know this is a good animation.
Here is my code for initiating my character. Sorry in advance for the wall of text.
AShooterCharacter::AShooterCharacter(const class FPostConstructInitializeProperties& PCIP)
: Super(PCIP.SetDefaultSubobjectClass<UShooterCharacterMovement>(ACharacter::CharacterMovementComponentName))
{
Mesh1P = PCIP.CreateDefaultSubobject<USkeletalMeshComponent>(this, TEXT("PawnMesh1P"));
Mesh1P->AttachParent = CapsuleComponent;
Mesh1P->bOnlyOwnerSee = true;
Mesh1P->bOwnerNoSee = false;
Mesh1P->bCastDynamicShadow = false;
Mesh1P->bReceivesDecals = false;
Mesh1P->MeshComponentUpdateFlag = EMeshComponentUpdateFlag::OnlyTickPoseWhenRendered;
Mesh1P->PrimaryComponentTick.TickGroup = TG_PrePhysics;
Mesh1P->bChartDistanceFactor = false;
Mesh1P->SetCollisionObjectType(ECC_Pawn);
Mesh1P->SetCollisionEnabled(ECollisionEnabled::NoCollision);
Mesh1P->SetCollisionResponseToAllChannels(ECR_Ignore);
Mesh->bOnlyOwnerSee = false;
Mesh->bOwnerNoSee = true;
Mesh->bReceivesDecals = false;
Mesh->SetCollisionObjectType(ECC_Pawn);
Mesh->SetCollisionEnabled(ECollisionEnabled::QueryAndPhysics);
Mesh->SetCollisionResponseToChannel(COLLISION_WEAPON, ECR_Block);
Mesh->SetCollisionResponseToChannel(COLLISION_PROJECTILE, ECR_Block);
Mesh->SetCollisionResponseToChannel(ECC_Visibility, ECR_Block);
CapsuleComponent->SetCollisionResponseToChannel(ECC_Camera, ECR_Ignore);
CapsuleComponent->SetCollisionResponseToChannel(COLLISION_PROJECTILE, ECR_Block);
CapsuleComponent->SetCollisionResponseToChannel(COLLISION_WEAPON, ECR_Ignore);
CharacterMovement->GravityScale = 1.5f;
CharacterMovement->AirControl = 0.1f;
bUseControllerRotationPitch = false;
bUseControllerRotationYaw = true;
bUseControllerRotationRoll = false;
CameraBoom = PCIP.CreateDefaultSubobject<USpringArmComponent>(this, TEXT("CameraBoom"));
CameraBoom->AttachTo(RootComponent);
CameraBoom->TargetArmLength = 150.0f;
CameraBoom->SocketOffset = FVector(0.0f, 50.0f, 50.0f);
CameraBoom->bUseControllerViewRotation = true;
FollowCamera = PCIP.CreateDefaultSubobject<UCameraComponent>(this, TEXT("FollowCamera"));
FollowCamera->AttachTo(CameraBoom, USpringArmComponent::SocketName);
FollowCamera->bUseControllerViewRotation = false;
TargetingSpeedModifier = 0.8f;
bIsTargeting = false;
RunningSpeedModifier = 1.5f;
bWantsToRun = false;
bWantsToFire = false;
LowHealthPercentage = 0.5f;
BaseTurnRate = 45.f;
BaseLookUpRate = 45.f;
}
Thanks for the help!