UCharacterMovementComponent::IsMovementInProgress
#include "GameFramework/CharacterMovementComponent.h"
Access: public
Specifiers: inlineconst
Description
Returns true while a movement update (PerformMovement) is currently executing, guarding against reentrant calls.
Caveats & Gotchas
- • Backed by the internal bMovementInProgress flag, which is only ever true for the duration of PerformMovement() — checking it from elsewhere (e.g. a Tick function) outside that call is meaningless.
- • Exists mainly so movement code can detect reentrant modifications (like SetUpdatedComponent()) made while a move is in progress, not as a general 'is my character moving' check — use MovementMode or Velocity for that.
Signature
bool IsMovementInProgress() const { return bMovementInProgress; } Return Type
bool Example
Guarding against reentrant changes C++
void UMyCharacterMovementComponent::SetUpdatedComponent(USceneComponent* NewUpdatedComponent)
{
checkf(!IsMovementInProgress(), TEXT("Cannot change UpdatedComponent while a move is in progress"));
Super::SetUpdatedComponent(NewUpdatedComponent);
} Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?