0
\$\begingroup\$

I am creating a 3d game application in unity with the use of PUN2. When I start the game, all players automatically disconnected and the animation of players is kinda lag or not synchronizing towards all players. I was wondering if it is because of the RPC's that i called.

I know this is kinda stupid but i have 200+ methods marked as PunRPC.

My Question is: does using or calling an RPC in PUN causes a lag and automatic disconnecting of player/s? or is it because i calls a lot of data/objects all over the network?

I do have this error occurs when a player/s disconnected automatically:

Error 1:

PhotonView ID duplicate found: 999. New: View 999 on RoomManager (scene) old: View 999 on RoomManager (scene). Maybe one wasn't destroyed on scene load?! Check for 'DontDestroyOnLoad'. Destroying old entry, adding new. UnityEngine.Debug:LogError(Object) Photon.Pun.PhotonNetwork:RegisterPhotonView(PhotonView) (at Assets/Photon/PhotonUnityNetworking/Code/PhotonNetworkPart.cs:1003) Photon.Pun.PhotonView:Awake() (at Assets/Photon/PhotonUnityNetworking/Code/PhotonView.cs:590)

Error 2:

InvalidOperationException: Duplicate key 999 ExitGames.Client.Photon.NonAllocDictionary`2[K,V].Add (K key, V val) (at D:/Dev/Work/photon-dotnet-sdk/PhotonDotNet/DataTypes.cs:309) Photon.Pun.PhotonNetwork.RegisterPhotonView (Photon.Pun.PhotonView netView) (at Assets/Photon/PhotonUnityNetworking/Code/PhotonNetworkPart.cs:1014) Photon.Pun.PhotonView.Awake () (at Assets/Photon/PhotonUnityNetworking/Code/PhotonView.cs:590)

and I know this errors will occur only if I did not disconnected properly from the previous game on which my room manager still exist and did not destroy from the previous one...

\$\endgroup\$
13
  • \$\begingroup\$ Do you actually have that problem in your game? Can you give us more details about what exactly you are doing and about the exact nature of the problems you experience? \$\endgroup\$ – Philipp Mar 2 at 10:21
  • \$\begingroup\$ Hi @Philipp! I am creating a 3d game application in unity with the use of PUN2 and when I starts the game all players is automatically disconnected and the animation of players is kinda lag or not synchronizing towards all players.. and i was wondering if it is because of the RPC's that i called.. \$\endgroup\$ – Lacus clyne Mar 2 at 10:37
  • \$\begingroup\$ Can you provide more information on the RPC call? \$\endgroup\$ – Philipp Mar 2 at 10:40
  • \$\begingroup\$ I know this is kinda stupid but i have 200+ methods marked as PunRPC ... I am currently learning on photon unity networking hope you understand.... \$\endgroup\$ – Lacus clyne Mar 2 at 10:41
  • 1
    \$\begingroup\$ Post those as edit to the question, not as a comment \$\endgroup\$ – Zibelas Mar 2 at 10:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.