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

"UnityEngine.Experimental.Input" namespace not appearing in Visual Studio 2017

Discussion in 'Scripting' started by JAMisDelicious, May 26, 2019.

  1. JAMisDelicious

    JAMisDelicious

    Joined:
    Aug 8, 2017
    Posts:
    3
    I tried using Unity's new Input System today, but when trying to type "using UnityEngine.Experimental.Input," "Input" didn't exist in that namespace. I thought it may have been the update of Unity I was using, as it was the not the latest version, but even after that I was not able to use the "Input" namespace. I then tried looking on the Unity API website for help, but the namespace hasn't been added to it yet.

    This is what my code looks like, barely even started yet:


    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4. using UnityEngine.Experimental.Input; // "Input" doesn't exist in the "UnityEngine.Experimental" namespace
    5.  
    6. public class Player : MonoBehaviour
    7. {
    8.  
    9.     [SerializeField] private Controls _controls;
    10.  
    11.     void OnEnable()
    12.     {
    13.        
    14.     }
    15.  
    16. }
    The Controls class created by the Input System exists, but it's also having the same problems as my own class...

    Code (CSharp):
    1. using System;
    2. using System.Collections;
    3. using System.Collections.Generic;
    4. using UnityEngine;
    5. using UnityEngine.InputSystem; // "InputSystem" doesn't exist under the "UnityEngine" namespace
    6. using UnityEngine.InputSystem.Utilities; // "InputSystem" doesn't exist under the "UnityEngine" namespace
    7.  
    8. public class Controls : IInputActionCollection... // code goes on from here, lots of errors
    I've seen other people's tutorials on YouTube on how to use the Input System, and they can use the "Input" namespace just fine. Howcome I'm not able to?
     
    Zejak and h0neyfr0g like this.
  2. agoodcop

    agoodcop

    Joined:
    May 13, 2018
    Posts:
    1
    I'm facing the same issue.
     
    h0neyfr0g likes this.
  3. TREOIK_STUDIOS

    TREOIK_STUDIOS

    Joined:
    Aug 12, 2018
    Posts:
    1
    For the first script, use UnityEngine.InputManager in place of UnityEngine.Experimental.Input. As for the second script, I'm not so sure.
     
  4. sea-monster

    sea-monster

    Joined:
    Jan 7, 2017
    Posts:
    1
    I have the same issue. using UnityEngine.InputManager does not work either
     
  5. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    20,134
    Have you imported the Input System package from Unity's Package Manager?

    InputPM.png
     
    Shenae and santhoshkm like this.
  6. Red-Cat-Fat

    Red-Cat-Fat

    Joined:
    Oct 7, 2019
    Posts:
    1
    Yes, i`m imported the Input System, but this bug is not disappear.
     
    h0neyfr0g likes this.
  7. h0neyfr0g

    h0neyfr0g

    Joined:
    Jul 13, 2019
    Posts:
    35
    I am facing the exact same problem and cannot find a solution anywhere. Has anyone found a solution? Thanks for the help, very much appreciated.
     
  8. DmitriiDzh

    DmitriiDzh

    Joined:
    Dec 22, 2019
    Posts:
    3
    +1, have the same issue

    "using UnityEngine.Experimental.Input;" -- the input has not been recognized.

    it looks like, that instead it need to be used:

    "using UnityEngine.InputSystem;"
     
    danvlad, VengadoraVG and omadur like this.
  9. Poonity

    Poonity

    Joined:
    Jan 4, 2020
    Posts:
    1
    I had this problem as well with Version 1.0.0 of InputSystem. My controller script was unable to find the "UnityEngine.InputSystem" namespace unless it was at the highest level of the Assets folder (I.e. Assets/PlayerController.cs). If I placed the controller into a folder, the namespace would not longer be visible. The only fix I know of is to keep your controller script at the highest level of the Assets folder.
     
  10. sergio136357

    sergio136357

    Joined:
    Oct 28, 2017
    Posts:
    1
    If you are working with assemblies (files with extension .asmdef), be sure that you include in the asmdef file, in Assembly Definition References, the reference to the required assembly (in this case, Unity.InputSystem)
     
    shasaur_unity and mwillson like this.
  11. legoblaster1234

    legoblaster1234

    Joined:
    Aug 7, 2017
    Posts:
    27
    Restart Unity and your code editor. That's what worked for me
     
  12. Undertaker-Infinity

    Undertaker-Infinity

    Joined:
    May 2, 2014
    Posts:
    112
    Getting the same in 2020.2.3f1
    First try with the new input system and it only works if the scripts are in the root folder.
    I did install the package, I did restart many times.

    Uninstalling. Seems it's not ready for production yet.