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

Question "Space" doesn't register while "W" is being held down

Discussion in 'Input System' started by Starczi, May 12, 2021.

  1. Starczi

    Starczi

    Joined:
    Mar 16, 2020
    Posts:
    1
    Hi!

    I have just started using Unity's new input system and it was quite a challenge at the beginning. After a while I started getting more comfortable with it but now I've come across an issue I don't know how to solve.

    I'm creating a first person controller(Character Controller based). For now, character can jump, crouch, walk(default) and sprint. Input is being controlled by InputManager. For both movement and aim input values, Player Controller script gets them directly from InputManager. The rest of the actions are being controlled by invoking an event and passing PlayerActionType, and InputActionType(STARTED/CANCELED), way of knowing whether button is being held down) enums. PlayerController subscribes to this event and acts accordingly.

    I probably made this overcomplicated but in the end it all works fine except for one thing:

    if character is sprinting and "W" key (Up binding for movement action) is being held down, "Space" (binding for jump action) does not register and event is not invoked.

    Does anybody know why this might be happening?

    P.S. PlayerController is over 200 lines of code and InputManager is over 100 so I did not want to post that amount of text in case the problem lies somewhere different but if its neccesary I can add that no problem.