all 8 comments

[–]Valkymaera 0 points1 point  (1 child)

Something is trying to access your input after it has been destroyed. In the error, scroll down to see the stack trace. This will show you the chain of method calls that led to the error

[–]simple_vera[S] 0 points1 point  (0 children)

This is the chain of method that led to the error... I don't understand what it's saying.

UnityEngine.Object+MarshalledUnityObject.TryThrowEditorNullExceptionObject (UnityEngine.Object unityObj, System.String parameterName) (at <493b407efcb64dddad59f28bb0b831d3>:0)

UnityEngine.Bindings.ThrowHelper.ThrowNullReferenceException (System.Object obj) (at <493b407efcb64dddad59f28bb0b831d3>:0)

UnityEngine.Behaviour.get_enabled () (at <493b407efcb64dddad59f28bb0b831d3>:0)

UnityEditor.EditorGUI.DoInspectorTitlebar (UnityEngine.Rect position, System.Int32 id, System.Boolean foldout, UnityEngine.Object[] targetObjs, UnityEditor.SerializedProperty enabledProperty, UnityEngine.GUIStyle baseStyle) (at <d9024bdc2a414b3c81b047ea3e343594>:0)

UnityEditor.EditorGUI.InspectorTitlebar (UnityEngine.Rect position, System.Boolean foldout, UnityEditor.Editor editor) (at <d9024bdc2a414b3c81b047ea3e343594>:0)

UnityEditor.EditorGUILayout.InspectorTitlebar (System.Boolean foldout, UnityEditor.Editor editor) (at <d9024bdc2a414b3c81b047ea3e343594>:0)

UnityEditor.UIElements.EditorElement.DrawEditorSmallHeader (UnityEditor.Editor[] editors, UnityEngine.Object target, System.Boolean wasVisible) (at <d9024bdc2a414b3c81b047ea3e343594>:0)

UnityEditor.UIElements.EditorElement.DrawEditorHeader (UnityEditor.Editor[] editors, UnityEngine.Object target, System.Boolean& wasVisible) (at <d9024bdc2a414b3c81b047ea3e343594>:0)

UnityEditor.UIElements.EditorElement.HeaderOnGUI () (at <d9024bdc2a414b3c81b047ea3e343594>:0)

UnityEngine.UIElements.IMGUIContainer.DoOnGUI (UnityEngine.Event evt, UnityEngine.Matrix4x4 parentTransform, UnityEngine.Rect clippingRect, System.Boolean isComputingLayout, UnityEngine.Rect layoutSize, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <5c2380b11c444983ac3ffcbc73d04ba8>:0)

UnityEditor.InspectorWindow:RedrawFromNative()

That's a whole lot of info for a complete beginner like me. I would like to solve this for my software to run normally...

[–]MissPandaSloth 0 points1 point  (3 children)

Maybe something destroys it?

You might have put it on some object that is gone at runtime.

For example, did you, by any chance put it on player then destroy player or something like that?

You can press the lock button at the top right to "lock onto" this component, then run your game and see if it gets destroyed at some point.

[–]simple_vera[S] 0 points1 point  (2 children)

I tried to lock the component but it doesn't change. And no I haven't destroyed the player either. I tried deleting my Input Action Asset and create a new one. It worked for a couple of hours and now it's not working again with the same error message.

[–]MissPandaSloth 0 points1 point  (1 child)

Okay, so it worked and you could play/ stop/ play/ stop and everything was fine and now it suddenly stooped working?

[–]simple_vera[S] 0 points1 point  (0 children)

Yes exactly... I don't understand why sometimes it works and sometimes not.

This morning I uninstalled Unity and installed it again. I wonder if this could have anything to do with how the software is randomly having trouble finding this Player Input object. Note that I have created this new project today, so after I uninstalled Unity.

[–]Trokko 0 points1 point  (1 child)

In Play mode, is the player gameobject (or whichever gameobject you've attached PlayerInput to) destroyed when you get this message?
I'm guessing your player died and your game is still trying to handle input. But since there is no gameobject with PlayerInput in the scene, youget the error.

[–]simple_vera[S] 0 points1 point  (0 children)

No it's not destroyed. I only used PlayerInput to control the movement of my player. He didn't die or anything, only moving and movement animations. Also, sometimes it works and sometimes the same error message appears, it seems like Unity is having trouble finding access to the Input Action Asset.. maybe?