I’m not sure exactly what the issue is here. Everything works up to actually getting the object to parent to its socket.
The code is 1:1 (even just blocked out my own code and pasted the one from the github to see if that would work) .cpp:
void AShooterCharacter::BeginPlay()
{
Super::BeginPlay();
/*Gun = GetWorld()->SpawnActor<AGun>(GunClass);
GetMesh()->HideBoneByName(TEXT("weapon_r"), EPhysBodyOp::PBO_None);
Gun->AttachToComponent(GetMesh(), FAttachmentTransformRules::KeepRelativeTransform, TEXT("WeaponSocket"));
Gun->SetOwner(this);*/
Gun = GetWorld()->SpawnActor<AGun>(GunClass);
GetMesh()->HideBoneByName(TEXT("weapon_r"), EPhysBodyOp::PBO_None);
Gun->AttachToComponent(GetMesh(), FAttachmentTransformRules::KeepRelativeTransform, TEXT("WeaponSocket"));
Gun->SetOwner(this);
}
And here is the socket in the bone hierarchy:
Everything else is set up properly and works properly. The original gun from the mesh is hidden while the BP rifle does spawn in the world. It just will not stick itself into the designated socket. Tried restarting and recompiling… Nothing’s doing.