Issue with value from Trigger input (LT & RT)

Hello, I try to get the value from left and right trigger on a gamepad but I got an issue. The value is well set (its value depend on how I press the trigger) but when I release the input it’s not set to 0. I try the same thing with shoulder input (LB & RB) and it works well, because it is only 1 and 0 I think.

I must have done an error somewhere in the configuration, there is what I have currently :
5211536--518852--upload_2019-11-25_18-16-15.png
5211536--518855--upload_2019-11-25_18-16-27.png
5211536--518858--upload_2019-11-25_18-16-40.png

I would like to know this too. In the debugger it displays 2 actions for the same button. "Trigger’ and “Triggerbutton” where “Trigger” regards sensitivity and “Triggerbutton” goes from 0 to 1 and reverse.

I don’t really know where to make the distinction, but they do interfere and the value doesn’t go back to 0 on release.

Darn, I could’ve sworn I typed up a replay to this. No idea where it went. Alas, here we go.

So, on one hand, this is expected behavior. On the other, it’s certainly not desired behavior and I’ll go have a look.

If you poll the action instead (e.g. playerInput.actions[“down”].ReadValue()), you’ll probably get the expected result but on this path, you’ll indeed end up with an undesirable input value.

Your configuration should be fine. To explain what’s happening, the problem is indeed a peculiarity specific to controls like triggers that can behave like binary buttons (i.e. on/1 or off/2) but are indeed full axes (i.e. full range of [0…1]).

For these controls, the system uses a configurable “press point” threshold to decide whether the control is considered pressed or not. However, that means that the actual value of the control will very likely not be 1 when it is “pressed” and very likely will not be 0 either when it is not “pressed”.

When having access to InputAction.CallbackContext (which, when using the message-based API is not accessible), it’s possible to distinguish the two based on the context but regardless, no matter where the input is tapped, I think one should not have to be aware of all this.

My thinking is that if the action type is set to “Button”, you should get clean 1 and 0 values regardless of the behavior of the underlying control whereas if the action type is set to “Value”, you should get the value from the control as is. But let me have a more thorough look.

Thanks for clarifying this. If I set the action type to button however, the value still doesn’t go back to 0 at all. Setting the press point to 1 fixes the problem temporarily but I’m assuming this will get fixed in the future ?

I eventually suceed to make it works.
For it I used two differents actions :
5249966--524525--upload_2019-12-5_17-13-11.png
UpTrigger configuration :
5249966--524528--upload_2019-12-5_17-13-42.png
UpTriggerRelease configuration :
5249966--524531--upload_2019-12-5_17-14-4.png
And the piece of code which uses that :
5249966--524534--upload_2019-12-5_17-15-10.png