Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more..
    Dismiss Notice
  3. Dismiss Notice

Best way to deactivate/activate player input.

Discussion in 'Input System' started by Hookkshot, Oct 19, 2019.

  1. Hookkshot

    Hookkshot

    Joined:
    Jan 11, 2013
    Posts:
    26
    I am having a problem where I am creating a pause screen and I want to deactivae all the player inputs at once, so the game events dont fire during the pause screen.

    When i use PassivateInput, the game completely freezes,

    If I disable then re-enable the playerInput component on resume game the player inputs come up with "ArgumentException: Invalid User"

    IF this an issue with Preview.1 or am I doing something wrong.
     
  2. WizByteGames

    WizByteGames

    Joined:
    Mar 28, 2013
    Posts:
    70
    What I did was just have a blockint_Input variable and made anything that was reading from my input controller not receive the data.

    But that would imply that you have a separate class that handles your input and feeds it into your other classes.
     
  3. Hookkshot

    Hookkshot

    Joined:
    Jan 11, 2013
    Posts:
    26
    Which I do thankfully, I have ended up doing the same. I find it strange the other ways fail me though.