Made guns stay onto player but attach below the legs
This commit is contained in:
parent
f8aee1c58a
commit
64f17d7835
@ -361,8 +361,9 @@ void AEndlessVendettaCharacter::EquipPrimary()
|
|||||||
if (IsValid(PrimaryWeapon))
|
if (IsValid(PrimaryWeapon))
|
||||||
{
|
{
|
||||||
PrimaryWeapon->DetachFromActor(DetatchRules);
|
PrimaryWeapon->DetachFromActor(DetatchRules);
|
||||||
PrimaryWeapon->SetActorLocation(FVector(0, 0, 0), false, nullptr, ETeleportType::None);
|
PrimaryWeapon->AttachToComponent(Mesh1P, AttachmentRules, FName("UnEquipGunSocket"));
|
||||||
PrimaryWeapon->SetActorHiddenInGame(true);
|
PrimaryWeapon->SetActorHiddenInGame(true);
|
||||||
|
PrimaryWeapon->SetActorEnableCollision(false);
|
||||||
this->GetFirstPersonCameraComponent()->SetFieldOfView(90);
|
this->GetFirstPersonCameraComponent()->SetFieldOfView(90);
|
||||||
UE_LOG(LogTemp, Warning, TEXT("Primary Weapon Is Hidden: %hhd"), PrimaryWeapon->IsHidden());
|
UE_LOG(LogTemp, Warning, TEXT("Primary Weapon Is Hidden: %hhd"), PrimaryWeapon->IsHidden());
|
||||||
PrimaryWeapon = nullptr;
|
PrimaryWeapon = nullptr;
|
||||||
@ -414,9 +415,9 @@ void AEndlessVendettaCharacter::EquipSecondary()
|
|||||||
if (bIsReloading) return;
|
if (bIsReloading) return;
|
||||||
if (IsValid(SecondaryWeapon))
|
if (IsValid(SecondaryWeapon))
|
||||||
{
|
{
|
||||||
SecondaryWeapon->DetachFromActor(DetatchRules);
|
SecondaryWeapon->AttachToComponent(Mesh1P, AttachmentRules, FName("UnEquipGunSocket"));
|
||||||
SecondaryWeapon->SetActorLocation(FVector(0, 0, 0), false, nullptr, ETeleportType::None);
|
|
||||||
SecondaryWeapon->SetActorHiddenInGame(true);
|
SecondaryWeapon->SetActorHiddenInGame(true);
|
||||||
|
SecondaryWeapon->SetActorEnableCollision(false);
|
||||||
this->GetFirstPersonCameraComponent()->SetFieldOfView(90);
|
this->GetFirstPersonCameraComponent()->SetFieldOfView(90);
|
||||||
UE_LOG(LogTemp, Warning, TEXT("Secondary Weapon Is Hidden: %hhd"), SecondaryWeapon->IsHidden());
|
UE_LOG(LogTemp, Warning, TEXT("Secondary Weapon Is Hidden: %hhd"), SecondaryWeapon->IsHidden());
|
||||||
SecondaryWeapon = nullptr;
|
SecondaryWeapon = nullptr;
|
||||||
|
Loading…
Reference in New Issue
Block a user