UCharacterMovementComponent::GetLastUpdateRequestedVelocity
#include "GameFramework/CharacterMovementComponent.h"
Access: public
Specifiers: UFUNCTIONBlueprintCallableconst
Description
Returns the velocity most recently requested by path following, such as an AI MoveTo request, and consumed during the last movement update.
Caveats & Gotchas
- • Only meaningful for pawns driven by path following (AAIController navigation moves); it stays at zero for player-controlled characters using normal input.
- • The stored value is cleared as it's consumed each update, so reading it well after the last path-following request may just return a stale zero vector.
Signature
FVector GetLastUpdateRequestedVelocity() const Return Type
FVector Example
Check whether path following is currently requesting movement C++
const FVector Requested = GetCharacterMovement()->GetLastUpdateRequestedVelocity();
if (!Requested.IsNearlyZero())
{
UE_LOG(LogTemp, Log, TEXT("Path following requested velocity: %s"), *Requested.ToString());
} Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?