- Home /
This question was
closed Oct 23, 2013 at 02:27 AM by
meat5000 for the following reason:
The question is answered, right answer was accepted
[Easy One]what is the photon Function for:
whats the photon function for "OnPlayerConnected"?
im trying to send an RPC when a new player connects, its not working.
the command:
void OnPlayerConnected (PhotonPlayer netPlayer)
{
//Add the player to the list. This is executed on the server.
photonView.RPC("AddPlayerToList", PhotonTargets.AllBuffered, netPlayer);
}
the execution
[RPC]
void AddPlayerToList (PhotonPlayer nPlayer)
{
//Create a new entry in the PlayerList and supply the
//player's network ID as the first entry.
joinedlist = true;
Playerdataclas capture = new Playerdataclas();
capture.networkPlayer = int.Parse(nPlayer.ToString());
PlayerList.Add(capture);
}
Comment
void OnPhotonPlayerConnected (PhotonPlayer player) {
}
Best Answer
Answer by R1pnd1p · Oct 23, 2013 at 02:12 AM
" void OnPhotonPlayerConnected (PhotonPlayer player) {" - OrangeLightning (comments)