Merge branch 'Animation' into Polishing-Checkpoints

This commit is contained in:
Rafal Swierczek 2024-05-11 11:45:03 +01:00
commit 0fedf8af84
9 changed files with 29 additions and 23 deletions

Binary file not shown.

View File

@ -483,10 +483,10 @@ void AEndlessVendettaCharacter::EquipPrimary()
if (bIsReloading) return;
if (IsValid(PrimaryWeapon))
{
TempUnequippedPrimary();
//TempUnequippedPrimary();
GEngine->AddOnScreenDebugMessage(-1, 15.f, FColor::Red, TEXT("IsPrimaryWeapon valid check running"));
PrimaryWeapon->DetachFromActor(DetatchRules);
PrimaryWeapon->AttachToComponent(FirstPersonArms, AttachmentRules, FName("UnEquipGunSocket"));
//PrimaryWeapon->DetachFromActor(DetatchRules);
//PrimaryWeapon->AttachToComponent(FirstPersonArms, AttachmentRules, FName("UnEquipGunSocket"));
PrimaryWeapon->SetActorHiddenInGame(true);
PrimaryWeapon->SetActorEnableCollision(false);
this->GetFirstPersonCameraComponent()->SetFieldOfView(90);
@ -516,9 +516,11 @@ void AEndlessVendettaCharacter::EquipPrimary()
if (!bIsPrimaryWeaponCreated)
{
PrimaryWeaponActor = GetWorld()->SpawnActor<AActor>(PrimaryWeaponClass, spawnParams);
//PrimaryWeaponActor = GetWorld()->SpawnActor<AActor>(PrimaryWeaponClass, spawnParams);
HeldWeapon->SetChildActorClass(PrimaryWeaponClass);
PrimaryWeaponActor = HeldWeapon->GetChildActor();
GEngine->AddOnScreenDebugMessage(-1, 15.f, FColor::Red, TEXT("Spawning weapon"));
PrimaryWeaponActor->AttachToComponent(FirstPersonArms, AttachmentRules, FName("GripPoint"));
//PrimaryWeaponActor->AttachToComponent(FirstPersonArms, AttachmentRules, FName("GripPoint"));
PrimaryWeapon = Cast<ABaseWeaponClass>(PrimaryWeaponActor);
PrimaryWeapon->SetActorHiddenInGame(false);
PrimaryWeapon->SetActorEnableCollision(false);
@ -531,15 +533,17 @@ void AEndlessVendettaCharacter::EquipPrimary()
if (PrimaryWeaponClass != nullptr)
{
GEngine->AddOnScreenDebugMessage(-1, 15.f, FColor::Green, TEXT("non ifstatement code running"));
PrimaryWeaponActor->AttachToComponent(FirstPersonArms, AttachmentRules, FName("GripPoint"));
//PrimaryWeaponActor->AttachToComponent(FirstPersonArms, AttachmentRules, FName("GripPoint"));
HeldWeapon->SetChildActorClass(PrimaryWeaponClass);
PrimaryWeaponActor = HeldWeapon->GetChildActor();
PrimaryWeapon = Cast<ABaseWeaponClass>(PrimaryWeaponActor);
PrimaryWeapon->SetActorHiddenInGame(false);
PrimaryWeapon->SetActorEnableCollision(false);
GetWorldTimerManager().ClearTimer(PrimaryWeapon->reloadTimerHandle);
//GetWorldTimerManager().ClearTimer(PrimaryWeapon->reloadTimerHandle);
bIsCurrentlyHoldingWeapon = true;
bHasRifle = true;
SetOverlayState(EOverlayState::AssaultRifle);
TempEquippedPrimary();
//TempEquippedPrimary();
EquippedWeapon.Broadcast();
}
}
@ -594,6 +598,8 @@ void AEndlessVendettaCharacter::EquipSecondary()
}
if (SecondaryWeaponClass != nullptr)
{
HeldWeapon->SetChildActorClass(SecondaryWeaponClass);
SecondaryWeaponActor = HeldWeapon->GetChildActor();
SecondaryWeapon = Cast<ABaseWeaponClass>(SecondaryWeaponActor);
SecondaryWeapon->SetActorHiddenInGame(false);
bIsCurrentlyHoldingWeapon = true;