Search Unity

Bug CustomProcessor doesn't run when Axis value is zero

Discussion in 'Input System' started by skaughtx0r, Jan 14, 2021.

  1. skaughtx0r

    skaughtx0r

    Joined:
    Mar 9, 2014
    Posts:
    74
    I'm trying to create a custom processor that converts an axis from [0 to 1] to [-1 to 1].

    Code (CSharp):
    1. public override float Process(float value, InputControl control)
    2. {
    3.     return (2f * value) - 1f;
    4. }
    I currently have it mapped to a pedal and when I lift all the way off, the value goes to 0 instead of -1. I put some breakpoints in the code and I noticed that a breakpoint never gets hit in the Process() function when the value goes to 0.

    For more context, I'm trying to have a single Action that can be mapped to either 1 pedal or 2 pedals. If one pedal it goes from -1 to 1. If two pedals, one pedal goes from 0 to 1, the other goes from 0 to -1 (Using a Custom Composite). This is to control the front wing (canard) on a hydroplane.
     
  2. skaughtx0r

    skaughtx0r

    Joined:
    Mar 9, 2014
    Posts:
    74
    Bump, I'm also trying to create a processor to just invert the axis value (I had to use a custom processor in order to allow user to enable / disable inverting the axis), but that does the same thing. If there's no input happening it just returns 0 instead of the processed value.

    Am I missing something? Or is this a bug?