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. Dismiss Notice

Third Party Photon Network RPC

Discussion in 'Multiplayer' started by tookydo, Jan 1, 2015.

  1. tookydo

    tookydo

    Joined:
    Jul 15, 2014
    Posts:
    75
    I know you can send an rpc to one game object or photon view. But how would I send a rpc to all players in the room. I use like this.gameObject.GetComponent<PhotonView>().RPC("FunctionCall", PhotonTargets.All); I tried to use photonView.RPC("FunctionCall", PhotonTargets.All); thinking it would call to all photon views in the world but it was giving me an error. Any suggestions?
     
  2. BFGames

    BFGames

    Joined:
    Oct 2, 2012
    Posts:
    1,543
    Whats the error?
     
  3. tookydo

    tookydo

    Joined:
    Jul 15, 2014
    Posts:
    75
    It said that it couldn't find the function call in the photon id 7 ( it's own photon view). So it's basically calling it in itself.
     
  4. BFGames

    BFGames

    Joined:
    Oct 2, 2012
    Posts:
    1,543
    Photon targets all, calls everyone including yourself. The error comes from your function name not being correct in your rpc