Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

Axis returns zero only on canceled event

Discussion in 'New Input System' started by Wokarol, Jun 6, 2019.

  1. Wokarol

    Wokarol

    Joined:
    Aug 1, 2017
    Posts:
    20
    It's strange that 2D axis only returns zero when on canceled is called, so you have to do

    Code (CSharp):
    1. generalMap.Ship.Movement.performed += MovementChanged;
    2. generalMap.Ship.Movement.canceled += MovementChanged;
    instead of simple and more logical

    Code (CSharp):
    1. generalMap.Ship.Movement.performed += MovementChanged;
     
  2. Elhimp

    Elhimp

    Joined:
    Jan 6, 2013
    Posts:
    20
    Set your action.passThrough = true
     
    Wokarol likes this.