How do I get a InputAction's value.

For example, IA_Interact is assigned with “E”, is there a way to get the “E” as a string?


This is the macro I prepared for this function.

I can deal with C++ a little, as I am new to Unreal.

Any help would be appreciated. Thank you!

PS. I have had a fight with C++ before, so if you can avoid it, please use the blueprint.

in C++ the value is packaged in the struct, so this would be trivial.
in blueprints from just the Input Action I can’t find any (I believe this has to do with given an EnhancedInputAction_Event the Value is right there in the specific form ready to use)
getting the name of the event is GetDisplayName().

if you want the actual Value then you would need pass that into your macro/function, but it could be a bool, float, Vector2D, or Vector3D. The Float and Vector2D would need some care to send as a Vector3D. A Bool is either 0 or 1 so you could package that into one of the components of a Vector3D if you really wanted (just remember when reading floats against absolute values to use greater than and less then some different value),
Then in the receiver use the GetValueType from the Input action to figure out what and how to read the vector being passed.

I think maybe this is what you looking for.

How do I get the string?

This would write all inputs mapped to that actions as array


If you need a specific one, simply you can,

you can choose which input index you want as array index.

the direct answer to your question appears to be: to get an InputActions.Value in Blueprints, requires having access to the player controller, and parsing through an array across the entire controller.
in C++ the Value is in the struct, but must be cast to the necessary type,
probably meaning for simplicity of using the system in Blueprints the value is provided directly from the event and is not accessible from the Struct.

if you pipe the value directly from the event into the function/macro all of the data types have direct string conversions. (some of them are more pretty then others)
by piping the value in directly even with doing hand conversions to Vector3 you don’t need to go grab the controller, the entire subsystem, or parse an array just to grab a value that is right there already, and 3 floats by copy, or 1 stack address width by reference, is going to be cleaner to transport and work with.

a string is easier to read by humans, but harder to use by any given system: larger to store, needs to be heavily parsed, and inconsistent across platforms and written languages.

if the goal is to pass the Input Actions and its Value to another entity, a behavior tree, or a self made AI system, for what is probably going to be input reading; why do all of them need to have direct access to any given PlayerController (for multiplayer are you checking each one?), or even the entire Input Subsystem, when you can just pass the Value directly.
whether it is unpacked from a Vector3 refined down by ValueType enum, or 4 different functions (1 for each data type); if you didn’t want to do the conversion,
either way using the DisplayName to determine what input happened.
which all presumes you are not feeding into an arbitrary function for each input.