{ }Blueprint → C++

Unreal Engine 5 · Blueprint → C++

Read Input Action Value in Unreal Engine 5 C++UE Docs

Reading an Input Action Value in C++ uses the templated FInputActionValue::Get<T>(). You pick FVector2D, float, or bool to match the Input Action's Value Type, then use the result inside your bound handler.

Blueprint node & C++ equivalent

C++
#include "InputActionValue.h"

void AMyCharacter::Move(const FInputActionValue& Value)
{
  // Pick the type that matches the Input Action's Value Type:
  FVector2D Axis2D = Value.Get<FVector2D>();   // Axis2D
  float Axis1D     = Value.Get<float>();        // Axis1D
  bool bPressed    = Value.Get<bool>();         // Digital (bool)
}

What does the Get value node do?

Enhanced Input passes a FInputActionValue to every bound function, and this is how you extract the raw value. The struct stores the data generically, so you call Get<T>() with the type that matches the action's configured Value Type. Reading the wrong type returns a zeroed or truncated result rather than the data you expect.

The C++ equivalent

Include InputActionValue.h and call Value.Get<FVector2D>() for an Axis2D action, Value.Get<float>() for Axis1D, or Value.Get<bool>() for a Digital action. For example, FVector2D Axis2D = Value.Get<FVector2D>(); gives you the X and Y of a movement stick. The type must line up with the Value Type set on the UInputAction asset.

Common mistakes

The most frequent bug is reading Get<FVector2D>() from an action configured as Axis1D, which discards the data you wanted. Always match the template argument to the asset's Value Type. A Digital action read as float returns 1.0 or 0.0, which is sometimes useful but is not the intended bool semantics.

Frequently asked questions

How do I get a FVector2D from an Input Action in C++?+

Call Value.Get<FVector2D>() on the FInputActionValue passed to your handler. The action's Value Type must be Axis2D for this to return meaningful X and Y components.

What header do I need for FInputActionValue?+

Include InputActionValue.h. It declares the FInputActionValue struct and the templated Get<T>() accessor.

Why is my input value always zero?+

The template type passed to Get<T>() likely does not match the Input Action's Value Type. An Axis1D action read as FVector2D, or vice versa, returns zeroed components.

Related Input (Enhanced Input) nodes

View all Input (Enhanced Input) nodes →