A couple of weird errors but game runs fine

Options
I'm having a couple of weirds errors. I'm using Unity's new input system.
The weird thing is that my game is functioning normally without any issues. But these errors still pops up.
MissingReferenceException while executing 'performed' callbacks of 'Player/Fire[/Keyboard/f,/Keyboard1/f]'
UnityEngine.InputSystem.LowLevel.<>c__DisplayClass7_0:<set_onUpdate>b__0(NativeInputUpdateType, NativeInputEventBuffer*)
UnityEngineInternal.Input.NativeInputSystem:NotifyUpdate(NativeInputUpdateType, IntPtr)
MissingReferenceException: The object of type 'PlayerAbilitySkill_BasicAttack_Photon' 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.Component.GetComponent[T] () (at <05f2ac9c8847426992765a22ef6d94ca>:0)
Photon.Pun.PhotonView.Get (UnityEngine.Component component) (at Assets/Settings/Asset Store Packages/Photon/PhotonUnityNetworking/Code/PhotonView.cs:489)
Photon.Pun.MonoBehaviourPun.get_photonView () (at Assets/Settings/Asset Store Packages/Photon/PhotonUnityNetworking/Code/PunClasses.cs:197)
PlayerAbilitySkill_BasicAttack_Photon.ShootHandle (System.Boolean value) (at Assets/Scripts/Photon Networking/PlayerAbilitySkill_BasicAttack_Photon.cs:61)
PlayerAbilitySkill_BasicAttack_Photon.Fire_performed (UnityEngine.InputSystem.InputAction+CallbackContext obj) (at Assets/Scripts/Photon Networking/PlayerAbilitySkill_BasicAttack_Photon.cs:110)
UnityEngine.InputSystem.Utilities.DelegateHelpers.InvokeCallbacksSafe[TValue] (UnityEngine.InputSystem.Utilities.InlinedArray`1[System.Action`1[TValue]]& callbacks, TValue argument, System.String callbackName, System.Object context) (at Library/PackageCache/com.unity.inputsystem@1.0.0-preview.6/InputSystem/Utilities/DelegateHelpers.cs:51)
UnityEngine.InputSystem.LowLevel.<>c__DisplayClass7_0:<set_onUpdate>b__0(NativeInputUpdateType, NativeInputEventBuffer*)
UnityEngineInternal.Input.NativeInputSystem:NotifyUpdate(NativeInputUpdateType, IntPtr)

Comments

  • Over
    Options

    The solution is simpler than I thought. I haven't found an answer to the same error anywhere and all you need to do is make a simple script so that the object doesn't get destroyed when changing the scene.