RPC ONLY for new players
Options
Hi, i have a question, i want to create an rpc only for new connecting players.
In my case when a player disconnects every connected player executes a function
I can't just run an RPC with "AllBuffered" because everyone else will call an rpc to everyone else.
I just want to locally call my function, and later run an RPC to all the new upcoming players
In my case when a player disconnects every connected player executes a function
public void OnPhotonPlayerDisconnected(PhotonPlayer LeftPlayer){
Debug.Log ("Remove spawn point Locally");
Debug.Log ("Remove spawn point for new players");
}
I can't just run an RPC with "AllBuffered" because everyone else will call an rpc to everyone else.
I just want to locally call my function, and later run an RPC to all the new upcoming players
0
Comments
-
Hi,
I don't think you can do that. I would turn this in its head and instead have the player that joins the room responsible for seeking the information it needs. you could use Room Properties for this.
Maybe in your case, I would consider making a "watcher" gameobject, that has a pointer to the player and when player becomes null, it destroy a series on non network gameobject associated with that player.
Also, in your case, I am not too sure why you want to send an RPC, you got already the information that a player left, that's enough to cleanup associated data for that player.
You may have indeed a complex use case, don't hesitate to explain further what you want to achieve, I may overlook something.
Bye,
Jean0 -
Hello, i know i can bypass the problem using other tricks, but seems strange that you can't have an RPCMode, wich gets executed only to the new upcoming players0