Input axis returns 0 in Blueprint function, but works in EventGraph

When I set up the following in the EventGraph of my Controller Blueprint, it prints out the value just fine:

8333-eventgraphsetup.png

However, if I instead create a function like so and then call that, Get MoveX always returns 0:

8334-printx.png

This is the only place that MoveX is accessed, and turning ‘consume input’ on and off does nothing.

I feel like I must be missing something incredibly basic here, please help me access my axis inputs from inside a blueprint function.

I should also note that I cannot pass the value from the EventGraph to the function directly as this function needs to be called from another blueprint.

The way I was able to resolve this was to access the input axes in the EventGraph first (I just print their values on beginplay), which seems to initialize them or something which allows them to be used inside functions.

11253-init.png

Seems like a bit of a hack, and I would like to understand why I need to do this, but hopefully this helps someone else who got stuck.

Dammit I spent two hours yesterday trying to find out what was wrong with my blueprint. When I figured out through debugging that my all my axis return 0, I almost instantly found this post…
So, same solution here: had to move getting axis values to event graph.

This no longer seems to be an issue in more current versions of the engine, but I guess this is the solution if you are working in a version before it was fixed.