Assets\Scripts\InputSystem.cs(1651,19): error CS1061: 'InputSystem.DebugActions' does not contain a definition for 'Assert' and no accessible extension method 'Assert' accepting a first argument of type 'InputSystem.DebugActions' could be found (are you missing a using directive or an assembly reference?)
InputSystem is the name of the generated class by the Unity InputSystem Package in my project.:
//------------------------------------------------------------------------------
// <auto-generated>
// This code was auto-generated by com.unity.inputsystem:InputActionCodeGenerator
// version 1.8.0
// from Assets/Configs/InputSystem/InputSystem.inputactions
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
The compile error in InputSystem.cs in line 1651 is the first Assert:
~@InputSystem()
{
Debug.Assert(!m_Player.enabled, "This will cause a leak and performance issues, InputSystem.Player.Disable() has not been called.");
Debug.Assert(!m_UI.enabled, "This will cause a leak and performance issues, InputSystem.UI.Disable() has not been called.");
Debug.Assert(!m_Debug.enabled, "This will cause a leak and performance issues, InputSystem.Debug.Disable() has not been called.");
}
I just had this issue as well after upgrading. I had an action map named “Debug,” which I renamed to “DebugActions,” and the problem disappeared. It seems that having a map called “Debug” results in a property named " @ " of the generated type DebugActions in the generated InputActions script, leading to a naming conflict. The generated file needs to fully qualify the Assert calls with the UnityEngine namespace.
Is there another reason for this error? I also have it (Unity 6000.0.25, didn’t have it in 2022.3) and none of my map is named Debug.
This happens when I change scene:
~@PlayerInputActions()
{
UnityEngine.Debug.Assert(!m_Default.enabled, "This will cause a leak and performance issues, PlayerInputActions.Default.Disable() has not been called.");
UnityEngine.Debug.Assert(!m_Planning.enabled, "This will cause a leak and performance issues, PlayerInputActions.Planning.Disable() has not been called.");
UnityEngine.Debug.Assert(!m_UI.enabled, "This will cause a leak and performance issues, PlayerInputActions.UI.Disable() has not been called.");
}
I also saw this message when changing scene and found the issue…
I was accessing the InputSystem before scene load to disable controls and re-enabling after the LoadSceneAsync call. But what i didnt think about at first was the InputSystem was attached to a different “version” of the GameObject after scene change.
Once i realized that, simply getting a new reference to the GameObject after the async scene load call the error went away.
Thanks for the reply.
For me it was that I didn’t notice the input action is a disposable, and I didn’t call Dispose on the member instance when destroying the game object. (A singleton gameobject that holds the inputs for the scene lifetime).
Are you loading a scene with another PlayerInput and trying to enable it again?
For me, I just prevent it from trying to enable again by doing a quick check to see if it’s already instantiated, and then the error never happened again.
Got “leak and performance issues” error when tried to disable map (PlayerActions) for second time at Start() in my manager script using singletone for InputActionAsset. Issue disappeared when I disabled it at OnDestroy().