Fixing the InputSystem Touchscreen NulLReference Exception in 2021.1

Heya, I saw the topic in the forum asking about this, and it gave me a little trouble as well. I was going to post my solution in the topic, but it apparently is closed and no replies are allowed. I think others might want this information later, I I am just posting it as a new Talking topic.

  • Yes, I know that the course is being taught in an earlier version, but I have been liking 2021 so far. I am hoping I can complete the course in 2021 so I have better reference in my mobile game I am working on in that version to make use of features.

For reference, I am running Unity 2021.1.23f1 in this.

To fix this issue, you need to be using a newer version of the InputSystem package than is automatically installed in the package manager, but it is a little vague on how to actually upgrade it to the necessary version. I have recently been working with this while creating new project Templates for better set up starting points, so the solution presented itself fairly quickly, and worked on my first try.

Steps I used to Upgrade Unity 2021.1 to use InputSystem v1.1.1

  1. Update your Project to use .NET 4.0 (because the new InputSystem does not work with 3.5 or lower.)

    • ‘Proje1. ct Settings’ → ‘Player’ → ‘[FOR-EACH-PLATFORM-YOU-ARE-PUBLISHING-TO]’ → ‘Other Settings’ → ‘Configuration’ →
    • Set ‘API Compatibility Level’ ‘.NET 4.x’
  2. Save and Close your project.

  3. In your File Explorer, brows to your Project’s Packages folder. ( [Your_Gane_Name]/Packages/ )

  4. Open packages-lock.json and manifest.json in your preferred editor.

  5. Find the entries for com.unity.inputsystem, make sure it has "version": "1.1.1", and save the files

  • [optional] I deleted my Library folder to force it to reload all of the packages, but it should do that without doing this.
  1. Start your project back up.

I hope this helps anyone else trying to use newer versions of unity, thanks for reading!

4 Likes

I can confirm this worked. Great help, much appreciated!

1 Like

Privacy & Terms