APawn::Internal_AddMovementInput
#include "GameFramework/Pawn.h"
Access: public
Description
Low-level function that directly accumulates into the internal ControlInputVector, bypassing the public AddMovementInput virtual dispatch. Intended for use only within Pawn subclasses or PawnMovementComponent implementations.
Caveats & Gotchas
- • The comment in the header explicitly states this is 'meant for use only within Pawn or by a PawnMovementComponent'. Calling it from general game code instead of AddMovementInput() skips subclass overrides and may break expected behaviour.
- • The accumulated value is in world space and is not normalized. If you call this multiple times per frame the vectors are summed, which can produce a total magnitude greater than 1 — movement components are expected to clamp or normalize on consumption.
- • Unlike AddMovementInput, there is no UFUNCTION macro on this method, so it cannot be called from Blueprint.
Signature
ENGINE_API void Internal_AddMovementInput(FVector WorldAccel, bool bForce = false); Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| WorldAccel | FVector | Direction and magnitude of the movement input in world space. | — |
| bForce | bool | If true, adds the input even when IsMoveInputIgnored() returns true. | false |
Return Type
void Example
Inject a bias direction inside a custom PawnMovementComponent C++
void UMyMovementComponent::TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction)
{
Super::TickComponent(DeltaTime, TickType, ThisTickFunction);
// Inject an additional directional bias before consuming input
if (bApplyCurrentBias)
{
PawnOwner->Internal_AddMovementInput(CurrentBiasDirection * BiasMagnitude, /*bForce=*/true);
}
FVector Input = PawnOwner->Internal_ConsumeMovementInputVector();
ApplyMovement(Input, DeltaTime);
} See Also
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?