ProcessPointerInput - MissingReferenceException: The object of type 'UnityEngine.GameObject' has been destroyed but you are still trying to access it

I just upgraded to Unity 6000.0.20. The Input System is at 1.11.0. I’m now seeing the following exception when I select an item from a drop down menu…

MissingReferenceException: The object of type 'UnityEngine.GameObject' has been destroyed but you are still trying to access it.
Your script should either check if it is null or you should not destroy the object.
UnityEngine.Object+MarshalledUnityObject.TryThrowEditorNullExceptionObject (UnityEngine.Object unityObj, System.String parameterName) (at <adbae017f0374fce9921b97a33a4e8ca>:0)
UnityEngine.Bindings.ThrowHelper.ThrowNullReferenceException (System.Object obj) (at <adbae017f0374fce9921b97a33a4e8ca>:0)
UnityEngine.GameObject.get_transform () (at <adbae017f0374fce9921b97a33a4e8ca>:0)
UnityEngine.InputSystem.UI.InputSystemUIInputModule.ProcessPointerMovement (UnityEngine.InputSystem.UI.ExtendedPointerEventData eventData, UnityEngine.GameObject currentPointerTarget) (at ./Library/PackageCache/com.unity.inputsystem/InputSystem/Plugins/UI/InputSystemUIInputModule.cs:476)
UnityEngine.InputSystem.UI.InputSystemUIInputModule.ProcessPointerMovement (UnityEngine.InputSystem.UI.PointerModel& pointer, UnityEngine.InputSystem.UI.ExtendedPointerEventData eventData) (at ./Library/PackageCache/com.unity.inputsystem/InputSystem/Plugins/UI/InputSystemUIInputModule.cs:402)
UnityEngine.InputSystem.UI.InputSystemUIInputModule.ProcessPointer (UnityEngine.InputSystem.UI.PointerModel& state) (at ./Library/PackageCache/com.unity.inputsystem/InputSystem/Plugins/UI/InputSystemUIInputModule.cs:352)
UnityEngine.InputSystem.UI.InputSystemUIInputModule.Process () (at ./Library/PackageCache/com.unity.inputsystem/InputSystem/Plugins/UI/InputSystemUIInputModule.cs:2257)
UnityEngine.EventSystems.EventSystem.Update () (at ./Library/PackageCache/com.unity.ugui/Runtime/UGUI/EventSystem/EventSystem.cs:530)

Any idea why this is happening? None of my code has changed and the exception isn’t very illuminating, since my code isn’t referenced. I’m guessing this is a bug, but I’m not certain.

2 Likes

I downgraded to Input System 1.10.0 and the problem went away. I’m going to submit a bug report.

1 Like

Try Next:

  1. Update to Input System 1.11.0
  2. Close Unity
  3. Remove Library folder
  4. Open Unity

I tried that. It didn’t work. Same exceptions.

1 Like

It’s already been reported and fixed in an upcoming release: InputSystem 1.11.0 throw error when destroy canvas

Some code got through that should not have made it past review.

1 Like

Awesome. Thanks for the info.

I modified script and fixed. see video for details: https://www.youtube.com/watch?v=FrOlflu6AIg

had the same issue, just updated Input System package to 1.11.1 and it fixed the issue.

2 Likes

Thanks. That worked for me too.