# Read value of Vive Controller Trigger Axis in C++ ; UE4.20 VR

**URL:** <https://forums.unrealengine.com/t/read-value-of-vive-controller-trigger-axis-in-c-ue4-20-vr/434812>\
**Category:** XR Development\
**Tags:** axis-mappings, VR-Vive, unreal-engine, question, CPP\
**Created:** [October 1, 2018, 8:48am UTC](https://forums.unrealengine.com/t/read-value-of-vive-controller-trigger-axis-in-c-ue4-20-vr/434812 "2018-10-01T08:48:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Constantin\_Suman](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Constantin\_Suman](https://forums.unrealengine.com/u/Constantin_Suman)\
**Post date:** [October 1, 2018, 8:48am UTC](https://forums.unrealengine.com/t/read-value-of-vive-controller-trigger-axis-in-c-ue4-20-vr/434812/1 "2018-10-01T08:48:35Z")

</div>

I’m trying to read the value of the vive controller trigger axis in C++.

I have mapped several names in the settings-\>Axis Mappings:

ThumbstickRightX → MotionController (R) Thumbstick X  
ThumbstickRightY → MotionController (R) Thumbstick Y  
TriggerRightAxisValue → MotionController (R) TriggerAxis

Here’s a piece of DefaultInput.ini:

+AxisMappings=(AxisName=“ThumbstickRightX”,Key=MotionController\_Right\_Thumbstick\_X,Scale=1.000000)  
+AxisMappings=(AxisName=“ThumbstickRightY”,Key=MotionController\_Right\_Thumbstick\_Y,Scale=1.000000)  
+AxisMappings=(AxisName=“TriggerRightAxisValue”,Key=MotionController\_Right\_TriggerAxis,Scale=1.000000)

The problem:  
when calling:

float axisValue = InputComponent-\>GetAxisValue(TEXT(“ThumbstickRightX”));

I get a correct X value of the touchpad of the vive controller.

when calling:

float axisValue = InputComponent-\>GetAxisValue(TEXT(“TriggerRightAxisValue”));

I get an error:  
LogPlayerController: Warning: Request for value of axis ‘TriggerRightAxisValue’ returning 0 as it is not bound on this input component.

In blueprints the value is correctly accessed by “Get MotionController (R) TriggerAxis”, and, as I understand, this does not rely on the mapping (bounding) name “TriggerRightAxisValue”  
What am I missing?  
Why do I get the error and how to fix it?

Restarting/Rebuilding doesn’t work.
