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. Dismiss Notice

How to get key input when using new input system?

Discussion in 'Scripting' started by Bagazi, Mar 25, 2022.

  1. Bagazi

    Bagazi

    Joined:
    Apr 18, 2018
    Posts:
    609
    Code (CSharp):
    1.             if (Input.GetKeyDown(KeyCode.RightArrow))
    2.             {
    3.                 Next();
    4.             }
    5.             if (Input.GetKeyDown(KeyCode.LeftArrow))
    6.             {
    7.                 Previous();
    8.             }

    When I switch input to "new input system" in unity,I found that it can on longer use the input class. Sometimes I just want write some test script just for testing . So what is the easiest way to do this?:)
     
  2. Nad_B

    Nad_B

    Joined:
    Aug 1, 2021
    Posts:
    326
    Best tutorial for Input System

     
    Bagazi likes this.
  3. brian1gramm1

    brian1gramm1

    Joined:
    Sep 15, 2017
    Posts:
    55
    Code Monkey wins!