{ }Blueprint → C++

Unreal Engine 5 · Blueprint → C++

Get Velocity in Unreal Engine 5 C++UE Docs

The Get Velocity Blueprint node maps to AActor::GetVelocity() in Unreal Engine 5 C++, returning an FVector whose Size() gives the current speed.

Blueprint node & C++ equivalent

C++
FVector Velocity = GetVelocity();
float Speed = Velocity.Size();

What does the Get Velocity node do?

Get Velocity returns the actor's current world-space velocity as an FVector. For characters this reflects the movement produced by the character movement component. It is commonly used to drive locomotion animation blendspaces or to gate abilities behind a speed threshold.

In the example, GetVelocity() returns the vector and Velocity.Size() collapses it to a scalar speed in units per second.

How to use it in C++

Call GetVelocity() on any AActor, including pawns and characters. Use Size() for the full 3D speed, or Size2D() when you want horizontal speed only, ignoring vertical motion such as falling. The resulting float is convenient for animation graph variables and movement state checks.

For performance-sensitive comparisons, SizeSquared() avoids the square root when you only need to compare against a threshold.

Frequently asked questions

How do you get a character's speed in UE5 C++?+

Call GetVelocity() to get the velocity vector, then Size() for full speed or Size2D() for horizontal-only speed.

What is the difference between Size and Size2D for velocity?+

Size() includes vertical velocity such as falling, while Size2D() measures only the horizontal X/Y speed, which is usually preferred for locomotion.

Related Character & Pawn nodes

View all Character & Pawn nodes →