Add extra checking to Expand Crosshair functionality
This commit is contained in:
parent
9ece07b011
commit
c944e5e6f9
|
@ -20,12 +20,14 @@ void UPlayerHUDWidget::ExpandCrosshair()
|
|||
{
|
||||
if (CrosshairFired)
|
||||
{
|
||||
auto player = Cast<APlayerCharacter>(UGameplayStatics::GetPlayerCharacter(GetWorld(), 0));
|
||||
if (auto player = Cast<APlayerCharacter>(UGameplayStatics::GetPlayerCharacter(GetWorld(), 0)))
|
||||
{
|
||||
float playbackSpeed = 1.0 / player->GetCurrentWeapon()->GetWeaponProperties()->WeaponCooldown;
|
||||
|
||||
PlayAnimation(CrosshairFired, 0.0f, 1, EUMGSequencePlayMode::Forward, playbackSpeed);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void UPlayerHUDWidget::ShowHitMarker()
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue