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

[HELP] UnityEngine.InputSystem not found when class is in namespace

Discussion in 'Input System' started by StepanSanda, Jul 17, 2021.

  1. StepanSanda

    StepanSanda

    Joined:
    Sep 17, 2012
    Posts:
    3
    Hello, I'm trying to implement new Unity Input System. I installed new Input System from plugin manager then I created Input Actions and then I generated C# class.
    Then I got bunch of errors. The reason was that:
    Code (CSharp):
    1. using UnityEngine.InputSystem
    was not found. Then I investigated and found, that I can get it working when I left C# Class Namespace empty (by default Global namespace)". But then I'm not able to reference it from classes with namespace because
    Code (CSharp):
    1. global::InputActions
    is not working either.
    I tried restart everything several times and nothing helped. Once I set the Class Namespace back again, I cannot reference the UnityEngine.InputSystem anymore -> It is not working (not found) from any other class that has namepsace. Once the class has no namepsace the import is working fine.
     
    BobNuromedia likes this.
  2. StepanSanda

    StepanSanda

    Joined:
    Sep 17, 2012
    Posts:
    3
    Oh well I found my solution. Since we have an assembly definition for our project, we needed to add a reference to the Unity.InputSystem Assembly to the .asmdef file.