RealDocs

APawn::AddMovementInput

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

Description

Accumulates a world-space movement direction into the pawn's input vector. For base APawn, movement is not applied automatically — the pawn or its movement component must call ConsumeMovementInputVector() in Tick. Subclasses like ACharacter handle this automatically.

Caveats & Gotchas

  • On base APawn (not ACharacter), calling this does nothing visible unless you manually read and apply the input vector in your Tick or movement component. The input accumulates in ControlInputVector but no movement occurs automatically.
  • Input is ignored by default if the controller has bIgnoreMoveInput set. Use bForce=true only when you intentionally want to bypass this, such as for scripted movement that should not be blockable by game logic.

Signature

virtual void AddMovementInput(FVector WorldDirection, float ScaleValue = 1.0f, bool bForce = false);

Parameters

Name Type Description Default
WorldDirection FVector Direction in world space to apply input. Usually normalized.
ScaleValue float Scale applied to the direction vector. Negative values reverse direction. Analog input uses values between -1 and 1. 1.0f
bForce bool If true, add input even when IsMoveInputIgnored() returns true. false

Return Type

void

Examples

Drive the pawn forward every tick along its facing direction Blueprint
Event Tick Delta Seconds Delta Seconds Add Movement Input Target is Pawn Target World Direction Scale Value 1.0 Force false Get Actor Forward Vector Target is Actor Target Return Value
Edit Blueprint graph Drive the pawn forward every tick along its facing direction
Drag node headers to move · Drag from an output pin to an input pin to connect · Scroll to zoom · Right-click for actions
Move forward based on controller rotation C++
void AMyPawn::MoveForward(float Value)
{
	if (Controller && Value != 0.0f)
	{
		const FRotator Rotation = Controller->GetControlRotation();
		const FRotator YawRotation(0, Rotation.Yaw, 0);
		const FVector Direction = FRotationMatrix(YawRotation).GetUnitAxis(EAxis::X);
		AddMovementInput(Direction, Value);
	}
}

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.