fix: some bugs fixed
Fixed aiming when crouching reset velocity bug. Fixed laying weapon disappearing in some cases.
This commit is contained in:
parent
e1b383b28f
commit
93c5e9d82c
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -114,7 +114,7 @@ void UShootingComponent::PickUpGun(UStaticMeshComponent* PickedGunMesh)
|
|||
{
|
||||
if (IsValid(CurrentGunBase) && IsValid(SecondaryGunBase))
|
||||
DropGun();
|
||||
|
||||
|
||||
FAttachmentTransformRules AttachmentRules(EAttachmentRule::SnapToTarget, EAttachmentRule::SnapToTarget,
|
||||
EAttachmentRule::KeepWorld, true);
|
||||
|
||||
|
|
@ -183,6 +183,7 @@ void UShootingComponent::DropGun()
|
|||
|
||||
CurrentGunMesh->DetachFromComponent(DetachmentRules);
|
||||
CurrentGunMesh->SetSimulatePhysics(true);
|
||||
CurrentGunMesh->SetCollisionResponseToChannel(ECC_Visibility, ECR_Block);
|
||||
CurrentGunMesh->bCastDynamicShadow = true;
|
||||
CurrentGunMesh->CastShadow = true;
|
||||
|
||||
|
|
@ -268,7 +269,9 @@ void UShootingComponent::StartAiming()
|
|||
if (IsValid(CurrentGunBase))
|
||||
{
|
||||
PlayerCharacter->bIsAimingMode = true;
|
||||
PlayerCharacter->GetCharacterMovement()->MaxWalkSpeed = PlayerCharacter->WalkSpeed * AimingMoveSpeedScale;
|
||||
|
||||
if (!PlayerCharacter->bIsCrouchingMode)
|
||||
PlayerCharacter->GetCharacterMovement()->MaxWalkSpeed = PlayerCharacter->WalkSpeed * AimingMoveSpeedScale;
|
||||
|
||||
TargetFOV = CurrentGunBase->AimingFOV;
|
||||
OnStartedADS.Broadcast();
|
||||
|
|
@ -278,7 +281,11 @@ void UShootingComponent::StartAiming()
|
|||
void UShootingComponent::StopAiming()
|
||||
{
|
||||
PlayerCharacter->bIsAimingMode = false;
|
||||
PlayerCharacter->GetCharacterMovement()->MaxWalkSpeed = PlayerCharacter->WalkSpeed;
|
||||
|
||||
if (PlayerCharacter->bIsCrouchingMode)
|
||||
PlayerCharacter->GetCharacterMovement()->MaxWalkSpeed = PlayerCharacter->CrouchSpeed;
|
||||
else
|
||||
PlayerCharacter->GetCharacterMovement()->MaxWalkSpeed = PlayerCharacter->WalkSpeed;
|
||||
|
||||
TargetFOV = DefaultFOV;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user