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.