Hello everyone, I have a problem with destroy an object via PhotonNetwork (PunObjectPool error).
I spawn object with
If I do not have to spawn objects via PhotonNetwork or destroy through it, please tell me how to do this so that everyone has an object and does not have this error after destroying.
The object is deleted and everything about the object's script works fine, but only this error occurs. If it is possible to bypass the call of this event, please also inform about the possibility and how to do it.
Thanks for your attention. Any help would be appreciated.
EDIT: After testing, it turned out that this problem occurs for players who are not master clients. We master all customers without error.
Moreover, regardless of who is the owner of the thing and who (the owner) deletes it.
I spawn object with
and destroying it withPhotonNetwork.Instantiate(prefabGO.name, DropPoint.transform.position, DropPoint.transform.rotation); // just for example
I getting error:PhotonNetwork.Destroy(this.gameObject); // in script of that object
I already tried to fix this by checking for if(photonView.gameObject != null) (in PunObjectPool.cs:216) , but the problem is not fixed.NullReferenceException: Object reference not set to an instance of an object
Opsive.UltimateCharacterController.AddOns.Multiplayer.PhotonPun.Game.PunObjectPool.OnEvent (ExitGames.Client.Photon.EventData photonEvent) (at Assets/Opsive/UltimateCharacterController/Add-Ons/Multiplayer/PhotonPUN/Scripts/Game/PunObjectPool.cs:216)
Photon.Realtime.LoadBalancingClient.OnEvent (ExitGames.Client.Photon.EventData photonEvent) (at Assets/Photon/PhotonRealtime/Code/LoadBalancingClient.cs:3142)
ExitGames.Client.Photon.PeerBase.DeserializeMessageAndCallback (ExitGames.Client.Photon.StreamBuffer stream) (at <a497a6f18e1f4b419421b940add27a6e>:0)
ExitGames.Client.Photon.EnetPeer.DispatchIncomingCommands () (at <a497a6f18e1f4b419421b940add27a6e>:0)
ExitGames.Client.Photon.PhotonPeer.DispatchIncomingCommands () (at <a497a6f18e1f4b419421b940add27a6e>:0)
Photon.Pun.PhotonHandler.Dispatch () (at Assets/Photon/PhotonUnityNetworking/Code/PhotonHandler.cs:208)
Photon.Pun.PhotonHandler.FixedUpdate () (at Assets/Photon/PhotonUnityNetworking/Code/PhotonHandler.cs:142)
If I do not have to spawn objects via PhotonNetwork or destroy through it, please tell me how to do this so that everyone has an object and does not have this error after destroying.
The object is deleted and everything about the object's script works fine, but only this error occurs. If it is possible to bypass the call of this event, please also inform about the possibility and how to do it.
Thanks for your attention. Any help would be appreciated.
EDIT: After testing, it turned out that this problem occurs for players who are not master clients. We master all customers without error.
Moreover, regardless of who is the owner of the thing and who (the owner) deletes it.
Last edited: