RealDocs

APawn::Internal_GetPendingMovementInputVector

function Engine Since 4.0
#include "GameFramework/Pawn.h"
Access: public Specifiers: inline

Description

Returns the raw ControlInputVector without consuming it. This is the direct accessor for the protected member that accumulates AddMovementInput calls, intended for PawnMovementComponent internals.

Caveats & Gotchas

  • Reading the vector via this function does not clear it. Only Internal_ConsumeMovementInputVector() (or ConsumeMovementInputVector()) resets the accumulator to zero. If you read this in multiple places per frame you will see the same accumulated value each time.
  • The public equivalent GetPendingMovementInputVector() is a UFUNCTION exposed to Blueprint. Prefer that function from game code; this internal version is intended for movement component implementers.
  • The value is in world space and is not normalized — it may have magnitude greater than 1 if multiple AddMovementInput calls were made in the same frame.

Signature

inline FVector Internal_GetPendingMovementInputVector() const { return ControlInputVector; }

Return Type

FVector

Example

Inspect pending input in a custom movement component before consuming C++
void UMyMovementComponent::TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction)
{
	Super::TickComponent(DeltaTime, TickType, ThisTickFunction);
	const FVector PendingInput = PawnOwner->Internal_GetPendingMovementInputVector();
	if (!PendingInput.IsNearlyZero())
	{
		FVector ConsumedInput = PawnOwner->Internal_ConsumeMovementInputVector();
		ApplyMovement(ConsumedInput, DeltaTime);
	}
}

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.