For some reason when I port the weapon and character code over from shooter game to a new project and use the same assets, my third person weapon mesh is always visible when the pawn is possessed by the player. It doesn’t rotate with the rig or anything it just stays in place like it’s not attached to any socket.
From my understanding the attachment logic and mesh visibility is handled :
void AGOWWeapon::AttachMeshToPawn()
{
if (MyPawn)
{
// Remove and hide both first and third person meshes
DetachMeshFromPawn();
// For locally controller players we attach both weapons and let the bOnlyOwnerSee, bOwnerNoSee flags deal with visibility.
FName AttachPoint = MyPawn->GetWeaponAttachPoint();
if (MyPawn->IsLocallyControlled() == true)
{
USkeletalMeshComponent* PawnMesh1p = MyPawn->GetSpecifcPawnMesh(true);
USkeletalMeshComponent* PawnMesh3p = MyPawn->GetSpecifcPawnMesh(false);
Mesh1P->SetHiddenInGame(false);
Mesh3P->SetHiddenInGame(false);
Mesh1P->AttachTo(PawnMesh1p, AttachPoint);
Mesh3P->AttachTo(PawnMesh3p, AttachPoint);
}
else
{
USkeletalMeshComponent* UseWeaponMesh = GetWeaponMesh();
USkeletalMeshComponent* UsePawnMesh = MyPawn->GetPawnMesh();
UseWeaponMesh->AttachTo(UsePawnMesh, AttachPoint);
UseWeaponMesh->SetHiddenInGame(false);
}
}
}
And it really just depends on whether the pawn mesh is visible or not. Is there something else happening in the shootergame source that enables the third person mesh to be hidden?
Thanks,