In this update, I aimed to remove the static mesh components and replace them with the skeletal mesh for my player.
Player Header File
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = SkeletalMesh)
USkeletalMesh* CharacterMesh;
UPROPERTY(EditDefaultsOnly, BlueprintReadWrite, Category = SkeletalMesh);
UClass* AnimBp;
To maximise C++ usage, I aimed to set my skeletal mesh and Animation Blueprint in the derived blueprint, so it can be used in the CPP file.
Player CPP File
void ACompetitionCharacter::BeginPlay()
...
//get the built in character mesh
USkeletalMeshComponent* PlayerMesh = GetMesh();
PlayerMesh->SetSkeletalMesh(CharacterMesh);
PlayerMesh->SetAnimationMode(EAnimationMode::AnimationBlueprint);
PlayerMesh->SetAnimInstanceClass(AnimBp);
PlayerMesh->RegisterComponent();
PlayerMesh->SetCollisionProfileName(CollisionProfile.Name, true);
PlayerMesh->OnComponentBeginOverlap.AddDynamic(this, &ACompetitionCharacter::OnOverlapStart);
Originally I was going to make a new “USkeletalMeshComponent” but after studying the documentations I realized one already existed in the character C++ base class. Therefore I set my mesh and animation blueprint onto this one.
void ACompetitionCharacter::OnOverlapStart()
...
if (Enemy->EnemyState == "ThrownPunch")
I added an “EnemyState” FName variable that will monitor the enemy’s state as well, so collision aren’t managed via arm components seperately.
Enemy CPP file
void ACompetitionEnemy::SpawnPunch()
{
EnemyState = "WindingPunch";
...
if (LeftArmBox)
{
//Extends arm
EnemyState = "ThrownPunch";
...
void ACompetitionEnemy::Reset()
{
EnemyState = "Inactive";
SetActorLocation(StartLocal);
}
Here is a few examples of how I’ve implemented “EnemyState”.
void ACompetitionEnemy::OnOverlapStart()
...
if (Player->State == "Punching" || Player->State == "SuperPunch")
{
Damage();
}
Here, I have replaced the arm component check with a state check, and made it an OR statement so “SuperPunch” will trigger damage.
Player Blueprint


Also I was having problems with the collision not firing, but I discovered I had to set the “Generate Overlap Events” boolean to true.
Reflection
Dealing with replacing static meshes and reworking systems has taught me that although my initial goal to complete functionality before aesthetics was useful, I should aim to do both rather than lean too far into one aspect.