RealDocs

UCharacterMovementComponent::IsMovingOnGround

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

Description

Returns true if the character is currently in Walking or NavWalking movement mode. Use this to gate ground-only actions like crouching or grounded attacks rather than checking velocity.

Signature

virtual bool IsMovingOnGround() const override

Return Type

bool

Caveats & Gotchas

  • Returns false during jumps, falling, flying, and swimming — it is strictly a ground-mode check, not a 'touching the floor' check.
  • To check whether the character is physically touching a surface, use IsWalkable() on the floor hit result instead.
  • Will return false during the brief coyote-time window after walking off a ledge before MOVE_Falling is set — if that gap matters, combine with a velocity Z check.

Example

Allow jump only when grounded C++
void AMyCharacter::TryJump()
{
    if (GetCharacterMovement()->IsMovingOnGround())
    {
        Jump();
    }
}

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.