In the Attaching Meshes Via Sockets video Sam moves the Gun while in game and then copies the location and pastes that into the Gun BP
What is the benefit of this approach vs using CPP like in the code below:
Gun = GetWorld()->SpawnActor(GunClass);
GetMesh()->HideBoneByName(TEXT(“weapon_r”), EPhysBodyOp::PBO_None);
Gun->AttachToComponent(GetMesh(), FAttachmentTransformRules::KeepRelativeTransform, TEXT(“WeaponSocket”));
FHitResult* hit = new FHitResult();
Gun->AddActorLocalOffset(FVector(0.f, -15.f, -1.f), false, hit, ETeleportType::None);
Gun->SetOwner(this);
Can anyone comment on this code and let me know if there is something wrong with it as well