RealDocs

UCharacterMovementComponent::IsCrouching

function Engine Since 4.0
#include "GameFramework/CharacterMovementComponent.h"
Access: public Specifiers: virtualconstoverride

Description

Returns whether the owning character is currently crouched, delegating to ACharacter::IsCrouched().

Caveats & Gotchas

  • Returns false if there is no CharacterOwner, so calling it on a movement component without an owning ACharacter (e.g. mid-construction) is safe but always false.
  • Reflects the replicated bIsCrouched state on the Character, not MovementMode — a character can be crouching while MOVE_Walking or MOVE_NavWalking.

Signature

virtual bool IsCrouching() const override

Return Type

bool

Example

Checking crouch state C++
if (GetCharacterMovement()->IsCrouching())
{
    // Lower the camera and play the crouch idle animation
}

Version History

Introduced in: 4.0

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.