Advertisement
Guest User

Untitled

a guest
Feb 6th, 2016
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.73 KB | None | 0 0
  1. void AAWBaseWeapon::AttachMeshToPawn()
  2. {
  3.     if (MyPawn)
  4.     {
  5.         DetachMeshFromPawn();
  6.  
  7.         FName AttachPoint = MyPawn->GetWeaponAttachPoint();
  8.         if (MyPawn->IsLocallyControlled() == true)
  9.         {
  10.             USkeletalMeshComponent* PawnMesh1P = MyPawn->GetMesh1P();
  11.             USkeletalMeshComponent* PawnMesh3P = MyPawn->GetMesh();
  12.             Mesh1P->SetHiddenInGame(false);
  13.             Mesh3P->SetHiddenInGame(false);
  14.             GetMesh1P()->AttachTo(PawnMesh1P, AttachPoint);
  15.             GetMesh3P()->AttachTo(PawnMesh3P, AttachPoint);
  16.         }
  17.         else
  18.         {
  19.             USkeletalMeshComponent* UseWeaponMesh = GetWeaponMesh();
  20.             USkeletalMeshComponent* UsePawnMesh = MyPawn->GetPawnMesh();
  21.             UseWeaponMesh->AttachTo(UsePawnMesh, AttachPoint);
  22.             UseWeaponMesh->SetHiddenInGame(false);
  23.         }
  24.     }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement