Create GetCrouched method in PlayerCharacter

This commit is contained in:
baz 2024-02-01 00:53:01 +00:00
parent afc30330a7
commit 957da3946a
2 changed files with 13 additions and 0 deletions

View File

@ -759,3 +759,13 @@ bool APlayerCharacter::GetPressedJump()
{ {
return jumpPressed; return jumpPressed;
} }
bool APlayerCharacter::GetCrouched()
{
if (UNakatomiCMC* cmc = GetCharacterMovementComponent())
{
return cmc->IsCrouching();
}
return false;
}

View File

@ -221,6 +221,9 @@ public:
UFUNCTION(BlueprintCallable) UFUNCTION(BlueprintCallable)
bool GetPressedJump(); bool GetPressedJump();
UFUNCTION(BlueprintCallable)
bool GetCrouched();
protected: protected:
virtual void CalculateHits(TArray<FHitResult>* hits) override; virtual void CalculateHits(TArray<FHitResult>* hits) override;