Get Gamepad Thumbstick X/Y axis function in C++

Hey guys ,I’ve been trying to find a C++ function that matches a blueprint node:

269206-gpad.png

I’ve tried calling a few functions in C++:

 float avalue = GetInputAxisValue("MoveRight");
 float bvalue = InputComponent->GetAxisValue("MoveRight");

The thing is that I get a value between 0 or 1 and the blueprint node actually returns the ax and how pressed is it, so if you’re holding the stick halfway in the X, you’ll get 0.5f instead of 1.

Thank you in advance! :slight_smile:

“MoveRight” is Axis or Action Bound?

It is axis bound.

Bind some Function to “MoveRight” Axis Event

    PlayerInputComponent->BindAxis("MoveRight", this, &MyCharacter::MoveRight);

Print Value to Log:

    void MyCharacter::MoveRight(float Value)
    {
    	UE_LOG(LogTemp, Warning, TEXT("%f"), Value);
    }

This prints the Values you need