How to achieve function params injection

Hi friends,
i’ve noticed an interesting code in Unreal’s third person template.

	/** Called for movement input */
	void Move(const FInputActionValue& Value);
	/** Called for looking input */
	void Look(const FInputActionValue& Value);

Both function has a FInputActionValue Ref param,not inherited from parent class.
But looks like the ref param can provide realtime input data like the code blow

void ASomeProjectCharacter::Move(const FInputActionValue& Value)
{
	// input is a Vector2D
	FVector2D MovementVector = Value.Get<FVector2D>();
}

So where do these data from?
And how can i make myself a custom function param injection?

Liking let all function params named *AMyCustomCharacter MyCharPtr are injected with
the only character instance so i have no need to call get player controller to get player reference anymore.

Hi, void _Func(const FInputActionValue& Value) is the required signature for binding functions to actions. The source of UEnhancedInputComponent::BindAction is mostly generated by macros, so mostly it used as (UEnhancedInputComponent*)->BindAction(action, ETriggerEvent::Triggered, this, &YourClass::YourFunction).
The advanced work in c++ with input, mapping contexts, and actions isn’t that simple, and in most cases, it’s sufficient to just create high-level logic blueprint callable functions in c++ and just call it by events in the blueprint graph.

If you look at the source, FInputActionValue is a trivial container for an input value. It contains the value provided by Action into FVector, where insufficient values are just zero. For retrieving stored value Get<float/FVector2D/FVector>() is used.

And the last part with injecting, if I understand right, you want all functions with parameter AMyCustomCharacter* MyCharPtr to always automatically contain a pointer to your instanced character? If that is so, it’s impossible. The parameter is the parameter and needs to be provided on call. In that situation, the simplest (and dirty) solution would be to create a static public pointer variable in your character class and assign it in BeginPlay(). After that just use AMyCustomCharacter::MyCharPtr everywhere.