'InputSystem' does not exist in the namespace 'UnityEngine' after updating to the latest version

Announcements, support questions, and discussion for the Dialogue System.
Deses
Posts: 15
Joined: Fri May 28, 2021 9:27 am

'InputSystem' does not exist in the namespace 'UnityEngine' after updating to the latest version

Post by Deses »

Hi! I just updated your plugin to 2.2.24 from 2.2.11, and I'm having compilation errors that I haven't been able to fix.

The error is:

Code: Select all

error CS0234: The type or namespace name 'InputSystem' does not exist in the namespace 'UnityEngine' (are you missing an assembly reference?)
And it's happening in these files:

Code: Select all

Assets\Plugins\Pixel Crushers\Dialogue System\Scripts\Demo Scripts\SimpleController.cs(99,26)
Assets\Plugins\Pixel Crushers\Dialogue System\Scripts\Demo Scripts\SimpleController.cs(100,26)
Assets\Plugins\Pixel Crushers\Dialogue System\Scripts\UI\Utility\UITools.cs(43,51)
I've been googling around for a fix and most of the results pointed me to:
  1. Update/install the new Input System, which I already have.
  2. Make sure the new input system is enabled in the Player section of the Project Settings. Done
  3. Regenerate project files in Preferences -> External tools.
  4. Upgrading / downgrading VSCode integration plugin, but that didn't do anything.
None of those worked. :cry: I also checked the Assembly Definition Asset and this is what i have:
Image
But I have no option to add UnityEngine.InputSystem.

I don't know what else can I do to fix this problem. :(
User avatar
Tony Li
Posts: 22093
Joined: Thu Jul 18, 2013 1:27 pm

Re: 'InputSystem' does not exist in the namespace 'UnityEngine' after updating to the latest version

Post by Tony Li »

Hi,

You'll need to add Unity.InputSystem to three assembly definition assets:
  • Plugins / Pixel Crushers / Common / Scripts / PixelCrushers.asmdef
  • Plugins / Pixel Crushers / Common / Scripts / Editor / PixelCrushers.asmdef
  • Plugins / Pixel Crushers / Dialogue System / Scripts / DialogueSystem.asmdef
Deses
Posts: 15
Joined: Fri May 28, 2021 9:27 am

Re: 'InputSystem' does not exist in the namespace 'UnityEngine' after updating to the latest version

Post by Deses »

I didn't have those files, but I had "Assets\Plugins\Pixel Crushers\Dialogue System\Scripts\PixelCrushers.DialogueSystem.asmdef". I added Unity.InputSystem to that one and it worked. :)

You're a lifesaver. Thank you!
DarkProphet
Posts: 15
Joined: Thu Dec 16, 2021 2:09 pm

Re: 'InputSystem' does not exist in the namespace 'UnityEngine' after updating to the latest version

Post by DarkProphet »

Hi Tony!

I'm having a similar problem.
Error messages like: Assets/Plugins/Pixel Crushers/Common/Scripts/UI/InputDeviceManager.cs(11,19): error CS0234: The type or namespace name 'InputSystem' does not exist in the namespace 'UnityEngine' (are you missing an assembly reference?)

I've tried all the solutions i could find online and in the forum.

These are the sequences I've tried, several times, after a version control backup so I can roll it back and retry:
- Installed the new Input System
- I agree to the 'backend refresh' restart prompt, or I cancel it.
- If I cancel it, I can access the PixelCrushers welcome window and check USE_NEW_INPUT
- Either way, the next restart, the error messages appear.
- I've checked that Player/Configuration/Active Input Handling is set to 'Input System Package (New)' (or both)
- Checked that Player/Configuration/Scripting Define Symbols does not contain duplicate USE_NEW_INPUT copies.
- Regenerated project files in Settings/External Tools (including registry packages checkbox)
- Tried restarting after every step.

- Also tried running the Assets/Plugins/Pixel Crushers/Common/Scripts/CommonAssemblyDefinitions.unitypackage
to install the assembly definitions and manually put in the input system as you describe above.

That just introduces a host of new errors and I have to manually input all the other assemblies I'm using like Timeline, Cinemachine, Text Animator etc, and it seems to never compile correctly, I gave up after inputting the multiple Text Animator assemblies and the CS0234 errors still being there either way. The project never compiled and I could never access the welcome window to see if I could leverage those checkboxes to fix things.

No success.

I'm quite stumped at this point so I hope you can help.
User avatar
Tony Li
Posts: 22093
Joined: Thu Jul 18, 2013 1:27 pm

Re: 'InputSystem' does not exist in the namespace 'UnityEngine' after updating to the latest version

Post by Tony Li »

Hi,

In your project, do you want to use Unity's built-in input manager or the Input System package?

If you want to use the built-in input manager, select menu item Edit > Project Settings. In Player > Other Settings, remove "USE_NEW_INPUT" from Scripting Define Symbols. Then click Apply.

If you want to use the Input System package, add "USE_NEW_INPUT" if it's not already present. If you've imported the Dialogue System's assembly definition files (asmdefs), then you'll need to:

1. Manually add a reference to the Unity.InputSystem to these four asmdefs: PixelCrushers, PixelCrushersEditor, DialogueSystem, DialogueSystemEditor

2. Or, if you're using Unity 2021 or higher, import the updated Dialogue System asmdefs from the package that will be in the upcoming version 2.2.48:

DialogueSystemAssemblyDefinitions_2_2_48.unitypackage

These asmdefs already contain references to Unity.InputSystem.

Note: If you're not already using the Dialogue System's asmdefs, you do not need to do either of these steps.
DarkProphet
Posts: 15
Joined: Thu Dec 16, 2021 2:09 pm

Re: 'InputSystem' does not exist in the namespace 'UnityEngine' after updating to the latest version

Post by DarkProphet »

I am trying to convert my project to use the New InputSystem.
I have done what you said (I'm not using the Dialogue System asmdefs, but I tried downloading and doing that too).
I still get the errors (as pictured, attached).
Not sure where to go from here.
Attachments
Screenshot 2024-10-09 at 15.25.26.png
Screenshot 2024-10-09 at 15.25.26.png (66.68 KiB) Viewed 249 times
User avatar
Tony Li
Posts: 22093
Joined: Thu Jul 18, 2013 1:27 pm

Re: 'InputSystem' does not exist in the namespace 'UnityEngine' after updating to the latest version

Post by Tony Li »

Hi,

Did you import Unity's Input System package?

If you're not using the Dialogue System's assembly definitions (asmdefs), then you don't need to do anything else since you've already ticked the USE_NEW_INPUT checkbox.

If you are using the Dialogue System's asmdefs, you need to update them to reference the Input System package. You can do it manually, or you can import the updated asmdefs from DS version 2.2.48+ which should be available on the Asset Store soon. In the meantime, you can get those asmdefs here:

DialogueSystemAssemblyDefinitions_2_2_48.unitypackage
DarkProphet
Posts: 15
Joined: Thu Dec 16, 2021 2:09 pm

Re: 'InputSystem' does not exist in the namespace 'UnityEngine' after updating to the latest version

Post by DarkProphet »

I did import the Input System package, yes. Countless times now I've tried the correct sequence of events.
As stated before, the errors appear the second I install the Input System package.
I do not even get the chance to open the Dialogue System Welcome Window to click the USE_NEW_INPUT checkbox, because the errors make PixelCrushers not show up in the Tools menu. I am able to input it manually into project settings, but the errors persist.

Further info: It seems that the errors are confined to my current project only, new projects don't have this problem. Not sure why, but I will endeavour to find out. Any ideas or tips?
User avatar
Tony Li
Posts: 22093
Joined: Thu Jul 18, 2013 1:27 pm

Re: 'InputSystem' does not exist in the namespace 'UnityEngine' after updating to the latest version

Post by Tony Li »

Hi,

Can you try importing the asmdef unitypackage above?
Post Reply