Search Unity

Bug New Input System reacts only sometimes?

Discussion in 'Input System' started by SuperFranTV, Jan 24, 2022.

  1. SuperFranTV

    SuperFranTV

    Joined:
    Oct 18, 2015
    Posts:
    140
    Hello,

    i'am currently testing the new Input System, but if i enter playmode, sometimes it does nothing if i'am pressing keys?

    Also pressing two arrow-keys + space for jump does not react sometimes?
    Pressing two arrow-keys at the same time, will stop the player, it should be that the first one pressed get a higher priority like in old input system?

    What is wrong?
    I'am using the Input System directly.

    Code (CSharp):
    1.     private PlayerInput input;
    2.  
    3.     private InputAction jump;
    4.     private InputAction move;
    5.  
    6.     private void Awake () {
    7.         input = new PlayerInput();
    8.         jump = input.Infantry.Jump;
    9.         move = input.Infantry.Move;
    10.     }
    11.  
    12.     private void OnEnable () {
    13.         input.Enable();
    14.     }
    15.  
    16.     private void OnDisable () {
    17.         input.Disable();
    18.     }
    19.  
    20.         Vector2 inputAxis = move.ReadValue<Vector2>();
    21.         velocity.x = inputAxis.x;
    22.         velocity.z = inputAxis.y;
    23.  
    24.         controller.Move(velocity * Time.deltaTime * speed);
    With direct i mean ReadValue and the boolean triggered for the jump button.

    Also i think the movement is very clumpy instead of the old input system?

    are there missing informations about?