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.

Resolved Help Needed: Easiest Way To Switch to Text Input during gameplay?

Discussion in 'Input System' started by DimVos, Nov 16, 2022.

  1. DimVos

    DimVos

    Joined:
    Apr 15, 2022
    Posts:
    8
    I am using the new Input System, and I am a beginner in Unity.

    I was wondering what is the easiest & shortest way how to disable player movements, and force the player to start writing text during gameplay.

    How would that work in C#?

    Thank you very much in advance!


     
  2. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    2,069
    Awesome sketch! :D

    I think the optimal solution would be to add an action map "No Input" and like it says, it defines no input whatsoever. Then you switch to that map while any regular Unity GUI is shown (including pause menu and such). That way there won't be any input events firing. When the GUI is removed, you change back to the regular player action map.
     
    DimVos likes this.
  3. DimVos

    DimVos

    Joined:
    Apr 15, 2022
    Posts:
    8
    It worked like a charm! I appreciate your help, means a lot!