Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question .WithMagnitudeHavingToBeGreaterThan appears not to be working

Discussion in 'Input System' started by ZO5KmUG6R, Sep 28, 2020.

  1. ZO5KmUG6R

    ZO5KmUG6R

    Joined:
    Jul 15, 2010
    Posts:
    490
    Hi there. I'm trying to use .WithMagnitudeHavingToBeGreaterThan during rebind operations.

    The problem I have is I have a noisy (in the literal sense, I don't think Unity has it marked as noisy) control, that always triggers the rebinding, so it's literally impossible to rebind controls.

    So I tried using .WithMagnitudeHavingToBeGreaterThan of 0.5, no luck. 0.8, no luck. 1, no luck, then I even tried 1000 magnitude with no luck. I don't get what's happening here.

    The rebind looks like this.
    Code (CSharp):
    1.             currentRebindOp = action.PerformInteractiveRebinding()
    2.                               .WithRebindAddingNewBinding()
    3.                               .WithMagnitudeHavingToBeGreaterThan(1000f)
    4.                               .WithCancelingThrough("<Keyboard>/escape")
    5.                               .WithBindingGroup(input.ModeAsGroupName)
    6.                               .Start().OnComplete((op) =>
    7.                               {
     
    BaaWolf likes this.