Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void AAWBaseWeapon::AttachMeshToPawn()
- {
- if (MyPawn)
- {
- DetachMeshFromPawn();
- FName AttachPoint = MyPawn->GetWeaponAttachPoint();
- if (MyPawn->IsLocallyControlled() == true)
- {
- USkeletalMeshComponent* PawnMesh1P = MyPawn->GetMesh1P();
- USkeletalMeshComponent* PawnMesh3P = MyPawn->GetMesh();
- Mesh1P->SetHiddenInGame(false);
- Mesh3P->SetHiddenInGame(false);
- GetMesh1P()->AttachTo(PawnMesh1P, AttachPoint);
- GetMesh3P()->AttachTo(PawnMesh3P, AttachPoint);
- }
- else
- {
- USkeletalMeshComponent* UseWeaponMesh = GetWeaponMesh();
- USkeletalMeshComponent* UsePawnMesh = MyPawn->GetPawnMesh();
- UseWeaponMesh->AttachTo(UsePawnMesh, AttachPoint);
- UseWeaponMesh->SetHiddenInGame(false);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement