RealDocs

UCharacterMovementComponent::RequestDirectMove

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

Description

Called by path following to request a specific velocity for this tick, used for direct moves like jumping to a nav link or falling toward a destination.

Caveats & Gotchas

  • Ignored if MoveVelocity's squared size is below UE_KINDA_SMALL_NUMBER — near-zero requests are treated as no request at all.
  • If ShouldPerformAirControlForPathFollowing() returns true (by default, whenever IsFalling()), this delegates to PerformAirControlForPathFollowing() instead of setting RequestedVelocity directly, so falling characters respond differently to direct-move requests than grounded ones.
  • When moving on the ground, the requested velocity is projected onto the walkable floor plane before being applied.

Signature

virtual void RequestDirectMove(const FVector& MoveVelocity, bool bForceMaxSpeed) override

Parameters

Name Type Description Default
MoveVelocity const FVector& Desired world-space velocity requested by path following.
bForceMaxSpeed bool If true, the requested velocity's magnitude is treated as the max speed to move at rather than a literal velocity.

Return Type

void

Example

Requesting a direct move from custom path following C++
void UMyPathFollowingComponent::FollowFallToTarget(const FVector& TargetVelocity)
{
    if (UCharacterMovementComponent* MoveComp = Cast<UCharacterMovementComponent>(GetOwner()->GetMovementComponent()))
    {
        MoveComp->RequestDirectMove(TargetVelocity, false);
    }
}

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.