RealDocs

AActor::GetVelocity

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

Description

Returns the velocity of the actor in cm/s. For actors with a physics root component, returns the physics linear velocity; for pawns, UCharacterMovementComponent overrides this to return the movement component's velocity.

Caveats & Gotchas

  • Returns FVector::ZeroVector for actors that are neither simulating physics nor have a movement component — it does not automatically compute velocity from position delta.
  • Characters override this via UCharacterMovementComponent::GetVelocity(), so the returned vector is the movement component's velocity, not the raw physics body velocity. These can differ when the character is being pushed by physics.

Signature

ENGINE_API virtual FVector GetVelocity() const

Return Type

FVector

Examples

Detect whether the actor is moving and print a message Blueprint
Event Tick Delta Seconds Delta Seconds Branch Condition Condition True False Print String In String Actor is moving! Actor is moving! Get Velocity Target is Actor Return Value Return Value Vector Length A Return Value Return Value > A B 10.0 Return Value Return Value
Edit Blueprint graph Detect whether the actor is moving and print a message
Drag node headers to move · Drag from an output pin to an input pin to connect · Scroll to zoom · Right-click for actions
Check if actor is moving C++
FVector Vel = GetVelocity();
if (Vel.SizeSquared() > FMath::Square(10.f))
{
    // Actor is moving
}

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.