Hello,
I am feeding a value with a gamepad trigger.
I am using action.perform to get the value. The thing is that I am not getting the zero value when I release the trigger. I asume that this is the expected behaviour.
My question is, what would be the right way to do this?
I am doing this:
public override void SubscribeCallbacks()
{
Action.performed += UpdateValue;
}
private void UpdateValue(InputAction.CallbackContext context)
{
component.Set(context.ReadValue<float>());
}
Option A, subscribing to the other callbacks
public override void SubscribeCallbacks()
{
Action.performed += UpdateValue;
Action.start+= UpdateValue;
Action.cancel+= UpdateValue;
}
private void UpdateValue(InputAction.CallbackContext context)
{
component.Set(context.ReadValue<float>());
}
Option B, polling directly against the action in the Update loop
private void Update()
{
component.Set(action.ReadValue<float>());
}
Further Information:
This is the values I get from perfom callback. See as I can get 1 value, but not 0 value

Raw Values, time vs input
14,6935631967935;0,0627451
14,7105704452933;0,6784314
14,7275780885484;1
14,8797022280796;0,427451
15,0668719658115;0,2352941
15,0838796090666;0,6392157
15,1008694883276;1
15,2538482733798;0,627451
15,2708669697877;0,06666667
15,4410034051616;0,07058824
15,4580240753439;0,3803922
15,4750218497138;0,9294118
15,4919951492466;1
15,6451721015274;0,5294118
15,849248819879;0,2431373
15,8663105446303;0,7647059
15,8833248987266;1
16,0024269564292;0,6745098
16,0193734125914;0,1372549
16,5125413802398;0,01176471
16,5295063899066;0,03529412
16,5464840317491;0,05882353
16,5635915481289;0,06666667
16,5805352410025;0,08235294
16,5975444632804;0,09803922
16,6145655282198;0,1215686
16,6315704081862;0,1333333
16,6485910783704;0,1529412
16,6655904317613;0,172549
16,6826059701234;0,1882353
16,6996132186232;0,1960784
16,7166291517424;0,2156863
16,7336320579325;0,2392157
16,750645227763;0,2745098
16,7676627399032;0,3098039
16,7846431450344;0,3333333
16,8016697365492;0,3490196
16,8178314189008;0,3607843
16,8348177453645;0,3843137
16,8518313099503;0,4
16,8688350056491;0,4196078
16,885832780019;0,454902
16,9028735827287;0,5176471
16,9198642515003;0,5686275
16,9368947905714;0,5960785
16,9538744061902;0,6352941
16,9709061295271;0,6941177
16,9879339053095;0,7607843
17,0049656286446;0,8235294
17,0219630082593;0,8588235
17,0389931525733;0,9294118
17,0560079014267;0,9803922
17,0729910698428;1
17,6344237004851;0,9254902
17,6514131849908;0,8470588
17,6684164859362;0,7843137
17,6854616309556;0,6901961
17,7024203245383;0,682353
17,7194196779292;0,6784314
17,7534748347371;0,6745098
17,7705144531828;0,6705883
17,787510648528;0,6745098
17,8725962354565;0,6705883
17,8895537447697;0,6745098
18,0086881724164;0,6509804
18,0256958156733;0,6392157
18,0426817473781;0,6352941
18,0596964962315;0,627451
18,0767084817962;0,6196079
18,0937236254031;0,6
18,1107399532775;0,5843138
18,1277752294136;0,5764706
18,1447935310662;0,5686275
18,1617707781515;0,5607843
18,1788068437982;0,5529412
18,1957734324878;0,5372549
18,2128039715553;0,5254902
18,2298167466324;0,4980392
18,2468389958394;0,4588235
18,2638379544733;0,4392157
18,2808507295485;0,4235294
18,2978749525319;0,4196078
18,3149165447539;0,4117647
18,3318866862428;0,4078431
18,3489191990884;0,3960784
18,3659485538938;0,3882353
18,3999673932012;0,3764706
18,4169620095254;0,3647059
18,4340004437054;0,3568628
18,4509579530204;0,3411765
18,4673296452656;0,3372549
18,4843041290642;0,3294118
18,5013334838677;0,2941177
18,5183379690789;0,2431373
18,5354154840461;0,2078431
18,5523311492834;0,1882353
18,5693901107443;0,1686275
18,5863803847606;0,1568628
18,6034105290746;0,1333333
18,62041383002;0,1137255
18,6374234470532;0,1019608
18,6544520123462;0,06666667
18,6714450496493;0,04705882
19,3688456640466;0,01568628
19,3858927828442;0,03137255
19,4029410859093;0,05882353
19,4199108326429;0,07450981
19,4369433454904;0,09803922
19,4539292771969;0,1254902
19,4709341571634;0,1490196
19,4879654857432;0,1647059
19,5049853664168;0,1764706
19,5219551131486;0,1921569
19,5559609255288;0,1960784
19,5729618579408;0,2039216
19,5899387102727;0,2235294
19,6069585909445;0,2470588
19,6240333426231;0,2666667
19,6409959837583;0,2901961
19,6580182329653;0,3294118
19,6750179811097;0,3411765
19,6920244401008;0,3764706
19,7090277410443;0,3960784
19,7260369633204;0,4352941
19,7430525016844;0,454902
19,7601079103461;0,4745098
19,7770752885481;0,4784314
19,7940908269102;0,4823529
19,8110858379914;0,4901961
19,8281613791823;0,5019608
19,8451366524914;0,5215687
19,8621387691692;0,5372549
19,879129832696;0,5411765
19,913175515374;0,5450981
19,930161841834;0,5686275
19,9471923809051;0,5843138
19,964207919269;0,6078432
19,9812135887478;0,6352941
19,9982559704786;0,6745098
20,0152426916957;0,7058824
20,0322937580495;0,7254902
20,0492753474446;0,7450981
20,0662825959444;0,7647059
20,0832949762644;0,7921569
20,1002828817473;0,8235294
20,1173465802749;0,8392157
20,1343558025492;0,8588235
20,1513654195824;0,8666667
20,1683762208813;0,8745098
20,1853613630756;0,8862745
20,2024057185863;0,9294118
20,219443363254;0,945098
20,2364324530026;0,9568627
20,2533879885395;0,9882353
20,2704260279643;1
20,9849594230891;0,9960784
21,001952460394;0,9568627
21,0190220802506;0,9254902
21,0359941955157;0,8745098
21,0530097338797;0,8470588
21,0700169823795;0,8117647
21,0870309417223;0,7803922
21,104044111551;0,7529412
21,1210817562205;0,7215686
21,1380755830342;0,7058824
21,1550721731383;0,6901961
21,1720770531047;0,6588235
21,189102855109;0,6352941
21,2060903658366;0,5960785
21,2231280105043;0,5764706
21,2401388118033;0,5647059
21,2571685613621;0,5607843
21,2741837049689;0,5450981
21,2911988485794;0,5254902
21,3082096498765;0,5019608
21,3252417679669;0,4705882
21,3422569115774;0,4627451
21,3592207369766;0,4588235
21,376287198791;0,454902
21,3932522084597;0,4509804
21,4102511670953;0,4392157
21,4442913231978;0,4352941
21,511324743984;0,4313726
21,5283702837587;0,4235294
21,5623930706224;0,4196078
21,5794011086309;0,4156863
21,6814517052262;0,4117647
21,6984889551404;0,4078431
21,7154962036384;0,3960784
21,7325180580883;0,3921569
21,7494921471316;0,3882353
21,7664986061209;0,3686275
21,7835263819015;0,3411765
21,8005375779558;0,3372549
21,834556022508;0,3176471
21,8515455070119;0,2980392
21,868563019154;0,2901961
21,8855615830344;0,282353
21,9197762210388;0,2745098
21,9366145142121;0,2705882
21,9536118938249;0,2627451
21,9706515122707;0,254902
21,9876548132142;0,2352941
22,0046802204633;0,1960784
22,0217198389091;0,1803922
22,0387223503421;0,1490196
22,0557236775112;0,1294118
22,0727040826423;0,1019608
22,0897583070382;0,06666667
22,1067813457539;0,04705882