Hi, I’m following along and as far as I can tell I’ve copied your code exactly. Everything works right up until actually attaching the rifle to the socket. If I comment those two lines out everything works, but I put them back in and it’s a hard crash every time.
This is my code:
void AShooterCharacter::BeginPlay()
{
Super::BeginPlay();
GetWorld()->SpawnActor<AGun>(GunClass);
GetMesh()->HideBoneByName(TEXT("weapon_r"), EPhysBodyOp::PBO_None);
Gun->AttachToComponent(GetMesh(), FAttachmentTransformRules::KeepRelativeTransform, TEXT("WeaponSocket"));
Gun->SetOwner(this);
}