Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Resolved Axis Deadzone min 0 resets to default min

Discussion in 'Input System' started by rz_0lento, Aug 26, 2020.

  1. rz_0lento

    rz_0lento

    Joined:
    Oct 8, 2013
    Posts:
    2,361
    Pretty much what topic said. If I put 0 on Axis Deadzone min (I have use case where I only need to use the max), the processor gets overridden by default min (input asset literally gets default checkbox ticked as soon as I hit play). If I put some tiny value like 1e-08 it doesn't revert to default. Setting max to 1 doesn't have similar behavior.

    How I see it, this is a bug as you should be able to set the deadzone values individually (even to 0).
     
  2. rz_0lento

    rz_0lento

    Joined:
    Oct 8, 2013
    Posts:
    2,361
    After brief investigation, this line here calls Initialize function but doesn't set the default value:
    https://github.com/Unity-Technologi...trols/Processors/AxisDeadzoneProcessor.cs#L75
    instead it relies on defaultComesFromInputSettings = true to take care of it.

    But this default is never fetched from settings so the m_DefaultInitializedValue gets value 0 and then when the code hits this line
    https://github.com/Unity-Technologi...putSystem/Editor/InputParameterEditor.cs#L194
    it will toggle the default option back on as it thinks 0 is the default (which should be 0.125 instead, or whatever user has set as global default in the settings).

    Additionally minOrDefault and maxOrDefault just reset to defaults on AxisDeadZoneProcessor is the user set value is 0.
     
    Last edited: Aug 26, 2020