Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Third Party PUN RPC call error

Discussion in 'Multiplayer' started by jonmaxmore, Aug 31, 2022.

  1. jonmaxmore

    jonmaxmore

    Joined:
    Mar 21, 2022
    Posts:
    3
    current I am facing some error with PUN

    Code (CSharp):
    1. photonView.RPC(
    2.             nameof(SendPlayerInfo), RpcTarget.All,
    3.             (object)(new int[] {
    4.                 curProfile,
    5.                 curAvata,
    6.                 currentPlayer.id
    7.             })
    8.         );
    9.  
    10. void SendPlayerInfo(int[] obj){
    11. ....
    12. }
    above my code don't work well now.
    follow is my errors. how can I solve this issue ?
    RPC method 'TurnToCurrentDirection(Int32[])' not found on object with PhotonView 3. Implement as non-static. Apply [PunRPC]. Components on children are not found. Return type must be void or IEnumerator (if you enable RunRpcCoroutines). RPCs are a one-way message.
    UnityEngine.Debug:LogErrorFormat (UnityEngine.Object,string,object[])
    Photon.Pun.PhotonNetwork:ExecuteRpc (ExitGames.Client.Photon.Hashtable,Photon.Realtime.Player) (at Assets/Photon/PhotonUnityNetworking/Code/PhotonNetworkPart.cs:638)
    Photon.Pun.PhotonNetwork:OnEvent (ExitGames.Client.Photon.EventData) (at Assets/Photon/PhotonUnityNetworking/Code/PhotonNetworkPart.cs:2198)
    Photon.Realtime.LoadBalancingClient:OnEvent (ExitGames.Client.Photon.EventData) (at Assets/Photon/PhotonRealtime/Code/LoadBalancingClient.cs:3337)
    ExitGames.Client.Photon.PeerBase:DeserializeMessageAndCallback (ExitGames.Client.Photon.StreamBuffer) (at D:/Dev/Work/photon-dotnet-sdk/PhotonDotNet/PeerBase.cs:898)
    ExitGames.Client.Photon.EnetPeer:DispatchIncomingCommands () (at D:/Dev/Work/photon-dotnet-sdk/PhotonDotNet/EnetPeer.cs:563)
    ExitGames.Client.Photon.PhotonPeer:DispatchIncomingCommands () (at D:/Dev/Work/photon-dotnet-sdk/PhotonDotNet/PhotonPeer.cs:1863)
    Photon.Pun.PhotonHandler:Dispatch () (at Assets/Photon/PhotonUnityNetworking/Code/PhotonHandler.cs:223)
    Photon.Pun.PhotonHandler:FixedUpdate () (at Assets/Photon/PhotonUnityNetworking/Code/PhotonHandler.cs:149)
     
  2. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    3,021
  3. jonmaxmore

    jonmaxmore

    Joined:
    Mar 21, 2022
    Posts:
    3
    thank you for your kind reply. I've already solved that problem. my code have that attribute at that time.
    problem was in other part of code.